SHA256
6
0
forked from pool/dpkg

Accepting request 127340 from home:flichtenheld:deb-split

split the deb package. See http://lists.opensuse.org/opensuse-factory/2012-06/msg00963.html for context

OBS-URL: https://build.opensuse.org/request/show/127340
OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=1
This commit is contained in:
Wojtek Dziewięcki
2012-09-07 06:53:00 +00:00
committed by Git OBS Bridge
commit 729a181ea9
11 changed files with 1387 additions and 0 deletions

203
dpkg.spec Normal file
View File

@@ -0,0 +1,203 @@
#
# spec file for package dpkg
#
# 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/
Name: dpkg
Version: 1.16.7
Release: 0
Summary: Debian package management system
License: GPL-2.0+
Group: System/Packages
Url: http://www.debian.org
Source0: http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_%{version}.tar.xz
Source3: sensible-editor
# PATCH-FIX-OPENSUSE replace debian with opensuse. replace macros. update-alternatives temp directories' path and name from dpkg* to rpm*.
Patch1: update-alternatives-%{version}-suse.patch
# PATCH-FIX-OPENSUSE add openSUSE supported architectures
Patch2: dpkg-archtable-suse.patch
# PATCH-FIX-UPSTREAM remove --utf8 since we only build En manpages.
Patch3: dpkg-pod2man-no-utf8.patch
BuildRequires: gcc-c++
BuildRequires: ncurses-devel
BuildRequires: xz
BuildRequires: zlib-devel
Requires: cpio
Requires: make
Requires: patch
Provides: deb = %{version}
Obsoletes: deb < %{version}
Provides: dpkg-dev = %{version}
Provides: dpkg-doc = %{version}
Provides: dselect = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(pre): /bin/touch
%if 0%{?suse_version}
BuildRequires: libbz2-devel
BuildRequires: update-alternatives
Requires: update-alternatives
Requires: perl(Date::Parse)
Requires: perl = %{perl_version}
BuildRequires: libselinux-devel
%define use_selinux 1
%if 0%{?suse_version} < 1120
%define _libexecdir /usr/lib
%endif
%endif
%if 0%{?fedora_version}
BuildRequires: libselinux-devel
%define use_selinux 1
%endif
%if 0%{?rhel_version}
BuildRequires: libselinux-devel
%define use_selinux 1
%endif
%if 0%{?centos_version}
BuildRequires: libselinux-devel
%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.
%package devel
Summary: Development files for dpkg
Group: Development/Libraries/C and C++
Provides: deb-devel = %{version}
Obsoletes: deb-devel < %{version}
Requires: %{name} = %{version}
%description devel
Libraries and header files for dpkg.
%package lang
Summary: Languages for package %{name}
Group: System/Localization
Requires: %{name} = %{version}
Provides: %{name}-lang-all = %{version}
Provides: deb-lang = %{version}
Obsoletes: deb-lang < %{version}
Supplements: packageand(bundle-lang-other:%{name})
%if 0%{?suse_version} && 0%{?suse_version} < 1120
# BuildArch: noarch not supported on SLE 11
%else
BuildArch: noarch
%endif
%description lang
Provides translations to the package %{name}
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%if 0%{?suse_version} && 0%{?suse_version} < 1130
%patch3 -p1
%endif
%build
export CFLAGS="%{optflags}"
%if 0%{?use_selinux}
export SELINUX_LIBS="-lselinux"
%endif
%{configure}\
%if 0%{?use_selinux}
--with-selinux \
%endif
--localstatedir=%{_localstatedir}/lib\
--with-admindir=%{_localstatedir}/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}
%install
%{__make} install DESTDIR=%{?buildroot}
# 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} %{name}
%{find_lang} dselect
%{find_lang} dpkg-dev
cat dselect.lang dpkg-dev.lang >> %{name}.lang
# extras
install -m 755 %{SOURCE3} %{buildroot}%{_bindir}
%post
cd %{_localstatedir}/lib/dpkg
for f in diversions statoverride status ; do
[ ! -f $f ] && touch $f
done
exit 0
%files lang -f %{name}.lang
%files
%defattr(-,root,root)
%doc ABOUT-NLS AUTHORS COPYING doc/triggers.txt NEWS README* THANKS TODO debian/changelog
%doc %{_mandir}/man*/*
%dir %{_sysconfdir}/dpkg
%config(noreplace) %{_sysconfdir}/dpkg/*
%{_bindir}/*
%{_sbindir}/*
%{_libdir}/dpkg
%{_datadir}/dpkg
%{_localstatedir}/lib/dpkg
%{perl_vendorlib}/Debian
%{perl_vendorlib}/Dpkg
%{perl_vendorlib}/Dpkg.pm
%files devel
%defattr(-,root,root)
%{_libdir}/libdpkg.a
%{_libdir}/pkgconfig/libdpkg.pc
%{_includedir}/dpkg
%changelog