# 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.3.27-1
-%define ver_rpm 4.4.3
+%define ver_rpm 4.4.9
+%define snap 20070108.22
Summary: RPM packages management helper tool
-Summary(pl): Pomocnicze narzêdzie do zarz±dzania pakietami RPM
+Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
Name: poldek
-Version: 0.20
-Release: 3
+Version: 0.20.1
+Release: 0.20070108.1.12
License: GPL v2
Group: Applications/System
-Source0: http://team.pld.org.pl/~mis/poldek/download/%{name}-%{version}.tar.bz2
-# Source0-md5: 61c0c03ee4a9de36339fc943b6901266
+Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
+# Source0-md5: 47025233d8ebb7082567cbf1392cf16f
Source1: %{name}.conf
Source2: %{name}-multilib.conf
Source3: %{name}-aliases.conf
-# drop?
-#PatchX: %{name}-etc_dir.patch
-# drop?
-#PatchX: %{name}-retr_term.patch
-# is still needed?
-#Patch2: %{name}-simplestatic.patch
-Patch0: %{name}-cvs-fixes.patch
-Patch1: %{name}-ask-abort.patch
-Patch2: %{name}-obsoletes.patch
-Patch3: %{name}-rpm_4_4_3.patch
-URL: http://team.pld.org.pl/~mis/poldek/
+Patch1: %{name}-vserver-packages.patch
+Patch2: %{name}-config.patch
+Patch3: %{name}-multilib.patch
+Patch4: %{name}-configure_in.patch
+Patch5: %{name}-rpm-4.4.8.patch
+Patch6: %{name}-rpm-4.4.9.patch
+Patch7: %{name}-desc_in_utf8.patch
+URL: http://poldek.pld-linux.org/
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bzip2-devel
BuildRequires: pcre-devel
BuildRequires: perl-tools-pod
BuildRequires: popt-devel
+%{?with_python:BuildRequires: python-devel}
BuildRequires: readline-devel >= 5.0
BuildRequires: rpm-devel >= %{ver_rpm}
+%{?with_python:BuildRequires: rpm-pythonprov}
+BuildRequires: xmlto
BuildRequires: zlib-devel
%if %{with static}
BuildRequires: bzip2-static
BuildRequires: rpm-static
BuildRequires: zlib-static
%endif
-Requires(triggerpostun): sed >= 4.0
Requires(triggerpostun): awk
-Requires: %{name}-libs = %{version}-%{release}
+Requires(triggerpostun): sed >= 4.0
+Requires: %{name}-libs = %{version}-%{release}
Requires: db >= %{ver_db}
Requires: rpm >= %{ver_rpm}
Requires: sed
%{?with_static:This version is statically linked.}
%{!?with_imode:This version hasn't got interactive mode.}
+#'vim
-%description -l pl
-poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
-instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
-usuwania pakietów.
+%description -l pl.UTF-8
+poldek jest narzędziem linii poleceń służącym do weryfikacji,
+instalacji (włączając instalację systemu od zera), aktualizacji i
+usuwania pakietów.
-Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
+Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
interaktywnym. Tryb interaktywny posiada interfejs readline z
-dope³nianiem komend i histori±, podobny do trybu shell perlowego
-modu³u CPAN.
+dopełnianiem komend i historią, podobny do trybu shell perlowego
+modułu CPAN.
%{?with_static:Ta wersja jest konsolidowana statycznie.}
%{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
%package libs
-Summary: poldek libraries
-Summary(pl): Biblioteki poldka
-Group: Libraries
+Summary: poldek libraries
+Summary(pl.UTF-8): Biblioteki poldka
+Group: Libraries
%description libs
poldek libraries.
-%description libs -l pl
+%description libs -l pl.UTF-8
Biblioteki poldka.
%package devel
-Summary: Header files for poldek libraries
-Summary(pl): Pliki nag³ówkowe bibliotek poldka
-Group: Development/Libraries
-Requires: %{name}-libs = %{version}-%{release}
+Summary: Header files for poldek libraries
+Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
+Group: Development/Libraries
+Requires: %{name}-libs = %{version}-%{release}
%description devel
Header files for poldek libraries.
-%description devel -l pl
-Pliki nag³ówkowe bibliotek poldka.
+%description devel -l pl.UTF-8
+Pliki nagłówkowe bibliotek poldka.
%package static
-Summary: poldek static libraries
-Summary(pl): Biblioteki statyczne poldka
-Group: Development/Libraries
-Requires: %{name}-devel = %{version}-%{release}
+Summary: poldek static libraries
+Summary(pl.UTF-8): Biblioteki statyczne poldka
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
%description static
poldek static libraries.
-%description static -l pl
+%description static -l pl.UTF-8
Biblioteki statyczne poldka.
+%package -n python-poldek
+Summary: Python modules for poldek
+Summary(pl.UTF-8): Moduły języka Python dla poldka
+Group: Libraries/Python
+Requires: %{name}-libs = %{version}-%{release}
+%pyrequires_eq python-libs
+
+%description -n python-poldek
+Python modules for poldek.
+
+%description -n python-poldek -l pl.UTF-8
+Moduły języka Python dla poldka.
+
%prep
-%setup -q
-%patch0 -p2
-%patch1 -p0
-%patch2 -p0
-%patch3 -p0
+%setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
+%patch1 -p1
+%patch2 -p1
+%ifarch %{x8664}
+%patch3 -p1
+%endif
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
%build
%{__autopoint}
%configure \
%{?with_static:--enable-static --disable-shared} \
%{!?with_imode:--disable-imode} \
- --enable-nls
+ --enable-nls \
+ %{?with_python:--with-python}
%{__make}
%install
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+%if %{with python}
+%{__make} -C python install \
+ DESTDIR=$RPM_BUILD_ROOT \
+ libdir=%{py_sitedir}
+%endif
+
%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
%ifarch i486 i686 ppc sparc alpha athlon
%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
-sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
-%ifarch %{x8664}
- -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
-%else
- -e '/%%ALT_ARCH%%/d' \
-%endif
- < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
+sed -e '
+ s|%%ARCH%%|%{_ftp_arch}|g
+' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
%ifarch %{x8664}
-sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
+sed '
+ s|%%ARCH%%|%{_ftp_alt_arch}|g
+' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
%endif
install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
cp -a conf configs
rm -f configs/Makefile*
+%if %{with python}
+%py_postclean
+rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
+%endif
+
%find_lang %{name}
%clean
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 "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 (non-ac dist ones) from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
-
- # propagate use_sudo to new config. only works for untouched poldek.conf and that's intentional.
- if grep -q '^use_sudo.*=.*yes' /etc/poldek.conf.rpmsave; then
- sed -i -e '/^#use sudo = no/s/^.*/use sudo = yes/' /etc/poldek/poldek.conf
- fi
+ 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)
%defattr(644,root,root,755)
%doc README* NEWS TODO configs/
%dir %{_sysconfdir}/%{name}
-%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}/*.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
%attr(755,root,root) %{_bindir}/*
%dir %{_libdir}/%{name}
%attr(755,root,root) %{_libdir}/%{name}/*
%lang(pl) %{_mandir}/pl/man1/%{name}*
%{_infodir}/poldek.info*
-%if %{without static}
+%if !%{with static}
%files libs
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
%files static
%defattr(644,root,root,755)
%{_libdir}/lib*.a
+
+%if %{with python}
+%files -n python-poldek
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/_poldekmod.so
+%{py_sitescriptdir}/poldek.py[co]
+%{py_sitescriptdir}/poldekmod.py[co]
+%endif