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