dpkg/dpkg.spec
Tomáš Chvátal 872cac8901 Accepting request 539790 from home:pluskalm:branches:system:packagemanager
- Use dbpath macro for locationg rpm state directory
- Use dbpath macro for locationg rpm state directory

OBS-URL: https://build.opensuse.org/request/show/539790
OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=49
2017-11-08 08:48:08 +00:00

169 lines
4.7 KiB
RPMSpec

#
# spec file for package dpkg
#
# Copyright (c) 2017 SUSE LINUX 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/
#
Name: dpkg
Version: 1.18.23
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-suse.patch
# PATCH-FIX-SUSE: update if two alternatives have same priority bnc#969171
Patch7: 0001-In-case-of-equal-priority-rather-update.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: libbz2-devel
BuildRequires: libselinux-devel
BuildRequires: libtool
BuildRequires: ncurses-devel
BuildRequires: update-alternatives
BuildRequires: xz
BuildRequires: zlib-devel
BuildRequires: perl(Date::Parse)
BuildRequires: perl(IO::String)
Requires: cpio
Requires: make
Requires: patch
Requires: perl = %{perl_version}
Requires: update-alternatives
Requires: perl(Date::Parse)
Requires(post): coreutils
Recommends: perl(File::FcntlLock)
Provides: deb = %{version}
Obsoletes: deb < %{version}
Provides: dpkg-dev = %{version}
Provides: dpkg-doc = %{version}
Provides: dselect = %{version}
%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++
Requires: %{name} = %{version}
Provides: deb-devel = %{version}
Obsoletes: deb-devel < %{version}
%description devel
Libraries and header files for dpkg.
%lang_package
%prep
%setup -q
%patch1 -p1
%patch7 -p1
%build
autoreconf -fvi
export CFLAGS="%{optflags}"
export SELINUX_LIBS="-lselinux"
%configure \
--disable-silent-rules \
--with-selinux \
--localstatedir=%{_localstatedir}/lib \
--with-admindir=%{_dbpath}
# 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}
%check
make %{?_smp_mflags} check
%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
%doc ABOUT-NLS AUTHORS COPYING doc/triggers.txt NEWS README* THANKS TODO debian/changelog
%{_mandir}/man*/*
%exclude %{_mandir}/man*/update-alternatives*
%dir %{_sysconfdir}/dpkg
%config(noreplace) %{_sysconfdir}/dpkg/*
%{_bindir}/*
%{_sbindir}/*
%{_libdir}/dpkg
%{_datadir}/dpkg
%{_localstatedir}/lib/dpkg
%{perl_vendorlib}/Dpkg
%{perl_vendorlib}/Dpkg.pm
%{perl_vendorlib}/Dselect
%{perl_vendorlib}/Dselect/Ftp.pm
%files devel
%{_libdir}/libdpkg.a
%{_libdir}/libdpkg.la
%{_libdir}/pkgconfig/libdpkg.pc
%{_includedir}/dpkg
%changelog