File deb.spec of Package deb.openSUSE_12.1_Update
#
# spec file for package deb
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define admindir %{_localstatedir}/lib/rpm/
%define debhelper_ver 8.1.2
%define devscripts_ver 2.10.71
Name: deb
Version: 1.15.8.10
Release: 0
Url: http://www.debian.org
Provides: debhelper
Provides: devscripts
Provides: dpkg
Provides: dpkg-dev
Provides: dpkg-doc
Provides: dselect
Requires: cpio
Requires: html2text
Requires: make
Requires: patch
Requires: perl = %{perl_version}
Summary: Tools for Debian Packages
License: GPL-2.0+
Group: System/Packages
Source0: http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_%{version}.tar.bz2
Source1: http://ftp.de.debian.org/debian/pool/main/d/debhelper/debhelper_%{debhelper_ver}.tar.gz
Source2: http://ftp.de.debian.org/debian/pool/main/d/devscripts/devscripts_%{devscripts_ver}.tar.gz
Source3: sensible-editor
Patch0: debhelper-no-localized-manpages.patch
Patch1: devscripts-2.10.71-buildfix.patch
Patch2: debhelper-pod2man-no-utf8.patch
Patch3: devscripts-2.10.71-debcommit-hg16.patch
Patch4: update-alternatives-1.15.8.10-suse.patch
Patch5: dpkg-1.15.8.10-archtable-suse.patch
Patch6: dpkg-pod2man-no-utf8.patch
Patch7: devscripts-pod2man-no-utf8.patch
#PATCH-FIX-UPSTREAM (CVE) bnc#778291
Patch8: annotate-output.patch
BuildRequires: gcc-c++
BuildRequires: ncurses-devel
BuildRequires: zlib-devel
%if 0%{?suse_version} > 1010
BuildRequires: fdupes
%endif
BuildRequires: docbook-xsl-stylesheets
BuildRequires: libxslt
Requires(pre): /bin/touch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
BuildRequires: libbz2-devel
BuildRequires: sgmltool
BuildRequires: texlive-latex
BuildRequires: update-alternatives
Requires: update-alternatives
%if 0%{?suse_version} > 1100
BuildRequires: libselinux-devel
%define use_selinux 1
%endif
%if 0%{?suse_version} < 1120
%define _libexecdir /usr/lib
%endif
%endif
%if 0%{?fedora_version}
BuildRequires: libselinux-devel
BuildRequires: linuxdoc-tools
BuildRequires: tetex-latex
BuildRequires: texinfo-tex
%define use_selinux 1
%endif
%if 0%{?rhel_version}
BuildRequires: libselinux-devel
BuildRequires: linuxdoc-tools
BuildRequires: tetex-latex
BuildRequires: texinfo-tex
%define use_selinux 1
%endif
%if 0%{?centos_version}
BuildRequires: libselinux-devel
BuildRequires: linuxdoc-tools
BuildRequires: tetex-latex
BuildRequires: texinfo-tex
%define use_selinux 1
%endif
%description
This package contains tools for working with Debian packages. It makes
it possible to create and extract Debian packages. If Alien is
installed, the packages can be converted to RPMs.
This package contains the following Debian packages: dpkg, dselect,
dpkg-doc, dpkg-dev, debhelper, and devscripts.
%package devel
Summary: Development files for dpkg
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
%description devel
Libraries and header files for dpkg.
%lang_package
%prep
%setup -q -n dpkg-%{version} -b 1 -b 2
# do not unpack anything, just cd to source dir
#%setup -q -D -T -n %{_builddir}
cd ..
%patch0
%patch1
%if 0%{?suse_version} && 0%{?suse_version} < 1130
%patch2
%patch6
%patch7
%endif
%patch3
%patch4
%patch5
%patch6
%patch8
%build
%{?suse_update_config:%{suse_update_config -f}}
export CFLAGS="$RPM_OPT_FLAGS"
%if 0%{?use_selinux}
export SELINUX_LIBS="-lselinux"
%endif
%{configure}\
%if 0%{?use_selinux}
--with-selinux \
%endif
%if 0%{?suse_version} && 0%{?suse_version} < 1110
--disable-compiler-warnings \
%endif
--localstatedir=%{_localstatedir}/lib\
--with-admindir=%{_var}/lib/dpkg
# configure somehow does not detect architecture correctly in OBS (bnc#469337), so
# let's do an awful hack and fix it in config.h
# XXX: who knows if this works on s390? :)
%define debarch %{_arch}
%ifarch x86_64
%define debarch amd64
%endif
%ifarch %ix86
%define debarch i386
%endif
%ifarch ppc powerpc
%define debarch powerpc
%endif
%ifarch ppc64 powerpc64
%define debarch ppc64
%endif
sed -i 's/^#define ARCHITECTURE ""/#define ARCHITECTURE "%{debarch}"/' config.h
make %{?_smp_mflags}
#popd # dpkg
# This makes debhelper man pages
pushd ../debhelper
make %{?_smp_mflags} VERSION='%{debhelper_ver}'
popd
pushd ../devscripts-%{devscripts_ver}
# need dpkg-parsechangelog for devscripts
export PATH="$RPM_BUILD_DIR/dpkg-%{version}/scripts:$PATH"
export PERL5LIB="$RPM_BUILD_DIR/dpkg-%{version}/scripts"
cd ../devscripts-%{devscripts_ver}
make %{?_smp_mflags}
%install
%makeinstall
# remove update-alternatives stuff (included in separate package)
rm -rf %{buildroot}%{_sysconfdir}/alternatives
rm -rf %{buildroot}%{_localstatedir}/lib/dpkg/alternatives
rm -rf %{buildroot}%{_bindir}/update-alternatives
rm -rf %{buildroot}%{_sbindir}/update-alternatives
rm -rf %{buildroot}%{_mandir}/man8/update-alternatives.8
rm -rf %{buildroot}%{_mandir}/*/man8/update-alternatives.8
# locales
%{find_lang} dpkg
%{find_lang} dselect
%{find_lang} dpkg-dev
cat dpkg.lang dselect.lang dpkg-dev.lang > %{name}.lang
# docs
install -d -m 755 %{buildroot}/%{_docdir}/deb/dpkg
install -m 644 ABOUT-NLS %{buildroot}/%{_docdir}/deb/dpkg
install -m 644 AUTHORS %{buildroot}/%{_docdir}/deb/dpkg
install -m 644 COPYING %{buildroot}/%{_docdir}/deb/dpkg
install -m 644 doc/triggers.txt %{buildroot}/%{_docdir}/deb/dpkg
install -m 644 INSTALL %{buildroot}/%{_docdir}/deb/dpkg
install -m 644 NEWS %{buildroot}/%{_docdir}/deb/dpkg
install -m 644 README* %{buildroot}/%{_docdir}/deb/dpkg
install -m 644 THANKS %{buildroot}/%{_docdir}/deb/dpkg
install -m 644 TODO %{buildroot}/%{_docdir}/deb/dpkg
install -m 644 debian/changelog %{buildroot}/%{_docdir}/deb/dpkg
pushd ../debhelper
# autoscripts
install -d -m 755 %{buildroot}%{_datadir}/debhelper/autoscripts
install -m 644 autoscripts/* %{buildroot}%{_datadir}/debhelper/autoscripts
# perl modules:
install -d -m 755 %{buildroot}%{perl_vendorlib}/Debian/Debhelper
install -d -m 755 %{buildroot}%{perl_vendorlib}/Debian/Debhelper/Sequence
install -d -m 755 %{buildroot}%{perl_vendorlib}/Debian/Debhelper/Buildsystem
install -m 644 Debian/Debhelper/Buildsystem/*.pm %{buildroot}%{perl_vendorlib}/Debian/Debhelper/Buildsystem
install -m 644 Debian/Debhelper/Sequence/*.pm %{buildroot}%{perl_vendorlib}/Debian/Debhelper/Sequence
install -m 644 Debian/Debhelper/*.pm %{buildroot}%{perl_vendorlib}/Debian/Debhelper
# docs:
install -d -m 755 %{buildroot}%{_docdir}/deb/debhelper/examples
install -m 644 examples/* %{buildroot}%{_docdir}/deb/debhelper/examples
install -m 644 doc/* %{buildroot}%{_docdir}/deb/debhelper
install -m 644 debian/{changelog,copyright} %{buildroot}%{_docdir}/deb/debhelper
# man pages:
install -d -m 755 %{buildroot}%{_mandir}/man1
install -d -m 755 %{buildroot}%{_mandir}/man7
install -m 644 *.1 %{buildroot}%{_mandir}/man1
install -m 644 debhelper.7 %{buildroot}%{_mandir}/man7
# binaries:
install -d -m 755 %{buildroot}%{_bindir}
install -m 755 dh_*[^1-9] %{buildroot}%{_bindir}
install -m 755 dh %{buildroot}%{_bindir}
popd # debhelper
pushd ../devscripts-%{devscripts_ver}
make install DESTDIR=%{buildroot}
popd
# extras
install -m 755 %{SOURCE3} %{buildroot}%{_bindir}
%if 0%{?suse_version} > 1010
%fdupes %{buildroot}
%endif
%post
cd %{_localstatedir}/lib/dpkg
for f in diversions statoverride status ; do
[ ! -f $f ] && touch $f
done
exit 0
%if 0%{?suse_version} > 1010
%files lang -f %{name}.lang
%endif
%files
%defattr(-,root,root)
%doc %{_docdir}/deb
%doc %{_mandir}/man*/*
%dir %{_sysconfdir}/dpkg
%config(noreplace) %{_sysconfdir}/dpkg/*
%{_bindir}/*
%{_sbindir}/*
%{_libdir}/dpkg
%{_datadir}/dpkg
%{_localstatedir}/lib/dpkg
%{_datadir}/debhelper
%{perl_vendorlib}/Debian
%{perl_vendorlib}/Dpkg
%{perl_vendorlib}/Dpkg.pm
%{_libexecdir}/devscripts
%{_datadir}/devscripts
%if 0%{?suse_version} < 1110
/usr/share/locale/*/LC_MESSAGES/*
%dir /usr/share/locale/ast
%dir /usr/share/locale/ast/LC_MESSAGES
%endif
%files devel
%defattr(-,root,root)
%{_libdir}/libdpkg.a
%{_libdir}/pkgconfig/libdpkg.pc
%{_includedir}/dpkg
%changelog