]> TLD Linux GIT Repositories - packages/poldek.git/blobdiff - poldek.spec
- merged changes from PLD
[packages/poldek.git] / poldek.spec
index 9feb35154af1421d71076ad0e9e12235dce67ab1..9f1dfc4c0f652098eef758b72d5763f9785e8aec 100644 (file)
@@ -1,20 +1,15 @@
-#
-# TODO:
-#
-# - fails to build without poldek-devel - fix it !
-#
 # Conditional build:
 %bcond_with    static  # don't use shared libraries
 %bcond_without imode   # don't build interactive mode
 %bcond_without python  # don't build python bindings
 
 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
-%define        ver_db  4.5.20
+%define        ver_db          4.5.20
 %define        ver_db_rel      8
-%define        ver_rpm 4.5-49
+%define        ver_rpm         4.5-49
 
-%define                snap    rc2
-%define                rel     7
+%define                snap    rc6
+%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
@@ -24,17 +19,20 @@ Release:    0.%{snap}.%{rel}
 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.bz2
-# Source0-md5: 14135ae2960da09990c50d5b5342be64
+Source0:       http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}%{snap}.tar.xz
+# Source0-md5: 4b528ad356b02efdd72b81f1ecaceb83
 Source1:       %{name}.conf
 Source2:       %{name}-multilib.conf
-Source3:       %{name}-aliases.conf
-Source4:       %{name}.desktop
-Source5:       %{name}.png
+Source5:       %{name}-aliases.conf
+Source6:       %{name}.desktop
+Source7:       %{name}.png
 Patch0:                %{name}-vserver-packages.patch
 Patch1:                %{name}-config.patch
 Patch2:                %{name}-size-type.patch
 Patch3:                %{name}-Os-fail-workaround.patch
+Patch4:                %{name}-link-rpmio.patch
+Patch5:                %{name}-vrpmlog.patch
+Patch6:                %{name}-git.patch
 URL:           http://poldek.pld-linux.org/
 BuildRequires: autoconf
 BuildRequires: automake
@@ -196,8 +194,11 @@ Moduły języka Python dla poldka.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
 
-rm -f m4/libtool.m4 m4/lt*.m4
+%{__rm} m4/libtool.m4 m4/lt*.m4
 
 # cleanup backups after patching
 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
@@ -209,33 +210,45 @@ chmod u+x ./configure ./doc/conf-xml2.sh
 %{__autoheader}
 %{__autoconf}
 %{__automake}
-cp -f config.sub trurlib
+cd tndb
+%{__libtoolize}
+%{__aclocal}
+%{__autoheader}
+%{__autoconf}
+%{__automake}
+cd ../trurlib
+%{__libtoolize}
+%{__aclocal}
+%{__autoheader}
+%{__autoconf}
+%{__automake}
+cd ..
 
-CPPFLAGS="-std=gnu99"
+CPPFLAGS="%{rpmcppflags} -std=gnu99"
 %configure \
        %{?with_static:--enable-static --disable-shared} \
        %{!?with_imode:--disable-imode} \
        --enable-nls \
        %{?with_python:--with-python}
-%{__make}
+%{__make} -j1
 #      --enable-trace
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
 
-%{__make} install \
+%{__make} install -j1 \
        DESTDIR=$RPM_BUILD_ROOT
 
 %if %{with python}
-%{__make} -C python install \
+%{__make} -C python -j1 install \
        DESTDIR=$RPM_BUILD_ROOT \
        libdir=%{py_sitedir}
 %endif
 
-%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
+%{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
 
-%ifarch i486 i686 ppc sparc alpha athlon
+%ifarch i586 i686 ppc sparc alpha athlon
        %define         _ftp_arch       %{_target_cpu}
 %endif
 %ifarch %{x8664}
@@ -250,35 +263,36 @@ install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
 %endif
 
 %define        tld_conf %{SOURCE1}
+
 %ifarch %{x8664}
        %define tld_multilib_conf %{SOURCE2}
 %endif
 
-sed -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{tld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld.conf
+%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{tld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld.conf
 
 %if 0%{?tld_multilib_conf:1}
-       sed 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{tld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
+       %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{tld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
 %endif
 
-cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
+cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
 
 %if %{with imode}
 # add desktop file and icon
 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
-cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
-cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
+cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
+cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
 %endif
 
 # sources we don't package
-rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{{rh,pld,fedora,centos}-source,repos.d/pld}.conf
+%{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{{rh,fedora,centos}-source,repos.d/pld}.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
-rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
 %endif
 
 %find_lang %{name}
@@ -351,7 +365,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
 
@@ -386,16 +400,19 @@ fi
 %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
-%attr(755,root,root) %{_bindir}/*
+%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}/*
-%{_mandir}/man1/%{name}*
+%{_mandir}/man1/%{name}*.1*
 %lang(pl) %{_mandir}/pl/man1/%{name}*
 %{_infodir}/poldek.info*
 %if %{with imode}
 %{_desktopdir}/%{name}.desktop
 %{_pixmapsdir}/%{name}.png
 %endif
+%dir /var/cache/%{name}
 
 %if %{without static}
 %files libs
@@ -414,13 +431,28 @@ fi
 
 %files devel
 %defattr(644,root,root,755)
-%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
-%{_libdir}/lib*.la
-%{_includedir}/*
+%if %{without static}
+%attr(755,root,root) %{_libdir}/libpoclidek.so
+%attr(755,root,root) %{_libdir}/libpoldek.so
+%attr(755,root,root) %{_libdir}/libtndb.so
+%attr(755,root,root) %{_libdir}/libtrurl.so
+%attr(755,root,root) %{_libdir}/libvfile.so
+%endif
+%{_libdir}/libpoclidek.la
+%{_libdir}/libpoldek.la
+%{_libdir}/libtndb.la
+%{_libdir}/libtrurl.la
+%{_libdir}/libvfile.la
+%{_includedir}/poldek
+%{_includedir}/tndb
+%{_includedir}/trurl
+%{_includedir}/vfile
+%{_pkgconfigdir}/tndb.pc
 
 %files static
 %defattr(644,root,root,755)
-%{_libdir}/lib*.a
+%{_libdir}/libtndb.a
+%{_libdir}/libtrurl.a
 
 %if %{with python}
 %files -n python-poldek