]> git.pld-linux.org Git - packages/poldek.git/blame - poldek.spec
- BR: rpm-pythonprov
[packages/poldek.git] / poldek.spec
CommitLineData
7638abfc 1#
de1099c4 2# Conditional build:
9fe14a3f 3%bcond_with static # don't use shared libraries
4%bcond_without imode # don't build interactive mode
58c31de0 5%bcond_without python # don't build python bindings
7638abfc 6#
373c6f03 7# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
ad60ba0e 8%define ver_db 4.3.27-1
f753a788 9%define ver_rpm 4.4.8
cad77493 10%define snap 20070108.22
b44549bf 11Summary: RPM packages management helper tool
9faf625a 12Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
b44549bf 13Name: poldek
6bf978ec 14Version: 0.20.1
f753a788 15Release: 0.20070108.1.4
9f931ada 16License: GPL v2
8efee472 17Group: Applications/System
56213e3b 18Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
cad77493 19# Source0-md5: 47025233d8ebb7082567cbf1392cf16f
911a8560 20Source1: %{name}.conf
b25cb9a7
JB
21Source2: %{name}-multilib.conf
22Source3: %{name}-aliases.conf
13aa6434
AM
23Patch1: %{name}-vserver-packages.patch
24Patch2: %{name}-config.patch
25Patch3: %{name}-multilib.patch
82f6fd2b 26Patch4: %{name}-configure_in.patch
f753a788 27Patch5: %{name}-rpm-4.4.8.patch
39ca2371 28URL: http://poldek.pld-linux.org/
a4268952 29BuildRequires: autoconf
b25cb9a7 30BuildRequires: automake
373c6f03 31BuildRequires: bzip2-devel
b25cb9a7 32BuildRequires: check
b1928c7a 33BuildRequires: db-devel >= %{ver_db}
c0d8905a 34BuildRequires: gettext-autopoint
b25cb9a7
JB
35BuildRequires: libtool
36BuildRequires: libxml2-devel
cbc6f56b 37BuildRequires: openssl-devel >= 0.9.7d
13fd950e 38BuildRequires: pcre-devel
f373d903 39BuildRequires: perl-tools-pod
13fd950e 40BuildRequires: popt-devel
58c31de0 41%{?with_python:BuildRequires: python-devel}
b25cb9a7 42BuildRequires: readline-devel >= 5.0
373c6f03 43BuildRequires: rpm-devel >= %{ver_rpm}
300927eb 44%{?with_python:BuildRequires: rpm-pythonprov}
282cfaec 45BuildRequires: xmlto
96475e5e 46BuildRequires: zlib-devel
373c6f03
JB
47%if %{with static}
48BuildRequires: bzip2-static
b1928c7a 49BuildRequires: db-static >= %{ver_db}
2fac0b02 50BuildRequires: glibc-static
acb26797 51BuildRequires: libselinux-static
b25cb9a7 52BuildRequires: libxml2-static
373c6f03
JB
53BuildRequires: ncurses-static
54BuildRequires: openssl-static
55BuildRequires: pcre-static
56BuildRequires: popt-static
57BuildRequires: readline-static
58BuildRequires: rpm-static
59BuildRequires: zlib-static
373c6f03 60%endif
b25cb9a7 61Requires(triggerpostun): awk
168acc54 62Requires(triggerpostun): sed >= 4.0
09d4c571 63Requires: %{name}-libs = %{version}-%{release}
b1928c7a 64Requires: db >= %{ver_db}
373c6f03 65Requires: rpm >= %{ver_rpm}
de1099c4 66Requires: sed
b44549bf 67BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68
69%description
0fa0dc36 70poldek is an RPM package management tool which allows you to easily
71perform package verification, installation (including system
13fd950e 72installation from scratch), upgrading, and removal.
0fa0dc36 73
13fd950e
JB
74Program can be used in batch (like apt-get from Debian's APT) or
75interactive mode. The interactive mode puts you into a readline
76interface with command line autocompletion and history, similar to the
77shell mode of Perl's CPAN.
8efee472 78
9fe14a3f 79%{?with_static:This version is statically linked.}
d94b28a6 80
9fe14a3f 81%{!?with_imode:This version hasn't got interactive mode.}
7f07e487 82#'vim
1f84648f 83
caed9b36
JR
84%description -l pl.UTF-8
85poldek jest narzędziem linii poleceń służącym do weryfikacji,
86instalacji (włączając instalację systemu od zera), aktualizacji i
87usuwania pakietów.
56e1ab51 88
caed9b36 89Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
d82a9cb2 90interaktywnym. Tryb interaktywny posiada interfejs readline z
caed9b36
JR
91dopełnianiem komend i historią, podobny do trybu shell perlowego
92modułu CPAN.
8efee472 93
9fe14a3f 94%{?with_static:Ta wersja jest konsolidowana statycznie.}
a611e0bc 95
9fe14a3f 96%{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
b44549bf 97
b25cb9a7 98%package libs
168acc54 99Summary: poldek libraries
9faf625a 100Summary(pl.UTF-8): Biblioteki poldka
168acc54 101Group: Libraries
b25cb9a7
JB
102
103%description libs
104poldek libraries.
105
caed9b36 106%description libs -l pl.UTF-8
b25cb9a7
JB
107Biblioteki poldka.
108
109%package devel
168acc54 110Summary: Header files for poldek libraries
9faf625a 111Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
168acc54 112Group: Development/Libraries
09d4c571 113Requires: %{name}-libs = %{version}-%{release}
b25cb9a7
JB
114
115%description devel
116Header files for poldek libraries.
117
caed9b36
JR
118%description devel -l pl.UTF-8
119Pliki nagłówkowe bibliotek poldka.
b25cb9a7
JB
120
121%package static
168acc54 122Summary: poldek static libraries
9faf625a 123Summary(pl.UTF-8): Biblioteki statyczne poldka
168acc54 124Group: Development/Libraries
09d4c571 125Requires: %{name}-devel = %{version}-%{release}
b25cb9a7
JB
126
127%description static
128poldek static libraries.
129
caed9b36 130%description static -l pl.UTF-8
b25cb9a7
JB
131Biblioteki statyczne poldka.
132
58c31de0
JB
133%package -n python-poldek
134Summary: Python modules for poldek
9faf625a 135Summary(pl.UTF-8): Moduły języka Python dla poldka
58c31de0
JB
136Group: Libraries/Python
137Requires: %{name}-libs = %{version}-%{release}
138%pyrequires_eq python-libs
139
140%description -n python-poldek
141Python modules for poldek.
142
caed9b36
JR
143%description -n python-poldek -l pl.UTF-8
144Moduły języka Python dla poldka.
58c31de0 145
03159b71 146%prep
6bf978ec 147%setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
13aa6434
AM
148%patch1 -p1
149%patch2 -p1
3375120c 150%ifarch %{x8664}
13aa6434 151%patch3 -p1
3375120c 152%endif
82f6fd2b 153%patch4 -p1
f753a788 154%patch5 -p1
b44549bf 155
156%build
df3bea74 157%{__autopoint}
21a83253
MM
158%{__aclocal} -I m4
159%{__autoconf}
160%{__automake}
63bd61a7 161cp -f config.sub trurlib
b25cb9a7 162
1f84648f 163%configure \
b25cb9a7 164 %{?with_static:--enable-static --disable-shared} \
9fe14a3f 165 %{!?with_imode:--disable-imode} \
58c31de0
JB
166 --enable-nls \
167 %{?with_python:--with-python}
03159b71 168%{__make}
8efee472 169
b44549bf 170%install
171rm -rf $RPM_BUILD_ROOT
23749bce 172install -d $RPM_BUILD_ROOT%{_sysconfdir}
8efee472 173
c8f7d829 174%{__make} install \
175 DESTDIR=$RPM_BUILD_ROOT
de1099c4 176
58c31de0
JB
177%if %{with python}
178%{__make} -C python install \
179 DESTDIR=$RPM_BUILD_ROOT \
180 libdir=%{py_sitedir}
181%endif
182
9fe14a3f 183%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
a49836bb 184
9639596f 185%ifarch i486 i686 ppc sparc alpha athlon
a49836bb 186%define _ftp_arch %{_target_cpu}
187%else
9639596f 188%ifarch %{x8664}
590302c4 189%define _ftp_arch x86_64
b25cb9a7
JB
190%define _ftp_alt_arch i686
191%else
9639596f
PS
192%ifarch i586
193%define _ftp_arch i486
a49836bb 194%else
195%ifarch pentium2 pentium3 pentium4
196%define _ftp_arch i686
197%else
198%ifarch sparcv9 sparc64
199%define _ftp_arch sparc
200%endif
201%endif
202%endif
203%endif
b25cb9a7 204%endif
a49836bb 205
b25cb9a7 206%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
32697bd0 207
7adf66ff
ER
208sed -e '
209 s|%%ARCH%%|%{_ftp_arch}|g
210' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
b44549bf 211
590302c4 212%ifarch %{x8664}
7adf66ff
ER
213sed '
214 s|%%ARCH%%|%{_ftp_alt_arch}|g
215' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
b25cb9a7
JB
216%endif
217
218install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
219
220# get rid of non-pld sources
221rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
222# include them in %doc
223rm -rf configs
224cp -a conf configs
225rm -f configs/Makefile*
226
62e80071 227%if %{with python}
58c31de0
JB
228%py_postclean
229rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
62e80071 230%endif
58c31de0 231
b25cb9a7 232%find_lang %{name}
f373d903 233
b44549bf 234%clean
235rm -rf $RPM_BUILD_ROOT
236
b25cb9a7
JB
237%post
238[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
239
240%postun
241[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
242
243%post libs -p /sbin/ldconfig
244%postun libs -p /sbin/ldconfig
245
f581a7d5 246%triggerpostun -- poldek <= 0.18.3-5
b25cb9a7
JB
247if [ -f /etc/poldek.conf ]; then
248 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
249fi
aa3b63c5 250
a49836bb 251# otherwise don't touch
252%ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
1b2ec187 253%triggerpostun -- poldek <= 0.18.7-1
b25cb9a7
JB
254if [ -f /etc/poldek.conf ]; then
255 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
256fi
a49836bb 257%endif
1b2ec187 258
b25cb9a7
JB
259%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
260if [ -f /etc/poldek.conf.rpmsave ]; then
261 awk '/^source/ {
262 name = $3;
263 path = $4;
264 auto = "yes";
265 autoup = "yes";
266 type = "pdir";
f154dd55 267 pri = "";
b25cb9a7
JB
268
269 if (sub(",noauto", "", name)) {
270 auto = "no";
271 }
272
f154dd55
ER
273 # process pri=\d+
274 if (match(name, /,pri=[0-9]+/)) {
275 pri = substr(name, RSTART + 5, RLENGTH - 5);
276 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
277 }
278
b25cb9a7
JB
279 # skip ac sources. already in new config.
280 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
281 print "";
282 print "[source]";
283 print "name = " name;
284 print "type = " type;
285 print "path = " path;
286 print "auto = " auto;
287 print "autoup = " autoup;
f154dd55
ER
288 if (pri) {
289 print "pri = " pri;
290 }
b25cb9a7
JB
291 }
292
293 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
19cae196 294 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
b25cb9a7
JB
295
296 # copy hold=
297 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
298 if [ "$hold" ]; then
299 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
300 fi
301fi
302
767366b0 303%files -f %{name}.lang
b44549bf 304%defattr(644,root,root,755)
b25cb9a7
JB
305%doc README* NEWS TODO configs/
306%dir %{_sysconfdir}/%{name}
168acc54 307%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
8efee472 308%attr(755,root,root) %{_bindir}/*
b25cb9a7
JB
309%dir %{_libdir}/%{name}
310%attr(755,root,root) %{_libdir}/%{name}/*
b44549bf 311%{_mandir}/man1/%{name}*
d8826405 312%lang(pl) %{_mandir}/pl/man1/%{name}*
b25cb9a7
JB
313%{_infodir}/poldek.info*
314
f8c7c6b5 315%if !%{with static}
b25cb9a7
JB
316%files libs
317%defattr(644,root,root,755)
318%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
319%endif
320
321%files devel
322%defattr(644,root,root,755)
323%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
324%{_libdir}/lib*.la
325%{_includedir}/*
326
327%files static
328%defattr(644,root,root,755)
329%{_libdir}/lib*.a
58c31de0
JB
330
331%if %{with python}
332%files -n python-poldek
333%defattr(644,root,root,755)
334%attr(755,root,root) %{py_sitedir}/_poldekmod.so
335%{py_sitescriptdir}/poldek.py[co]
336%{py_sitescriptdir}/poldekmod.py[co]
337%endif
This page took 0.146851 seconds and 4 git commands to generate.