File deb.spec of Package deb

#
# spec file for package deb (Version 1.14.21)
#
# Copyright (c) 2009 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/
#

# norootforbuild

%define debhelper_ver 7.0.17

Name:           deb
BuildRequires:  gcc-c++ ncurses-devel texlive-latex update-alternatives zlib-devel
BuildRequires:  libselinux-devel
Url:            http://www.debian.org
License:        GPL v2 or later
Group:          System/Packages
PreReq:         /bin/touch
Provides:       dpkg dpkg-dev debhelper dselect dpkg-doc
Requires:       perl = %{perl_version}
Requires:       cpio patch make html2text update-alternatives
AutoReqProv:    on
Version:        1.14.21
Release:        10.<RELEASE38>
Summary:        Tools for Debian Packages
Source:         dpkg_%{version}.tar.bz2
Source1:        debhelper_%{debhelper_ver}.tar.bz2
Patch0:         debhelper-no-localized-manpages.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%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, and debhelper.



Authors:
--------
    Klee Dienes <klee@mit.edu>
    Joey Hess <joeyh@master.debian.org>

%prep
%setup -q -n dpkg-%{version} -b 1
cd ..
%patch0
cd -
# update arch table
sed -n '/linux-gnu/ s/linux-gnu/suse-linux/p' debian/archtable > debian/archtable.tmp
cat debian/archtable.tmp >> debian/archtable
rm debian/archtable.tmp

%build
%{?suse_update_config:%{suse_update_config -f}}
export CFLAGS="$RPM_OPT_FLAGS"
export SELINUX_LIBS="-lselinux"
%configure\
	--with-selinux \
	--localstatedir=%{_localstatedir}/lib\
	--libdir=%{_prefix}/lib
make %{?jobs:-j%jobs}
# This makes debhelper man pages
cd ../debhelper
make VERSION='%{debhelper_ver}'

%install
##
# dpkg stuff
##
%makeinstall
# locales
%{find_lang} dpkg
%{find_lang} dselect
%{find_lang} dpkg-dev
cat dpkg.lang dselect.lang dpkg-dev.lang > deb.lang
# docs
install -d -m 755 $RPM_BUILD_ROOT/%{_docdir}/deb/dpkg
install -m 644 ABOUT-NLS $RPM_BUILD_ROOT/%{_docdir}/deb/dpkg
install -m 644 AUTHORS $RPM_BUILD_ROOT/%{_docdir}/deb/dpkg
install -m 644 COPYING $RPM_BUILD_ROOT/%{_docdir}/deb/dpkg
install -m 644 doc/triggers.txt $RPM_BUILD_ROOT/%{_docdir}/deb/dpkg
install -m 644 INSTALL $RPM_BUILD_ROOT/%{_docdir}/deb/dpkg
install -m 644 NEWS $RPM_BUILD_ROOT/%{_docdir}/deb/dpkg
install -m 644 README* $RPM_BUILD_ROOT/%{_docdir}/deb/dpkg
install -m 644 THANKS $RPM_BUILD_ROOT/%{_docdir}/deb/dpkg
install -m 644 TODO $RPM_BUILD_ROOT/%{_docdir}/deb/dpkg
install -m 644 debian/changelog $RPM_BUILD_ROOT/%{_docdir}/deb/dpkg
##
# debhelper stuff
##
cd ../debhelper
# autoscripts
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/debhelper/autoscripts
install -m 644 autoscripts/* $RPM_BUILD_ROOT%{_datadir}/debhelper/autoscripts
# perl modules:
install -d -m 755 $RPM_BUILD_ROOT%{perl_vendorlib}/Debian/Debhelper
install -d -m 755 $RPM_BUILD_ROOT%{perl_vendorlib}/Debian/Debhelper/Sequence
install -m 644 Debian/Debhelper/Sequence/*.pm $RPM_BUILD_ROOT%{perl_vendorlib}/Debian/Debhelper/Sequence
install -m 644 Debian/Debhelper/*.pm $RPM_BUILD_ROOT%{perl_vendorlib}/Debian/Debhelper
# docs:
install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/deb/debhelper/examples
install -m 644 examples/* $RPM_BUILD_ROOT%{_docdir}/deb/debhelper/examples
install -m 644 doc/* $RPM_BUILD_ROOT%{_docdir}/deb/debhelper
install -m 644 debian/{changelog,copyright} $RPM_BUILD_ROOT%{_docdir}/deb/debhelper
# man pages:
install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1
install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man7
install -m 644 *.1 $RPM_BUILD_ROOT%{_mandir}/man1
install -m 644 debhelper.7 $RPM_BUILD_ROOT%{_mandir}/man7
# binaries:
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
install -m 755 dh_*[^1-9] $RPM_BUILD_ROOT%{_bindir}
##
# remove update-alternatives stuff (included in own package)
##
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/alternatives
rm -rf $RPM_BUILD_ROOT%{_localstatedir}/lib/dpkg/alternatives
rm -rf $RPM_BUILD_ROOT%{_bindir}/update-alternatives
rm -rf $RPM_BUILD_ROOT%{_sbindir}/update-alternatives
rm -rf $RPM_BUILD_ROOT%{_mandir}/man8/update-alternatives.8
rm -rf $RPM_BUILD_ROOT%{_mandir}/*/man8/update-alternatives.8

