%bcond_without imode # don't build interactive mode
%bcond_without python # don't build python bindings
%bcond_with snap # install configs for official Th snapshot
+%bcond_with db61 # DB 6.1 instead of 5.2
+%bcond_with rpm4 # use rpm4/db4.7 instead of rpm5
# current snapshot name
-%define SNAP 2012
+%define SNAP 2014
# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
+# NOTE: poldek links with "system db" (-ldb) anyway if it exists
+%if %{with db61}
+%define db_pkg db6.1
+%define ver_db 6.1
+%define ver_db_rel 1
+%else
%define db_pkg db5.2
%define ver_db 5.2
%define ver_db_rel 3
+%endif
+
+%if %{with rpm4}
+%define ver_db 4.7.25
+%define ver_db_rel 1
+%define ver_rpm 4.5-49
+%else
%define ver_rpm 5.4.10
+%endif
-%define snap rc7
-%define rel 4%{?with_snap:.%{SNAP}}
+%define rel 4
Summary: RPM packages management helper tool
Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
Name: poldek
-Version: 0.30.0
-Release: 1.%{snap}.%{rel}
+Version: 0.30.1
+Release: %{rel}%{?with_snap:.%{SNAP}}
License: GPL v2
Group: Applications/System
#Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
-Source0: http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}%{snap}.tar.xz
-# Source0-md5: 56ba9e7b709a99965f42e24e65eb2d7f
+Source0: http://carme.pld-linux.org/~megabajt/releases/poldek/%{name}-%{version}.tar.xz
+# Source0-md5: e569c8454df0932df53b09cee9998927
Source1: %{name}.conf
Source2: %{name}-multilib.conf
Source5: %{name}-aliases.conf
Source100: %{name}-snap.conf
Source101: %{name}-multilib-snap.conf
Source102: %{name}-debuginfo-snap.conf
-Patch0: %{name}-vserver-packages.patch
+Patch0: %{name}-size-type.patch
Patch1: %{name}-config.patch
-Patch2: %{name}-size-type.patch
-Patch3: %{name}-Os-fail-workaround.patch
-Patch4: %{name}-git.patch
-Patch5: %{name}-inherited-group.patch
-Patch6: pkglibdir.patch
+Patch2: %{name}-missing-include.patch
URL: http://poldek.pld-linux.org/
+BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
BuildRequires: autoconf
-BuildRequires: automake
+BuildRequires: automake >= 1:1.11
BuildRequires: bzip2-devel
BuildRequires: check-devel
-BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
BuildRequires: docbook-dtd412-xml
-BuildRequires: gettext-devel
+BuildRequires: gettext-tools
BuildRequires: libtool
BuildRequires: libxml2-devel
BuildRequires: neon-devel
BuildRequires: rpm-devel >= %{ver_rpm}
%{?with_python:BuildRequires: rpm-pythonprov}
BuildRequires: swig-python
+BuildRequires: tar >= 1:1.22
BuildRequires: xmlto
+BuildRequires: xz
BuildRequires: zlib-devel
%if %{with static}
-BuildRequires: bzip2-static
BuildRequires: %{db_pkg}-static >= %{ver_db}-%{ver_db_rel}
+BuildRequires: bzip2-static
BuildRequires: glibc-static
-BuildRequires: libselinux-static
BuildRequires: libxml2-static
BuildRequires: ncurses-static
BuildRequires: openssl-static
%endif
Requires(triggerpostun): awk
Requires(triggerpostun): sed >= 4.0
-Requires: %{name}-libs = %{version}-%{release}
Requires: %{db_pkg} >= %{ver_db}-%{ver_db_rel}
+Requires: %{name}-libs = %{version}-%{release}
Requires: rpm >= %{ver_rpm}
Requires: rpm-db-ver = %{ver_db}
-#Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
-Requires: rpm-lib >= 5.4.10
+Requires: rpm-lib >= %{ver_rpm}
# vf* scripts use sed
Requires: sed
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Summary(pl.UTF-8): Moduły języka Python dla poldka
Group: Libraries/Python
Requires: %{name}-libs = %{version}-%{release}
-%pyrequires_eq python-libs
+Requires: python-libs
%description -n python-poldek
Python modules for poldek.
%patch0 -p1
%patch1 -p1
%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
%{__rm} m4/libtool.m4 m4/lt*.m4
chmod u+x ./configure ./doc/conf-xml2.sh
%build
+%{__gettextize}
%{__libtoolize}
%{__aclocal} -I m4
%{__autoheader}
%{__automake}
cd ..
-CPPFLAGS="%{rpmcppflags} -std=gnu99"
+CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline"
%configure \
%{?with_static:--enable-static --disable-shared} \
%{!?with_imode:--disable-imode} \
%ifarch %{x8664}
%define _ftp_arch x86_64
%define _ftp_alt_arch i686
+ %define _ftp_alt2_arch x32
+%endif
+%ifarch x32
+ %define _ftp_arch x32
+ %define _ftp_alt_arch x86_64
+ %define _ftp_alt2_arch i686
%endif
%ifarch i586
%define _ftp_arch i486
%define pld_debuginfo_conf %{SOURCE8}
%define pld_archive_conf %{SOURCE11}
-%ifarch %{x8664}
+%ifarch %{x8664} x32
%define pld_multilib_conf %{SOURCE2}
+ %define pld_multilib2_conf %{SOURCE2}
%endif
# aidath
%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
%if 0%{?pld_multilib_conf:1}
- %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
+ %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{_ftp_alt_arch}.conf
+%endif
+
+%if 0%{?pld_multilib2_conf:1}
+ %{__sed} 's|%%ARCH%%|%{_ftp_alt2_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{_ftp_alt2_arch}.conf
%endif
%if 0%{?pld_debuginfo_conf:1}
-e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \
-e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE102} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-debuginfo.conf
-%ifarch %{x8664}
+%ifarch %{x8664} x32
%{__sed} -e 's|%%ARCH%%|%{_ftp_alt_arch}|g' \
- -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf
+ -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{_ftp_alt_arch}.conf
+ %{__sed} -e 's|%%ARCH%%|%{_ftp_alt2_arch}|g' \
+ -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{_ftp_alt2_arch}.conf
%endif
%if %{with snap}
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
-%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
-if [ -f /etc/poldek.conf.rpmsave ]; then
- awk '/^source/ {
- name = $3;
- path = $4;
- auto = "yes";
- autoup = "yes";
- type = "pdir";
- pri = "";
-
- if (sub(",noauto", "", name)) {
- auto = "no";
- }
-
- # process pri=\d+
- if (match(name, /,pri=[0-9]+/)) {
- pri = substr(name, RSTART + 5, RLENGTH - 5);
- name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
- }
-
- # skip ac sources. already in new config.
- if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
- print "";
- print "[source]";
- print "name = " name;
- print "type = " type;
- print "path = " path;
- print "auto = " auto;
- print "autoup = " autoup;
- if (pri) {
- print "pri = " pri;
- }
- }
-
- }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
- echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
-
- # copy hold=
- hold=$(grep ^hold /etc/poldek.conf.rpmsave)
- if [ "$hold" ]; then
- %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
- fi
-fi
-
%triggerpostun -- poldek < 0.30-0.20080225.00.1
if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
%{__sed} -i -e '/^%%include source.conf/{
%{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
- cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
- cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
+ %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
+ %{__mv} -v %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
fi
%ifarch %{x8664}
if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
- cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
- cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
+ %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
+ %{__mv} -v %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
fi
%endif
+%triggerpostun -- poldek < 0.30.1-3
+if [ -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf.rpmsave ]; then
+ %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-%{_ftp_alt_arch}.conf{,.rpmnew}
+ %{__mv} -v %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-%{_ftp_alt_arch}.conf
+fi
+if [ -f %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf.rpmsave ]; then
+ %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{_ftp_alt_arch}.conf{,.rpmnew}
+ %{__mv} -v %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{_ftp_alt_arch}.conf
+fi
+
%files -f %{name}.lang
%defattr(644,root,root,755)
%doc ChangeLog README* NEWS TODO configs