]> git.pld-linux.org Git - packages/poldek.git/blobdiff - poldek.spec
- added db60 bcond
[packages/poldek.git] / poldek.spec
index cf6ef3164bf7353c91546d0e56b29ae2b5910d1e..d51f3196d4d760d798cc27f42c1f5e1711894df0 100644 (file)
@@ -3,26 +3,37 @@
 %bcond_with    static  # don't use shared libraries
 %bcond_without imode   # don't build interactive mode
 %bcond_without python  # don't build python bindings
-%bcond_with    snap    # don't build python bindings
+%bcond_with    snap    # install configs for official Th snapshot
+%bcond_with    db60    # DB 6.0 instead of 5.2
+
+# current snapshot name
+%define                SNAP    2012
 
 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
-%define        ver_db  4.7.25
-%define        ver_db_rel      1
-%define        ver_rpm 4.5-49
+# NOTE: poldek links with "system db" (-ldb) anyway if it exists
+%if %{with db60}
+%define                db_pkg          db6.0
+%define                ver_db          6.0
+%define                ver_db_rel      1
+%else
+%define                db_pkg          db5.2
+%define                ver_db          5.2
+%define                ver_db_rel      3
+%endif
+%define                ver_rpm         5.4.10
 
-%define                snap    rc5
-%define                rel     12
+%define                rel     3
 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
-Release:       1.%{snap}.%{rel}
+Version:       0.30.0
+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/~cactus/snaps/poldek/%{name}-%{version}%{snap}.tar.xz
-# Source0-md5: ab89926c28cfb6b7d72497fc37c16ac4
+Source0:       http://carme.pld-linux.org/~megabajt/releases/poldek/%{name}-%{version}.tar.xz
+# Source0-md5: 392cfa125912fbedb6cc6d54dfbb80e3
 Source1:       %{name}.conf
 Source2:       %{name}-multilib.conf
 Source5:       %{name}-aliases.conf
@@ -32,18 +43,18 @@ Source8:    %{name}-debuginfo.conf
 Source9:       %{name}-aidath.conf
 Source10:      %{name}-multilib-aidath.conf
 Source11:      %{name}-archive.conf
-Patch0:                %{name}-vserver-packages.patch
-Patch1:                %{name}-config.patch
-Patch2:                %{name}-size-type.patch
-Patch3:                %{name}-Os-fail-workaround.patch
-Patch4:                %{name}-git.patch
-Patch5:                %{name}-am.patch
+Source100:     %{name}-snap.conf
+Source101:     %{name}-multilib-snap.conf
+Source102:     %{name}-debuginfo-snap.conf
+Patch0:                %{name}-size-type.patch
+Patch1:                %{name}-Os-fail-workaround.patch
+Patch2:                %{name}-config.patch
 URL:           http://poldek.pld-linux.org/
+BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
 BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: bzip2-devel
 BuildRequires: check-devel
-BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
 BuildRequires: docbook-dtd412-xml
 BuildRequires: gettext-devel
 BuildRequires: libtool
@@ -58,11 +69,13 @@ 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
 BuildRequires: zlib-devel
 %if %{with static}
+BuildRequires: %{db_pkg}-static >= %{ver_db}-%{ver_db_rel}
 BuildRequires: bzip2-static
-BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
 BuildRequires: glibc-static
 BuildRequires: libselinux-static
 BuildRequires: libxml2-static
@@ -76,15 +89,18 @@ BuildRequires:      zlib-static
 %endif
 Requires(triggerpostun):       awk
 Requires(triggerpostun):       sed >= 4.0
+Requires:      %{db_pkg} >= %{ver_db}-%{ver_db_rel}
 Requires:      %{name}-libs = %{version}-%{release}
-Requires:      db >= %{ver_db}-%{ver_db_rel}
 Requires:      rpm >= %{ver_rpm}
 Requires:      rpm-db-ver = %{ver_db}
-Requires:      rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
+#Requires:     rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
+Requires:      rpm-lib >= 5.4.10
 # vf* scripts use sed
 Requires:      sed
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                _libexecdir     %{_prefix}/lib/%{name}
+
 %description
 poldek is an RPM package management tool which allows you to easily
 perform package verification, installation (including system
@@ -182,7 +198,7 @@ Summary(hu.UTF-8):  Python modulok poldek-hez
 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.
@@ -198,9 +214,6 @@ Moduły języka Python dla poldka.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
 
 %{__rm} m4/libtool.m4 m4/lt*.m4
 
@@ -232,6 +245,7 @@ CPPFLAGS="%{rpmcppflags} -std=gnu99"
 %configure \
        %{?with_static:--enable-static --disable-shared} \
        %{!?with_imode:--disable-imode} \
+       --with-pkglibdir=%{_libexecdir} \
        --enable-nls \
        %{?with_python:--with-python}
 %{__make} -j1
@@ -290,18 +304,36 @@ 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-multilib.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' \
+       -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}
+       %{__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
+%endif
+
+%if %{with snap}
+%{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
+%{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
+%else
+%{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
+%{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
 %endif
 
 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
@@ -316,9 +348,9 @@ cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
 # sources we don't package
 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
 # include them in %doc
-rm -rf configs
+%{__rm} -rf configs
 cp -a conf configs
-rm -f configs/Makefile*
+%{__rm} -f configs/Makefile*
 
 %if %{with python}
 %py_postclean
@@ -395,7 +427,7 @@ if [ -f /etc/poldek.conf.rpmsave ]; then
        # copy hold=
        hold=$(grep ^hold /etc/poldek.conf.rpmsave)
        if [ "$hold" ]; then
-               sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
+               %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
        fi
 fi
 
@@ -433,8 +465,8 @@ fi
 %attr(755,root,root) %{_bindir}/ipoldek
 %attr(755,root,root) %{_bindir}/poldek
 %attr(755,root,root) %{_bindir}/rpmvercmp
-%dir %{_libdir}/%{name}
-%attr(755,root,root) %{_libdir}/%{name}/*
+%dir %{_libexecdir}
+%attr(755,root,root) %{_libexecdir}/*
 %{_mandir}/man1/%{name}*.1*
 %lang(pl) %{_mandir}/pl/man1/%{name}*
 %{_infodir}/poldek.info*
@@ -478,6 +510,7 @@ fi
 %{_includedir}/trurl
 %{_includedir}/vfile
 %{_pkgconfigdir}/tndb.pc
+%{_pkgconfigdir}/trurlib.pc
 
 %files static
 %defattr(644,root,root,755)
This page took 0.036291 seconds and 4 git commands to generate.