]> git.pld-linux.org Git - packages/poldek.git/blame_incremental - poldek.spec
remove also static selinux libraries from BRs
[packages/poldek.git] / poldek.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_with static # don't use shared libraries
4%bcond_without imode # don't build interactive mode
5%bcond_without python # don't build python bindings
6%bcond_with snap # install configs for official Th snapshot
7%bcond_with db60 # DB 6.0 instead of 5.2
8
9# current snapshot name
10%define SNAP 2013
11
12# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
13# NOTE: poldek links with "system db" (-ldb) anyway if it exists
14%if %{with db60}
15%define db_pkg db6.0
16%define ver_db 6.0
17%define ver_db_rel 1
18%else
19%define db_pkg db5.2
20%define ver_db 5.2
21%define ver_db_rel 3
22%endif
23%define ver_rpm 5.4.10
24
25%define rel 8
26Summary: RPM packages management helper tool
27Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
28Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
29Name: poldek
30Version: 0.30.0
31Release: %{rel}%{?with_snap:.%{SNAP}}
32License: GPL v2
33Group: Applications/System
34#Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
35Source0: http://carme.pld-linux.org/~megabajt/releases/poldek/%{name}-%{version}.tar.xz
36# Source0-md5: 392cfa125912fbedb6cc6d54dfbb80e3
37Source1: %{name}.conf
38Source2: %{name}-multilib.conf
39Source5: %{name}-aliases.conf
40Source6: %{name}.desktop
41Source7: %{name}.png
42Source8: %{name}-debuginfo.conf
43Source9: %{name}-aidath.conf
44Source10: %{name}-multilib-aidath.conf
45Source11: %{name}-archive.conf
46Source100: %{name}-snap.conf
47Source101: %{name}-multilib-snap.conf
48Source102: %{name}-debuginfo-snap.conf
49Patch0: %{name}-size-type.patch
50Patch1: %{name}-glibc-internal.patch
51Patch2: %{name}-config.patch
52Patch3: at-char-completion.patch
53Patch4: %{name}-ignore-too-long-paths.patch
54Patch5: %{name}-noorder.patch
55URL: http://poldek.pld-linux.org/
56BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
57BuildRequires: autoconf
58BuildRequires: automake >= 1:1.11
59BuildRequires: bzip2-devel
60BuildRequires: check-devel
61BuildRequires: docbook-dtd412-xml
62BuildRequires: gettext-devel
63BuildRequires: libtool
64BuildRequires: libxml2-devel
65BuildRequires: neon-devel
66BuildRequires: openssl-devel >= 0.9.7d
67BuildRequires: pcre-devel
68BuildRequires: pkgconfig
69BuildRequires: popt-devel
70%{?with_python:BuildRequires: python-devel}
71BuildRequires: readline-devel >= 5.0
72BuildRequires: rpm-devel >= %{ver_rpm}
73%{?with_python:BuildRequires: rpm-pythonprov}
74BuildRequires: swig-python
75BuildRequires: tar >= 1:1.22
76BuildRequires: xmlto
77BuildRequires: xz
78BuildRequires: zlib-devel
79%if %{with static}
80BuildRequires: %{db_pkg}-static >= %{ver_db}-%{ver_db_rel}
81BuildRequires: bzip2-static
82BuildRequires: glibc-static
83BuildRequires: libxml2-static
84BuildRequires: ncurses-static
85BuildRequires: openssl-static
86BuildRequires: pcre-static
87BuildRequires: popt-static
88BuildRequires: readline-static
89BuildRequires: rpm-static
90BuildRequires: zlib-static
91%endif
92Requires(triggerpostun): awk
93Requires(triggerpostun): sed >= 4.0
94Requires: %{db_pkg} >= %{ver_db}-%{ver_db_rel}
95Requires: %{name}-libs = %{version}-%{release}
96Requires: rpm >= %{ver_rpm}
97Requires: rpm-db-ver = %{ver_db}
98#Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
99Requires: rpm-lib >= 5.4.10
100# vf* scripts use sed
101Requires: sed
102BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
103
104%define _libexecdir %{_prefix}/lib/%{name}
105
106%description
107poldek is an RPM package management tool which allows you to easily
108perform package verification, installation (including system
109installation from scratch), upgrading, and removal.
110
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.
115
116%{?with_static:This version is statically linked.}
117
118%{!?with_imode:This version hasn't got interactive mode.}
119#'vim
120
121%description -l hu.UTF-8
122poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
123csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
124nulláról), frissítést és eltávolítást.
125
126A program használható parancssorból (mint a Debian apt-get programja)
127vagy interaktív módban. Az interaktív mód egy readline környezetet
128jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
129shell módjához.
130
131%{?with_static:Ez a verzió statikusan linkelt.}
132
133%{!?with_imode:Ennek a verziónak nincs interaktív módja.}
134
135%description -l pl.UTF-8
136poldek jest narzędziem linii poleceń służącym do weryfikacji,
137instalacji (włączając instalację systemu od zera), aktualizacji i
138usuwania pakietów.
139
140Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
141interaktywnym. Tryb interaktywny posiada interfejs readline z
142dopełnianiem komend i historią, podobny do trybu shell perlowego
143modułu CPAN.
144
145%{?with_static:Ta wersja jest konsolidowana statycznie.}
146
147%{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
148
149%package libs
150Summary: poldek libraries
151Summary(hu.UTF-8): A poldek könyvtárai
152Summary(pl.UTF-8): Biblioteki poldka
153Group: Libraries
154
155%description libs
156poldek libraries.
157
158%description libs -l hu.UTF-8
159A poldek könyvtárai.
160
161%description libs -l pl.UTF-8
162Biblioteki poldka.
163
164%package devel
165Summary: Header files for poldek libraries
166Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
167Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
168Group: Development/Libraries
169Requires: %{name}-libs = %{version}-%{release}
170Requires: rpm-devel >= %{ver_rpm}
171
172%description devel
173Header files for poldek libraries.
174
175%description devel -l hu.UTF-8
176A poldek könyvtár fejlesztői fájljai.
177
178%description devel -l pl.UTF-8
179Pliki nagłówkowe bibliotek poldka.
180
181%package static
182Summary: poldek static libraries
183Summary(hu.UTF-8): poldek statikus könyvtárak
184Summary(pl.UTF-8): Biblioteki statyczne poldka
185Group: Development/Libraries
186Requires: %{name}-devel = %{version}-%{release}
187
188%description static
189poldek static libraries.
190
191%description static -l hu.UTF-8
192poldek statikus könyvtárak.
193
194%description static -l pl.UTF-8
195Biblioteki statyczne poldka.
196
197%package -n python-poldek
198Summary: Python modules for poldek
199Summary(hu.UTF-8): Python modulok poldek-hez
200Summary(pl.UTF-8): Moduły języka Python dla poldka
201Group: Libraries/Python
202Requires: %{name}-libs = %{version}-%{release}
203Requires: python-libs
204
205%description -n python-poldek
206Python modules for poldek.
207
208%description -n python-poldek -l hu.UTF-8
209Python modulok poldek-hez.
210
211%description -n python-poldek -l pl.UTF-8
212Moduły języka Python dla poldka.
213
214%prep
215%setup -q
216%patch0 -p1
217%patch1 -p1
218%patch2 -p1
219%patch3 -p1
220%patch4 -p1
221%patch5 -p1
222
223%{__rm} m4/libtool.m4 m4/lt*.m4
224
225# cleanup backups after patching
226find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
227chmod u+x ./configure ./doc/conf-xml2.sh
228
229%build
230%{__gettextize}
231%{__libtoolize}
232%{__aclocal} -I m4
233%{__autoheader}
234%{__autoconf}
235%{__automake}
236cd tndb
237%{__libtoolize}
238%{__aclocal}
239%{__autoheader}
240%{__autoconf}
241%{__automake}
242cd ../trurlib
243%{__libtoolize}
244%{__aclocal}
245%{__autoheader}
246%{__autoconf}
247%{__automake}
248cd ..
249
250CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline"
251%configure \
252 %{?with_static:--enable-static --disable-shared} \
253 %{!?with_imode:--disable-imode} \
254 --with-pkglibdir=%{_libexecdir} \
255 --enable-nls \
256 %{?with_python:--with-python}
257%{__make} -j1
258# --enable-trace
259
260%install
261rm -rf $RPM_BUILD_ROOT
262install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
263
264%{__make} install -j1 \
265 DESTDIR=$RPM_BUILD_ROOT
266
267%if %{with python}
268%{__make} -C python -j1 install \
269 DESTDIR=$RPM_BUILD_ROOT \
270 libdir=%{py_sitedir}
271%endif
272
273%{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
274
275%ifarch i486 i686 ppc sparc alpha athlon
276 %define _ftp_arch %{_target_cpu}
277%endif
278%ifarch %{x8664}
279 %define _ftp_arch x86_64
280 %define _ftp_alt_arch i686
281%endif
282%ifarch i586
283 %define _ftp_arch i486
284%endif
285%ifarch pentium2 pentium3 pentium4
286 %define _ftp_arch i686
287%endif
288%ifarch sparcv9 sparc64
289 %define _ftp_arch sparc
290 %define _ftp_arch %{_target_cpu}
291 %ifarch sparc64
292 %define _ftp_alt_arch sparcv9
293 %endif
294%endif
295
296%define pld_conf %{SOURCE1}
297%define pld_debuginfo_conf %{SOURCE8}
298%define pld_archive_conf %{SOURCE11}
299
300%ifarch %{x8664}
301 %define pld_multilib_conf %{SOURCE2}
302%endif
303
304# aidath
305%ifarch sparcv9 sparc64
306 %define pld_conf %{SOURCE9}
307 %undefine pld_archive_conf
308%endif
309%ifarch sparc64
310 %define pld_multilib_conf %{SOURCE10}
311%endif
312
313%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
314
315%if 0%{?pld_multilib_conf:1}
316 %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
317%endif
318
319%if 0%{?pld_debuginfo_conf:1}
320%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
321%endif
322
323%if 0%{?pld_archive_conf:1}
324%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf
325%endif
326
327# Always install snapshot configs
328%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \
329 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
330%{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \
331 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE102} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-debuginfo.conf
332%ifarch %{x8664}
333 %{__sed} -e 's|%%ARCH%%|%{_ftp_alt_arch}|g' \
334 -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf
335%endif
336
337%if %{with snap}
338%{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
339%{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
340%else
341%{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf
342%{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
343%endif
344
345cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
346
347%if %{with imode}
348# add desktop file and icon
349install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
350cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
351cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
352%endif
353
354# sources we don't package
355%{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
356# include them in %doc
357%{__rm} -rf configs
358cp -a conf configs
359%{__rm} -f configs/Makefile*
360
361%if %{with python}
362%py_postclean
363%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
364%endif
365
366%find_lang %{name}
367
368%clean
369rm -rf $RPM_BUILD_ROOT
370
371%post
372[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
373if [ "$1" = "1" ]; then
374 # remove ignore = vserver-packages inside vserver on first install
375 {
376 while read f ctx; do
377 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
378 done </proc/self/status
379 } 2>/dev/null
380 if [ -z "$ctx" -o "$ctx" = "0" ]; then
381 VSERVER=no
382 else
383 VSERVER=yes
384 fi
385 if [ "$VSERVER" = "yes" ]; then
386 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
387 fi
388fi
389
390%postun -p /sbin/postshell
391-/usr/sbin/fix-info-dir -c %{_infodir}
392
393%post libs -p /sbin/ldconfig
394%postun libs -p /sbin/ldconfig
395
396%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
397if [ -f /etc/poldek.conf.rpmsave ]; then
398 awk '/^source/ {
399 name = $3;
400 path = $4;
401 auto = "yes";
402 autoup = "yes";
403 type = "pdir";
404 pri = "";
405
406 if (sub(",noauto", "", name)) {
407 auto = "no";
408 }
409
410 # process pri=\d+
411 if (match(name, /,pri=[0-9]+/)) {
412 pri = substr(name, RSTART + 5, RLENGTH - 5);
413 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
414 }
415
416 # skip ac sources. already in new config.
417 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
418 print "";
419 print "[source]";
420 print "name = " name;
421 print "type = " type;
422 print "path = " path;
423 print "auto = " auto;
424 print "autoup = " autoup;
425 if (pri) {
426 print "pri = " pri;
427 }
428 }
429
430 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
431 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
432
433 # copy hold=
434 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
435 if [ "$hold" ]; then
436 %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
437 fi
438fi
439
440%triggerpostun -- poldek < 0.30-0.20080225.00.1
441if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
442 %{__sed} -i -e '/^%%include source.conf/{
443 a
444 a# /etc/poldek/repos.d/*.conf
445 a%%includedir repos.d
446 }' %{_sysconfdir}/%{name}/poldek.conf
447fi
448
449%{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
450%{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
451
452if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
453 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
454 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
455fi
456
457%ifarch %{x8664}
458if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
459 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
460 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
461fi
462%endif
463
464%files -f %{name}.lang
465%defattr(644,root,root,755)
466%doc ChangeLog README* NEWS TODO configs
467%dir %{_sysconfdir}/%{name}
468%dir %{_sysconfdir}/%{name}/repos.d
469%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
470%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
471%attr(755,root,root) %{_bindir}/ipoldek
472%attr(755,root,root) %{_bindir}/poldek
473%attr(755,root,root) %{_bindir}/rpmvercmp
474%dir %{_libexecdir}
475%attr(755,root,root) %{_libexecdir}/*
476%{_mandir}/man1/%{name}*.1*
477%lang(pl) %{_mandir}/pl/man1/%{name}*
478%{_infodir}/poldek.info*
479%if %{with imode}
480%{_desktopdir}/%{name}.desktop
481%{_pixmapsdir}/%{name}.png
482%endif
483%dir /var/cache/%{name}
484
485%if %{without static}
486%files libs
487%defattr(644,root,root,755)
488%attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
489%attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
490%attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
491%attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
492%attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
493%attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
494%attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
495%attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
496%attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
497%attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
498%endif
499
500%files devel
501%defattr(644,root,root,755)
502%if %{without static}
503%attr(755,root,root) %{_libdir}/libpoclidek.so
504%attr(755,root,root) %{_libdir}/libpoldek.so
505%attr(755,root,root) %{_libdir}/libtndb.so
506%attr(755,root,root) %{_libdir}/libtrurl.so
507%attr(755,root,root) %{_libdir}/libvfile.so
508%endif
509%{_libdir}/libpoclidek.la
510%{_libdir}/libpoldek.la
511%{_libdir}/libtndb.la
512%{_libdir}/libtrurl.la
513%{_libdir}/libvfile.la
514%{_includedir}/poldek
515%{_includedir}/tndb
516%{_includedir}/trurl
517%{_includedir}/vfile
518%{_pkgconfigdir}/tndb.pc
519%{_pkgconfigdir}/trurlib.pc
520
521%files static
522%defattr(644,root,root,755)
523%{_libdir}/libtndb.a
524%{_libdir}/libtrurl.a
525
526%if %{with python}
527%files -n python-poldek
528%defattr(644,root,root,755)
529%attr(755,root,root) %{py_sitedir}/_poldekmod.so
530%{py_sitescriptdir}/poldek.py[co]
531%{py_sitescriptdir}/poldekmod.py[co]
532%endif
This page took 0.039073 seconds and 4 git commands to generate.