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