X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=poldek.spec;h=0686cbe503fe8b8bbf7d1c6dcfe6a565bda6f183;hb=5eb4cc67e7b99237a6e70ff6de4a50a12b7fd7f8;hp=7e6d404895af04490c241a4b453f0c38f2b5f0a4;hpb=c12d2d305026c1bc37a7f6f33c6c2149ff37e233;p=packages%2Fpoldek.git diff --git a/poldek.spec b/poldek.spec index 7e6d404..0686cbe 100644 --- a/poldek.spec +++ b/poldek.spec @@ -4,36 +4,45 @@ %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 db60 # DB 6.0 instead of 5.2 +%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 2013 +%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 db60} -%define db_pkg db6.0 -%define ver_db 6.0 +%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 db_pkg db4.7 +%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 rel 8 +%define rel 10 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 +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/releases/poldek/%{name}-%{version}.tar.xz -# Source0-md5: 392cfa125912fbedb6cc6d54dfbb80e3 +# Source0-md5: e569c8454df0932df53b09cee9998927 Source1: %{name}.conf Source2: %{name}-multilib.conf Source5: %{name}-aliases.conf @@ -47,11 +56,11 @@ Source100: %{name}-snap.conf Source101: %{name}-multilib-snap.conf Source102: %{name}-debuginfo-snap.conf Patch0: %{name}-size-type.patch -Patch1: %{name}-glibc-internal.patch -Patch2: %{name}-config.patch -Patch3: at-char-completion.patch -Patch4: %{name}-ignore-too-long-paths.patch -Patch5: %{name}-noorder.patch +Patch1: %{name}-config.patch +Patch2: %{name}-missing-include.patch +Patch3: pm-hooks.patch +Patch4: %{name}-setenv-null.patch +Patch5: %{name}-assert-sigint.patch URL: http://poldek.pld-linux.org/ BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel} BuildRequires: autoconf @@ -59,10 +68,10 @@ BuildRequires: automake >= 1:1.11 BuildRequires: bzip2-devel BuildRequires: check-devel BuildRequires: docbook-dtd412-xml -BuildRequires: gettext-devel +BuildRequires: gettext-tools +BuildRequires: libgomp-devel BuildRequires: libtool BuildRequires: libxml2-devel -BuildRequires: neon-devel BuildRequires: openssl-devel >= 0.9.7d BuildRequires: pcre-devel BuildRequires: pkgconfig @@ -71,7 +80,6 @@ BuildRequires: popt-devel BuildRequires: readline-devel >= 5.0 BuildRequires: rpm-devel >= %{ver_rpm} %{?with_python:BuildRequires: rpm-pythonprov} -BuildRequires: swig-python BuildRequires: tar >= 1:1.22 BuildRequires: xmlto BuildRequires: xz @@ -93,12 +101,12 @@ Requires(triggerpostun): awk Requires(triggerpostun): sed >= 4.0 Requires: %{db_pkg} >= %{ver_db}-%{ver_db_rel} Requires: %{name}-libs = %{version}-%{release} +Requires: /bin/run-parts 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 -# vf* scripts use sed +Requires: rpm-lib >= %{ver_rpm} Requires: sed +Conflicts: etckeeper < 1.18-2 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _libexecdir %{_prefix}/lib/%{name} @@ -259,7 +267,7 @@ CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline" %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}} +install -d $RPM_BUILD_ROOT/var/cache/%{name} %{__make} install -j1 \ DESTDIR=$RPM_BUILD_ROOT @@ -273,23 +281,29 @@ install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}} %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp} %ifarch i486 i686 ppc sparc alpha athlon - %define _ftp_arch %{_target_cpu} + %define ftp_arch %{_target_cpu} %endif %ifarch %{x8664} - %define _ftp_arch x86_64 - %define _ftp_alt_arch i686 + %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 ftp_arch i486 %endif %ifarch pentium2 pentium3 pentium4 - %define _ftp_arch i686 + %define ftp_arch i686 %endif %ifarch sparcv9 sparc64 - %define _ftp_arch sparc - %define _ftp_arch %{_target_cpu} + %define ftp_arch sparc + %define ftp_arch %{_target_cpu} %ifarch sparc64 - %define _ftp_alt_arch sparcv9 + %define ftp_alt_arch sparcv9 %endif %endif @@ -297,8 +311,9 @@ install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}} %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 @@ -310,28 +325,34 @@ install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}} %define pld_multilib_conf %{SOURCE10} %endif -%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf +%{__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} -%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf +%{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf %endif %if 0%{?pld_archive_conf:1} -%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf +%{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf %endif # Always install snapshot configs -%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \ +%{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' \ -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf -%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \ +%{__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} - %{__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 +%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}-%{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} @@ -342,6 +363,25 @@ install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}} %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf %endif +# create "all" meta repo +%if 0%{?ftp_alt_arch:1}%{?ftp_alt2_arch:1} +cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-all.conf +# group source for referring th+th-multiarch sources together, i.e poldek -n th-all +[source] +type = group +name = th-all +sources = th %{?ftp_alt_arch:th-%{ftp_alt_arch}} %{?ftp_alt2_arch:th-%{ftp_alt2_arch}} +EOF +%endif + +# th-2014 snap does not exist for x32 yet +%if "%{ftp_arch}" == "x32" +rm $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf +%endif +%if "%{ftp_alt2_arch}" == "x32" +rm $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-x32.conf +%endif + cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf %if %{with imode} @@ -393,50 +433,6 @@ fi %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/{ @@ -450,21 +446,44 @@ fi %{__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 + +%triggerpostun -- %{name} < 0.30.1-8 +if [ $1 -le 1 ]; then + # revert change on --downgrade + %{__sed} -i -re 's,^pm command = %{_libexecdir}/pm-command.sh,#&,' %{_sysconfdir}/%{name}/%{name}.conf +else + # setup pm command + %{__sed} -i -re 's,#?(pm command =).*,\1 %{_libexecdir}/pm-command.sh,' %{_sysconfdir}/%{name}/%{name}.conf +fi + %files -f %{name}.lang %defattr(644,root,root,755) %doc ChangeLog README* NEWS TODO configs %dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name}/pre-install.d +%{_sysconfdir}/%{name}/pre-install.d/README +%dir %{_sysconfdir}/%{name}/post-install.d +%{_sysconfdir}/%{name}/post-install.d/README %dir %{_sysconfdir}/%{name}/repos.d %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf @@ -472,7 +491,12 @@ fi %attr(755,root,root) %{_bindir}/poldek %attr(755,root,root) %{_bindir}/rpmvercmp %dir %{_libexecdir} -%attr(755,root,root) %{_libexecdir}/* +%attr(755,root,root) %{_libexecdir}/pm-command.sh +%attr(755,root,root) %{_libexecdir}/poldekuser-setup.sh +%attr(755,root,root) %{_libexecdir}/vfcompr +%attr(755,root,root) %{_libexecdir}/vfjuggle +%attr(755,root,root) %{_libexecdir}/vfsmb +%attr(755,root,root) %{_libexecdir}/zlib-in-rpm.sh %{_mandir}/man1/%{name}*.1* %lang(pl) %{_mandir}/pl/man1/%{name}* %{_infodir}/poldek.info*