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