]> git.pld-linux.org Git - packages/poldek.git/blame - poldek.spec
- add th-obsolete
[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)
4d7ffb0a 8%if "%{pld_release}" == "ti"
530c8c41 9%define ver_db 4.5.20
473ce98d 10%define ver_db_rel 8
4d7ffb0a 11%else
530c8c41 12%define ver_db 4.7.25
473ce98d 13%define ver_db_rel 1
4d7ffb0a 14%endif
2b6db74f 15%define ver_rpm 4.5-5
5486bf2e 16#
04a91ad3 17%define snap 20080820.23
cfb7d867 18%define rel 22
b44549bf 19Summary: RPM packages management helper tool
9faf625a 20Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
b44549bf 21Name: poldek
24ad8b8d 22Version: 0.30
40ae4011 23Release: 0.%{snap}.%{rel}
9f931ada 24License: GPL v2
8efee472 25Group: Applications/System
85398bac 26#Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
c0898992 27Source0: http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}-cvs%{snap}.tar.bz2
04a91ad3 28# Source0-md5: 2738eb3996f1cdf1e5d74b913d6e7414
911a8560 29Source1: %{name}.conf
b25cb9a7 30Source2: %{name}-multilib.conf
2ccd5d66 31Source3: %{name}-ti.conf
32Source4: %{name}-multilib-ti.conf
33Source5: %{name}-aliases.conf
34Source6: %{name}.desktop
35Source7: %{name}.png
85398bac
MB
36Patch0: %{name}-vserver-packages.patch
37Patch1: %{name}-config.patch
38Patch2: %{name}-abort-on-upgrade.patch
04a91ad3
MB
39Patch3: %{name}-inline.patch
40Patch4: %{name}-ls-llu.patch
41Patch5: %{name}-op-ldalldesc.patch
25838a54 42Patch6: %{name}-nocolor-upgrade.patch
f4114128
ER
43Patch7: %{name}-upgrade-dist.patch
44Patch8: %{name}-keep-reinstalled-provides.patch
bf43a3ac 45Patch9: %{name}-dont-ask-for-suggests-on-errors.patch
c7d7bdf5 46Patch10: %{name}-crash-on-invalid-locale.patch
149abeda 47Patch11: %{name}-noutf8.patch
f031015c 48Patch12: %{name}-dont-suggests-required-packages.patch
05e22a22 49Patch13: %{name}-tty-for-erasures.patch
c756c410 50Patch14: %{name}-both_langs.patch
20ff11b6 51Patch15: %{name}-317130.patch
d0d294bd 52Patch16: %{name}-321546.patch
f76d4526
PZ
53Patch17: %{name}-size-type.patch
54Patch18: %{name}-no-inlines.patch
a483213a 55Patch19: %{name}-export-missing-symbol.patch
fb2a8800 56Patch20: %{name}-skip-suggests-on-upgrade.patch
8f2fba8c 57Patch21: %{name}-po.patch
39ca2371 58URL: http://poldek.pld-linux.org/
a4268952 59BuildRequires: autoconf
b25cb9a7 60BuildRequires: automake
373c6f03 61BuildRequires: bzip2-devel
b25cb9a7 62BuildRequires: check
530c8c41 63BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
c0d8905a 64BuildRequires: gettext-autopoint
b25cb9a7
JB
65BuildRequires: libtool
66BuildRequires: libxml2-devel
cbc6f56b 67BuildRequires: openssl-devel >= 0.9.7d
13fd950e 68BuildRequires: pcre-devel
f373d903 69BuildRequires: perl-tools-pod
b3ea4b51 70BuildRequires: pkgconfig
13fd950e 71BuildRequires: popt-devel
58c31de0 72%{?with_python:BuildRequires: python-devel}
b25cb9a7 73BuildRequires: readline-devel >= 5.0
373c6f03 74BuildRequires: rpm-devel >= %{ver_rpm}
300927eb 75%{?with_python:BuildRequires: rpm-pythonprov}
282cfaec 76BuildRequires: xmlto
96475e5e 77BuildRequires: zlib-devel
373c6f03
JB
78%if %{with static}
79BuildRequires: bzip2-static
530c8c41 80BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
2fac0b02 81BuildRequires: glibc-static
acb26797 82BuildRequires: libselinux-static
b25cb9a7 83BuildRequires: libxml2-static
373c6f03
JB
84BuildRequires: ncurses-static
85BuildRequires: openssl-static
86BuildRequires: pcre-static
87BuildRequires: popt-static
88BuildRequires: readline-static
89BuildRequires: rpm-static
90BuildRequires: zlib-static
373c6f03 91%endif
b25cb9a7 92Requires(triggerpostun): awk
168acc54 93Requires(triggerpostun): sed >= 4.0
09d4c571 94Requires: %{name}-libs = %{version}-%{release}
530c8c41 95Requires: db >= %{ver_db}-%{ver_db_rel}
373c6f03 96Requires: rpm >= %{ver_rpm}
530c8c41 97Requires: rpm-db-ver = %{ver_db}
78b0cd64 98Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
e202a52a
ER
99# vf* scripts use sed
100Requires: sed
b44549bf 101BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
102
103%description
0fa0dc36 104poldek is an RPM package management tool which allows you to easily
105perform package verification, installation (including system
13fd950e 106installation from scratch), upgrading, and removal.
0fa0dc36 107
13fd950e
JB
108Program can be used in batch (like apt-get from Debian's APT) or
109interactive mode. The interactive mode puts you into a readline
110interface with command line autocompletion and history, similar to the
111shell mode of Perl's CPAN.
8efee472 112
9fe14a3f 113%{?with_static:This version is statically linked.}
d94b28a6 114
9fe14a3f 115%{!?with_imode:This version hasn't got interactive mode.}
7f07e487 116#'vim
1f84648f 117
caed9b36
JR
118%description -l pl.UTF-8
119poldek jest narzędziem linii poleceń służącym do weryfikacji,
120instalacji (włączając instalację systemu od zera), aktualizacji i
121usuwania pakietów.
56e1ab51 122
caed9b36 123Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
d82a9cb2 124interaktywnym. Tryb interaktywny posiada interfejs readline z
caed9b36
JR
125dopełnianiem komend i historią, podobny do trybu shell perlowego
126modułu CPAN.
8efee472 127
9fe14a3f 128%{?with_static:Ta wersja jest konsolidowana statycznie.}
a611e0bc 129
9fe14a3f 130%{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
b44549bf 131
b25cb9a7 132%package libs
168acc54 133Summary: poldek libraries
9faf625a 134Summary(pl.UTF-8): Biblioteki poldka
168acc54 135Group: Libraries
b25cb9a7
JB
136
137%description libs
138poldek libraries.
139
caed9b36 140%description libs -l pl.UTF-8
b25cb9a7
JB
141Biblioteki poldka.
142
143%package devel
168acc54 144Summary: Header files for poldek libraries
9faf625a 145Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
168acc54 146Group: Development/Libraries
09d4c571 147Requires: %{name}-libs = %{version}-%{release}
b25cb9a7
JB
148
149%description devel
150Header files for poldek libraries.
151
caed9b36
JR
152%description devel -l pl.UTF-8
153Pliki nagłówkowe bibliotek poldka.
b25cb9a7
JB
154
155%package static
168acc54 156Summary: poldek static libraries
9faf625a 157Summary(pl.UTF-8): Biblioteki statyczne poldka
168acc54 158Group: Development/Libraries
09d4c571 159Requires: %{name}-devel = %{version}-%{release}
b25cb9a7
JB
160
161%description static
162poldek static libraries.
163
caed9b36 164%description static -l pl.UTF-8
b25cb9a7
JB
165Biblioteki statyczne poldka.
166
58c31de0
JB
167%package -n python-poldek
168Summary: Python modules for poldek
9faf625a 169Summary(pl.UTF-8): Moduły języka Python dla poldka
58c31de0
JB
170Group: Libraries/Python
171Requires: %{name}-libs = %{version}-%{release}
172%pyrequires_eq python-libs
173
174%description -n python-poldek
175Python modules for poldek.
176
caed9b36
JR
177%description -n python-poldek -l pl.UTF-8
178Moduły języka Python dla poldka.
58c31de0 179
03159b71 180%prep
78b0cd64 181%setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
85398bac 182%patch0 -p1
13aa6434
AM
183%patch1 -p1
184%patch2 -p1
04a91ad3 185%patch3 -p1
2a61c5d4 186%patch4 -p1
c826891f 187%patch5 -p1
25838a54 188%patch6 -p0
f4114128
ER
189%patch7 -p0
190%patch8 -p0
bf43a3ac 191%patch9 -p0
c7d7bdf5 192%patch10 -p1
22858076 193%patch11 -p1
f031015c 194%patch12 -p1
05e22a22 195%patch13 -p1
c756c410 196%patch14 -p1
20ff11b6 197%patch15 -p1
d0d294bd 198%patch16 -p1
f76d4526
PZ
199%patch17 -p1
200%patch18 -p1
a483213a 201%patch19 -p0
fb2a8800 202%patch20 -p1
8f2fba8c 203%patch21 -p1
b44549bf 204
0579f9b7
ER
205# cleanup backups after patching
206find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
207
b44549bf 208%build
bef9d2a3 209%{__libtoolize}
21a83253
MM
210%{__aclocal} -I m4
211%{__autoconf}
212%{__automake}
63bd61a7 213cp -f config.sub trurlib
b25cb9a7 214
97ecf213 215CPPFLAGS="-std=gnu99"
1f84648f 216%configure \
b25cb9a7 217 %{?with_static:--enable-static --disable-shared} \
9fe14a3f 218 %{!?with_imode:--disable-imode} \
58c31de0
JB
219 --enable-nls \
220 %{?with_python:--with-python}
03159b71 221%{__make}
8efee472 222
b44549bf 223%install
224rm -rf $RPM_BUILD_ROOT
08335479 225install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
8efee472 226
c8f7d829 227%{__make} install \
228 DESTDIR=$RPM_BUILD_ROOT
de1099c4 229
58c31de0
JB
230%if %{with python}
231%{__make} -C python install \
232 DESTDIR=$RPM_BUILD_ROOT \
233 libdir=%{py_sitedir}
234%endif
235
9fe14a3f 236%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
a49836bb 237
9639596f 238%ifarch i486 i686 ppc sparc alpha athlon
a49836bb 239%define _ftp_arch %{_target_cpu}
36004ea3 240%endif
9639596f 241%ifarch %{x8664}
590302c4 242%define _ftp_arch x86_64
b25cb9a7 243%define _ftp_alt_arch i686
36004ea3 244%endif
9639596f 245%ifarch i586
58820d9b 246%if "%{pld_release}" == "ti"
247%define _ftp_arch i586
248%else
9639596f 249%define _ftp_arch i486
36004ea3 250%endif
58820d9b 251%endif
a49836bb 252%ifarch pentium2 pentium3 pentium4
253%define _ftp_arch i686
36004ea3 254%endif
a49836bb 255%ifarch sparcv9 sparc64
256%define _ftp_arch sparc
257%endif
a49836bb 258
b25cb9a7 259%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
32697bd0 260
2ccd5d66 261%if "%{pld_release}" == "ti"
262sed -e '
263 s|%%ARCH%%|%{_ftp_arch}|g
264' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
265
266%ifarch %{x8664}
267sed '
268 s|%%ARCH%%|%{_ftp_alt_arch}|g
269' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
270%endif
271%else
7adf66ff
ER
272sed -e '
273 s|%%ARCH%%|%{_ftp_arch}|g
b43abde7 274' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
b44549bf 275
590302c4 276%ifarch %{x8664}
7adf66ff
ER
277sed '
278 s|%%ARCH%%|%{_ftp_alt_arch}|g
b43abde7 279' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
b25cb9a7 280%endif
2ccd5d66 281%endif
b25cb9a7 282
480fc3c0 283install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
b25cb9a7 284
9e6ff4ef 285%if %{with imode}
286# add desktop file and icon
287install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
2ccd5d66 288install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
289install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
9e6ff4ef 290%endif
291
b43abde7
ER
292# sources we don't package
293rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
b25cb9a7
JB
294# include them in %doc
295rm -rf configs
296cp -a conf configs
297rm -f configs/Makefile*
298
62e80071 299%if %{with python}
58c31de0
JB
300%py_postclean
301rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
62e80071 302%endif
58c31de0 303
b25cb9a7 304%find_lang %{name}
f373d903 305
b44549bf 306%clean
307rm -rf $RPM_BUILD_ROOT
308
3896c8b1
ER
309%post -p /sbin/postshell
310-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7 311
3896c8b1
ER
312%postun -p /sbin/postshell
313-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7
JB
314
315%post libs -p /sbin/ldconfig
316%postun libs -p /sbin/ldconfig
317
b25cb9a7
JB
318%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
319if [ -f /etc/poldek.conf.rpmsave ]; then
320 awk '/^source/ {
321 name = $3;
322 path = $4;
323 auto = "yes";
324 autoup = "yes";
325 type = "pdir";
f154dd55 326 pri = "";
b25cb9a7
JB
327
328 if (sub(",noauto", "", name)) {
329 auto = "no";
330 }
331
f154dd55
ER
332 # process pri=\d+
333 if (match(name, /,pri=[0-9]+/)) {
334 pri = substr(name, RSTART + 5, RLENGTH - 5);
335 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
336 }
337
b25cb9a7
JB
338 # skip ac sources. already in new config.
339 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
340 print "";
341 print "[source]";
342 print "name = " name;
343 print "type = " type;
344 print "path = " path;
345 print "auto = " auto;
346 print "autoup = " autoup;
f154dd55
ER
347 if (pri) {
348 print "pri = " pri;
349 }
b25cb9a7
JB
350 }
351
352 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
19cae196 353 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
b25cb9a7
JB
354
355 # copy hold=
356 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
357 if [ "$hold" ]; then
358 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
359 fi
360fi
361
b43abde7
ER
362%triggerpostun -- poldek < 0.30-0.20080225.00.1
363if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
364 %{__sed} -i -e '/^%%include source.conf/{
365 a
366 a# /etc/poldek/repos.d/*.conf
367 a%%includedir repos.d
368 }' %{_sysconfdir}/%{name}/poldek.conf
369fi
370
371%{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
372%{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
373
374if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
375 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
478b6a69 376 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
b43abde7
ER
377fi
378
379%ifarch %{x8664}
380if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
381 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
478b6a69 382 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
b43abde7
ER
383fi
384%endif
385
767366b0 386%files -f %{name}.lang
b44549bf 387%defattr(644,root,root,755)
b43abde7 388%doc README* NEWS TODO configs
b25cb9a7 389%dir %{_sysconfdir}/%{name}
08335479 390%dir %{_sysconfdir}/%{name}/repos.d
168acc54 391%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
b43abde7 392%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
8efee472 393%attr(755,root,root) %{_bindir}/*
b25cb9a7
JB
394%dir %{_libdir}/%{name}
395%attr(755,root,root) %{_libdir}/%{name}/*
b44549bf 396%{_mandir}/man1/%{name}*
d8826405 397%lang(pl) %{_mandir}/pl/man1/%{name}*
b25cb9a7 398%{_infodir}/poldek.info*
9e6ff4ef 399%if %{with imode}
400%{_desktopdir}/%{name}.desktop
401%{_pixmapsdir}/%{name}.png
402%endif
b25cb9a7 403
b43abde7 404%if %{without static}
b25cb9a7
JB
405%files libs
406%defattr(644,root,root,755)
d8aeff9a
MB
407%attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
408%attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
409%attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
410%attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
411%attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
412%attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
413%attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
414%attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
415%attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
416%attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
b25cb9a7
JB
417%endif
418
419%files devel
420%defattr(644,root,root,755)
421%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
422%{_libdir}/lib*.la
423%{_includedir}/*
424
425%files static
426%defattr(644,root,root,755)
427%{_libdir}/lib*.a
58c31de0
JB
428
429%if %{with python}
430%files -n python-poldek
431%defattr(644,root,root,755)
432%attr(755,root,root) %{py_sitedir}/_poldekmod.so
433%{py_sitescriptdir}/poldek.py[co]
434%{py_sitescriptdir}/poldekmod.py[co]
435%endif
This page took 0.203268 seconds and 4 git commands to generate.