%clean
rm -rf $RPM_BUILD_ROOT

%post
cd %{_localstatedir}/lib/dpkg
for f in diversions statoverride status ; do
    [ ! -f $f ] && touch $f
done
exit 0

%files -f deb.lang
%defattr(-,root,root)
%doc %{_docdir}/deb
%doc %{_mandir}/fr
%doc %{_mandir}/ja
%doc %{_mandir}/sv
%doc %{_mandir}/es
%doc %{_mandir}/pt_BR
%doc %{_mandir}/ru
%doc %{_mandir}/de
%doc %{_mandir}/pl
%doc %{_mandir}/hu
%doc %{_mandir}/man*/*
%dir %{_sysconfdir}/dpkg
%config(noreplace) %{_sysconfdir}/dpkg/*
%{_bindir}/*
%{_sbindir}/*
%{_prefix}/lib/dpkg
%{_datadir}/dpkg
%{_localstatedir}/lib/dpkg
%{_datadir}/debhelper
%{perl_vendorlib}/Debian
%{perl_vendorlib}/Dpkg
%{perl_vendorlib}/Dpkg.pm

%changelog
* Mon Apr 06 2009 puzel@suse.cz
- partially revert change from Aug 12 2008 (bnc#467332)
* Tue Sep 16 2008 mrueckert@suse.de
- do not package update-alternatives it conflicts with the required
  package update-alternatives
* Tue Sep 02 2008 prusnak@suse.cz
- updated to 1.14.21
  * lots of fixes - see ChangeLog
- enabled SELinux support [Fate#303662]
* Mon Sep 01 2008 puzel@suse.cz
- update debhelper to 7.0.17
  * dh_auto_install: Fix man page, was referring to dh_auto_clean.
  * dh_gencontrol: Drop the Homepage field from udebs. Closes debian bug #492719
  * Typo. Closes debian bug #493062
  * dh_auto_install: Improve check for MakeMaker, to avoid passing PREFIX
  if the Makefile was generated by Module::Build::Compat. Closes debian bug #496157
* Tue Aug 12 2008 puzel@suse.cz
- fix paths
  * install perl stuff to %%{perl_vendorlib}/Debian where it is
  expected by alien
* Mon Aug 11 2008 coolo@suse.de
- fix paths
* Mon Jul 21 2008 puzel@suse.cz
- update debhelper to 7.0.16
  * dh: Avoid passing --with on to subcommands. Closes debian bug #490886
  * dh_installchangelogs: When searching for changelog in v7 mode, skip
  empty files. Closes debian bug #490937
* Fri Jul 18 2008 puzel@suse.cz
- update debhelper to 7.0.15
  * dh_clean: Do not delete *-stamp files in -k mode in v7. Closes debian bug #489918
* Tue Jul 08 2008 puzel@suse.cz
- update debhelper to 7.0.14
  * load python-support sequence file first, to allow ones loaded later to disable it
* Mon Jul 07 2008 puzel@suse.cz
- update dpkg to 1.14.19
  * a lot of changes and bugfixes
  * for complete changelog see program sources or
  /usr/share/doc/packages/deb/dpkg/changelog
  * removed dpkg-gcc4.patch - compiles fine without it
  * removed dpkg-make.patch, dpkg-automake.diff, dpkg-strip.patch
  * not needed anymore because of heavy changes in the build system
  * removed dpkg_1.10.23-doc.patch - fixed in upstream
- update debhelper to 7.0.13
  * a lot of changes and bugfixes
  * for complete changelog see program sources or
  /usr/share/doc/packages/deb/debhelper/changelog
  * debhelper-no-localized-manpages.diff - do not use po4a to generate
  localized documentation
- dpkg is now built by configure/make
- debhelper is now built by make
* Thu Jul 26 2007 dmueller@suse.de
- remove config.guess dependency completely
* Tue Jul 24 2007 dmueller@suse.de
- link the config.guess from automake
* Sun Apr 22 2007 ro@suse.de
- use texlive for building
* Fri Mar 30 2007 aj@suse.de
- Adjust BuildRequires.
* Fri Aug 18 2006 aj@suse.de
- Fix build with new make.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri Jan 13 2006 schwab@suse.de
- Don't strip binaries.
* Wed Dec 21 2005 ro@suse.de
- remove unpackaged symlinks
* Thu Sep 08 2005 mjancar@suse.cz
- package missing dpkg-{architecture,scanpackages,scansources} (#106239)
* Thu May 12 2005 meissner@suse.de
- use RPM_OPT_FLAGS
* Fri Apr 08 2005 uli@suse.de
- fixed to build with GCC4
* Thu Feb 10 2005 rengelhard@suse.de
- update dpkg to 1.10.27 (just translation updates)
* Fri Jan 21 2005 ro@suse.de
- update dependency: html2txt -> html2text
* Wed Jan 12 2005 rengelha@suse.de
- update dpkg to 1.10.26
* Wed Jan 05 2005 rengelhard@suse.de
- update debhelper to 4.2.30
* Tue Jan 04 2005 rengelhard@suse.de
- update debhelper to 4.2.29
* Wed Dec 15 2004 rengelhard@suse.de
- update debhelper to 4.2.28
* Mon Dec 13 2004 rengelhard@suse.de
- update debhelper to 4.2.27
* Tue Nov 16 2004 rengelhard@suse.de
- update dpkg to 1.10.25
* Thu Nov 11 2004 rengelhard@suse.de
- update debhelper to 4.2.24
* Fri Oct 29 2004 rengelhard@suse.de
- update debhelper to 4.2.23
* Wed Oct 27 2004 rengelhard@suse.de
- update dpkg to 1.10.24
* Wed Oct 13 2004 rengelhard@suse.de
- update debhelper to 4.2.21
* Wed Sep 08 2004 ro@suse.de
- remove stuff now present in own update-alternatives package
* Thu Aug 19 2004 mcihar@suse.cz
- update debhelper to 4.2.19
- update dpkg to 1.10.23
- use sed rather than patches
- remove patches accepted in upstream
* Mon May 31 2004 mcihar@suse.cz
- update debhelper to 4.2.10
- update dpkg to 1.10.21
* Thu Mar 04 2004 mcihar@suse.cz
- no root for build
- revert to manual debhelper installation as installation using
  debhelper needs dpkg and debhelper installed
* Wed Mar 03 2004 mcihar@suse.cz
- debhelper has debian/control file, so do not install manually
- update debhelper to 4.2.4
- update dpkg to 1.10.18.1
* Wed Jan 28 2004 ro@suse.de
- debhelper has no debian/control file, so install manually
* Tue Jan 27 2004 mcihar@suse.cz
- install debhelper man pages on correct place
* Mon Jan 26 2004 mcihar@suse.cz
- updated debhelper to 4.1.88 and dpkg to 1.10.18
* Wed Aug 20 2003 mjancar@suse.cz
- require the perl version we build with
* Thu Aug 07 2003 mcihar@suse.cz
- updated debhelper to 4.1.57
* Mon Jul 28 2003 schwab@suse.de
- Fix format string.
- Fix undefined use of longjmp.
- Use perl_vendorlib.
* Wed Jun 18 2003 mcihar@suse.cz
- updated debhelper to 4.1.47 (mostly fixes in dh_python)
- included directories for translated man pages
- use find_lang
* Tue May 13 2003 mcihar@suse.cz
- updated debhelper to 4.1.43
- updated dpkg to 1.1.10
* Tue Apr 08 2003 mcihar@suse.cz
- updated debhelper to 4.1.40
- fixed problems with new coreutils
* Thu Mar 06 2003 mcihar@suse.cz
- configuration files under /etc marked as %%config
* Thu Jan 30 2003 mcihar@suse.cz
- updated debhelper to 4.1.29:
  * Added a dh_python command.
  * Various fixes.
* Wed Nov 13 2002 mcihar@suse.cz
- updated dpkg to 1.10.9, major changes:
  * Make the multiline regex have an upper bound, instead of being
  unbounded, as newer perls have a larger stack frame, which cause them
  to segfault quicker with larger inputs.
  * Fix segfault in md5sum if the file being checked doesn't exist.
  * Fix extraction of md5sum in dpkg-scanpackages.
  * Handle directories better in md5sum.
  * Fix several read pass buffer bugs, and a memleak.
  * Fix segfault when --auto-deconfigure is given.
- updated debhelper to 4.1.20, major changes:
  * typo in dh_shlibdeps(1)
  * dh_fixperms: Make sure .pm files are 0644.
  * dh_strip: detect and don't strip debug/*.so files.
  * Various improvements to debhelper(1).
  * Clarified dh_perl man page.
  * Fixed excessive escaping around terms in DH_EXCLUDE_FIND.
  * Patch from Andrew Suffield to make dh_perl understand #!/usr/bin/env perl
- included part of postinst script from debian package
* Mon Nov 11 2002 ro@suse.de
- changed neededforbuild <sp> to <opensp>
- changed neededforbuild <sp-devel> to <>
* Wed Aug 28 2002 mcihar@suse.cz
- corrected requires
* Wed Aug 07 2002 mcihar@suse.cz
- updated to debhelper 4.1.3:
  * various bugfixes
  * removed /usr/doc manglement code from postinst and prerm
  * removed dh_installxaw
  * dh_installchangelogs installs debian/NEWS
- updated to dpkg 1.10.4:
  * plenty of bugfixes and new switches
  * added Large File Summit extension
  * added manpages for dpkg.cfg and dselect.cfg
  * updated translations
  * install archtable into /usr/share/dpkg/
- dpkg is now build by debian/rules not by script in spec
- removed md5sum.1 start-stop-daemon.8 install-info.8 manpages also
  for other locales (these programs are not installed)
* Tue Jun 11 2002 mcihar@suse.cz
- updated to debhelper 4.0.11 and dpkg 1.9.21
* Mon Aug 13 2001 ro@suse.de
- changed neededforbuild <sp_libs> to <sp-devel>
* Fri Jun 08 2001 cihlar@suse.cz
- fixed to compile with new autoconf
* Tue Apr 24 2001 cihlar@suse.cz
- fixed warnings on ia64
* Wed Apr 18 2001 cihlar@suse.cz
- fixed to compile
* Mon Mar 05 2001 cihlar@suse.cz
- dpkg updated to version 1.8.3.1
- debhelper updated to version 3.0.8
* Tue Dec 05 2000 schwab@suse.de
- Fix broken declaration.
* Tue Oct 31 2000 cihlar@suse.cz
- update to version 1.6.14
- bzipped sources
* Tue May 23 2000 cihlar@suse.cz
- added files in /etc and /var to %%files
* Mon May 22 2000 cihlar@suse.cz
- removed install-info and start-stop-daemon
* Mon May 15 2000 schwab@suse.de
- Fixed for ia64.
* Wed May 03 2000 cihlar@suse.cz
- package created - version 1.4.0.35 (debhelper 1.1.24)