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