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