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