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