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