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