Blob Blame History Raw
# This is not archful information, and mimics RPM's paths
%global _debconfigdir %{_prefix}/lib/debbuild

Name:           debbuild
Version:        16.3.0
Release:        2%{?dist}
Summary:        Build Debian-compatible .deb packages from RPM .spec files

License:        GPLv2+
URL:            https://github.com/ascherer/debbuild/
Source0:        https://github.com/ascherer/debbuild/archive/%{name}-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  perl(Pod::Man)

Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires:       dpkg
Requires:       dpkg-dev
Requires(post): dpkg-dev

Requires:       pax, fakeroot, bash
Requires:       patch, bzip2, xz

%if 0%{?fedora} || 0%{?rhel} >= 8
Recommends:     quilt
%else
Requires:       quilt
%endif

%{?perl_default_filter}

%description
debbuild attempts to build Debian-friendly semi-native packages from
RPM spec files, RPM-friendly tarballs, and RPM source packages
(.src.rpm files).  It accepts most of the options rpmbuild does, and
should be able to interpret most spec files usefully.

%prep
%setup -q -n %{name}-%{name}-%{version}


%build
# Transfer version into the live systems
sed -e "s/@VERSION@/%{version}/g" -i debbuild
sed -e "s/@VERSION@/%{version}/g" -i Makefile


%install
%make_install
mkdir -p %{buildroot}%{_debconfigdir}/macros.d
cp macros/macros.in %{buildroot}%{_debconfigdir}/macros
mkdir -p %{buildroot}%{_sysconfdir}/%{name}

%post
if [ -x %{_bindir}/dpkg-architecture ]; then
DEB_HOST_CPU=`dpkg-architecture -qDEB_HOST_GNU_CPU 2>/dev/null`
DEB_HOST_OS=`dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null`
DEB_HOST_SYSTEM=`dpkg-architecture -qDEB_HOST_GNU_SYSTEM 2>/dev/null`
DEB_HOST_ARCH=`dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null`
DEB_BUILD_ARCH=`dpkg-architecture -qDEB_BUILD_ARCH 2>/dev/null`

sed -e "s/@HOST_ARCH@/${DEB_HOST_ARCH}/g" \
    -e "s/@BUILD_ARCH@/${DEB_BUILD_ARCH}/g" \
    -e "s/@BUILD_OS@/${DEB_BUILD_OS}/g" \
    -e "s/@HOST_CPU@/${DEB_HOST_CPU}/g" \
    -e "s/@HOST_OS@/${DEB_HOST_OS}/g" \
    -e "s/@HOST_SYSTEM@/${DEB_HOST_SYSTEM}/g" \
    -i %{_debconfigdir}/macros
fi


%files
%{!?_licensedir:%global license %doc}
%license COPYING
%{_bindir}/%{name}
%{_mandir}/man8/%{name}.8*
%dir %{_debconfigdir}
%{_debconfigdir}/macros
%dir %{_debconfigdir}/macros.d
%dir %{_sysconfdir}/debbuild

%changelog
* Thu May 19 2016 Jitka Plesnikova <jplesnik@redhat.com> - 16.3.0-2
- Perl 5.24 re-rebuild of bootstrapped packages

* Sun May 15 2016 Neal Gompa <ngompa13@gmail.com> - 16.3.0-1
- Switch to ascherer fork, update to 16.3.0

* Sun May 15 2016 Jitka Plesnikova <jplesnik@redhat.com> - 0.11.2-3
- Perl 5.24 rebuild

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jul 16 2015 Neal Gompa <ngompa13{%}gmail{*}com> - 0.11.2-1
- Update to 0.11.2

* Wed Jul  8 2015 Neal Gompa <ngompa13{%}gmail{*}com> - 0.10.1-5
- Fix previous changelog entry

* Wed Jul  8 2015 Neal Gompa <ngompa13{%}gmail{*}com> - 0.10.1-4
- Add magic definition for storing license file to work on <el7

* Wed Jul  8 2015 Neal Gompa <ngompa13{%}gmail{*}com> - 0.10.1-3
- Fixed perl BuildRequires error for <el7

* Sun Jul  5 2015 Neal Gompa <ngompa13{%}gmail{*}com> - 0.10.1-2
- Fix dependencies on dpkg-dev and xz
- Remove superfluous spec statements (BuildRoot, etc.)
- Make variable usage consistent

* Fri Jun 12 2015 Neal Gompa <ngompa13{%}gmail{*}com> - 0.10.1-1
- Initial packaging