]> git.pld-linux.org Git - packages/poldek.git/blame - poldek.spec
Drop Ti stuff from master
[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
b614e8f7 6%bcond_with snap # don't build python bindings
7000d724 7
373c6f03 8# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
530c8c41 9%define ver_db 4.7.25
473ce98d 10%define ver_db_rel 1
dda7b73c 11%define ver_rpm 4.5-49
7000d724 12
810df317 13%define snap rc5
b8e2dc6d 14%define rel 12
b44549bf 15Summary: RPM packages management helper tool
9c03ea8f 16Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
9faf625a 17Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
b44549bf 18Name: poldek
24ad8b8d 19Version: 0.30
d5caab1d 20Release: 1.%{snap}.%{rel}
9f931ada 21License: GPL v2
8efee472 22Group: Applications/System
85398bac 23#Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
e46f6b38 24Source0: http://carme.pld-linux.org/~cactus/snaps/poldek/%{name}-%{version}%{snap}.tar.xz
810df317 25# Source0-md5: ab89926c28cfb6b7d72497fc37c16ac4
911a8560 26Source1: %{name}.conf
b25cb9a7 27Source2: %{name}-multilib.conf
2ccd5d66 28Source5: %{name}-aliases.conf
29Source6: %{name}.desktop
30Source7: %{name}.png
171e07f6 31Source8: %{name}-debuginfo.conf
652b5bc5 32Source9: %{name}-aidath.conf
33Source10: %{name}-multilib-aidath.conf
8db66c11 34Source11: %{name}-archive.conf
85398bac
MB
35Patch0: %{name}-vserver-packages.patch
36Patch1: %{name}-config.patch
a9c9446a 37Patch2: %{name}-size-type.patch
f8e81a61 38Patch3: %{name}-Os-fail-workaround.patch
f4205795 39Patch4: %{name}-git.patch
5e2c5cc3 40Patch5: %{name}-am.patch
39ca2371 41URL: http://poldek.pld-linux.org/
a4268952 42BuildRequires: autoconf
b25cb9a7 43BuildRequires: automake
373c6f03 44BuildRequires: bzip2-devel
065b86e0 45BuildRequires: check-devel
530c8c41 46BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
1d67e563 47BuildRequires: docbook-dtd412-xml
f77a8b4c 48BuildRequires: gettext-devel
b25cb9a7
JB
49BuildRequires: libtool
50BuildRequires: libxml2-devel
fc37ede0 51BuildRequires: neon-devel
cbc6f56b 52BuildRequires: openssl-devel >= 0.9.7d
13fd950e 53BuildRequires: pcre-devel
b3ea4b51 54BuildRequires: pkgconfig
13fd950e 55BuildRequires: popt-devel
58c31de0 56%{?with_python:BuildRequires: python-devel}
b25cb9a7 57BuildRequires: readline-devel >= 5.0
373c6f03 58BuildRequires: rpm-devel >= %{ver_rpm}
300927eb 59%{?with_python:BuildRequires: rpm-pythonprov}
65a99b8b 60BuildRequires: swig-python
77cfda6e 61BuildRequires: xmlto
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
f8e81a61 201%patch3 -p1
e790f566 202%patch4 -p1
5e2c5cc3 203%patch5 -p1
8dcb75fc 204
5e2c5cc3 205%{__rm} m4/libtool.m4 m4/lt*.m4
b44549bf 206
0579f9b7
ER
207# cleanup backups after patching
208find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
4fa2b79c 209chmod u+x ./configure ./doc/conf-xml2.sh
0579f9b7 210
b44549bf 211%build
bef9d2a3 212%{__libtoolize}
21a83253 213%{__aclocal} -I m4
d878a63c 214%{__autoheader}
21a83253
MM
215%{__autoconf}
216%{__automake}
f8e81a61 217cd tndb
313cd172 218%{__libtoolize}
5e2c5cc3
JB
219%{__aclocal}
220%{__autoheader}
221%{__autoconf}
222%{__automake}
f8e81a61 223cd ../trurlib
313cd172 224%{__libtoolize}
5e2c5cc3
JB
225%{__aclocal}
226%{__autoheader}
227%{__autoconf}
228%{__automake}
f8e81a61 229cd ..
b25cb9a7 230
5e2c5cc3 231CPPFLAGS="%{rpmcppflags} -std=gnu99"
1f84648f 232%configure \
b25cb9a7 233 %{?with_static:--enable-static --disable-shared} \
9fe14a3f 234 %{!?with_imode:--disable-imode} \
58c31de0
JB
235 --enable-nls \
236 %{?with_python:--with-python}
9fb594dc 237%{__make} -j1
a1f22296 238# --enable-trace
8efee472 239
b44549bf 240%install
241rm -rf $RPM_BUILD_ROOT
27edf30a 242install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
8efee472 243
9fb594dc 244%{__make} install -j1 \
c8f7d829 245 DESTDIR=$RPM_BUILD_ROOT
de1099c4 246
58c31de0 247%if %{with python}
9fb594dc 248%{__make} -C python -j1 install \
58c31de0
JB
249 DESTDIR=$RPM_BUILD_ROOT \
250 libdir=%{py_sitedir}
251%endif
252
5e2c5cc3 253%{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
a49836bb 254
9639596f 255%ifarch i486 i686 ppc sparc alpha athlon
23ead09a 256 %define _ftp_arch %{_target_cpu}
36004ea3 257%endif
9639596f 258%ifarch %{x8664}
23ead09a
ER
259 %define _ftp_arch x86_64
260 %define _ftp_alt_arch i686
36004ea3 261%endif
9639596f 262%ifarch i586
b614e8f7 263 %define _ftp_arch i486
58820d9b 264%endif
a49836bb 265%ifarch pentium2 pentium3 pentium4
23ead09a 266 %define _ftp_arch i686
36004ea3 267%endif
a49836bb 268%ifarch sparcv9 sparc64
23ead09a 269 %define _ftp_arch sparc
b614e8f7
JR
270 %define _ftp_arch %{_target_cpu}
271 %ifarch sparc64
23ead09a 272 %define _ftp_alt_arch sparcv9
23ead09a 273 %endif
652b5bc5 274%endif
32697bd0 275
b614e8f7
JR
276%define pld_conf %{SOURCE1}
277%define pld_debuginfo_conf %{SOURCE8}
278%define pld_archive_conf %{SOURCE11}
7c0e4fc5 279
b614e8f7
JR
280%ifarch %{x8664}
281 %define pld_multilib_conf %{SOURCE2}
282%endif
7c0e4fc5 283
b614e8f7
JR
284# aidath
285%ifarch sparcv9 sparc64
286 %define pld_conf %{SOURCE9}
287 %undefine pld_archive_conf
288%endif
289%ifarch sparc64
290 %define pld_multilib_conf %{SOURCE10}
7c0e4fc5 291%endif
23ead09a 292
7c0e4fc5 293sed -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
23ead09a 294
7c0e4fc5
ER
295%if 0%{?pld_multilib_conf:1}
296 sed 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
297%endif
298
299%if 0%{?pld_debuginfo_conf:1}
300sed -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
652b5bc5 301%endif
b25cb9a7 302
8db66c11
ER
303%if 0%{?pld_archive_conf:1}
304sed -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf
305%endif
306
27edf30a 307cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
b25cb9a7 308
9e6ff4ef 309%if %{with imode}
310# add desktop file and icon
311install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
27edf30a
ER
312cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
313cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
9e6ff4ef 314%endif
315
b43abde7 316# sources we don't package
5e2c5cc3 317%{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
b25cb9a7
JB
318# include them in %doc
319rm -rf configs
320cp -a conf configs
321rm -f configs/Makefile*
322
62e80071 323%if %{with python}
58c31de0 324%py_postclean
5e2c5cc3 325%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
62e80071 326%endif
58c31de0 327
b25cb9a7 328%find_lang %{name}
f373d903 329
b44549bf 330%clean
331rm -rf $RPM_BUILD_ROOT
332
daf0e7ce
ER
333%post
334[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
335if [ "$1" = "1" ]; then
336 # remove ignore = vserver-packages inside vserver on first install
337 {
338 while read f ctx; do
339 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
340 done </proc/self/status
341 } 2>/dev/null
342 if [ -z "$ctx" -o "$ctx" = "0" ]; then
343 VSERVER=no
344 else
345 VSERVER=yes
346 fi
347 if [ "$VSERVER" = "yes" ]; then
348 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
349 fi
350fi
b25cb9a7 351
3896c8b1
ER
352%postun -p /sbin/postshell
353-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7
JB
354
355%post libs -p /sbin/ldconfig
356%postun libs -p /sbin/ldconfig
357
b25cb9a7
JB
358%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
359if [ -f /etc/poldek.conf.rpmsave ]; then
360 awk '/^source/ {
361 name = $3;
362 path = $4;
363 auto = "yes";
364 autoup = "yes";
365 type = "pdir";
f154dd55 366 pri = "";
b25cb9a7
JB
367
368 if (sub(",noauto", "", name)) {
369 auto = "no";
370 }
371
f154dd55
ER
372 # process pri=\d+
373 if (match(name, /,pri=[0-9]+/)) {
374 pri = substr(name, RSTART + 5, RLENGTH - 5);
375 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
376 }
377
b25cb9a7
JB
378 # skip ac sources. already in new config.
379 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
380 print "";
381 print "[source]";
382 print "name = " name;
383 print "type = " type;
384 print "path = " path;
385 print "auto = " auto;
386 print "autoup = " autoup;
f154dd55
ER
387 if (pri) {
388 print "pri = " pri;
389 }
b25cb9a7
JB
390 }
391
392 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
19cae196 393 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
b25cb9a7
JB
394
395 # copy hold=
396 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
397 if [ "$hold" ]; then
398 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
399 fi
400fi
401
b43abde7
ER
402%triggerpostun -- poldek < 0.30-0.20080225.00.1
403if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
404 %{__sed} -i -e '/^%%include source.conf/{
405 a
406 a# /etc/poldek/repos.d/*.conf
407 a%%includedir repos.d
408 }' %{_sysconfdir}/%{name}/poldek.conf
409fi
410
411%{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
412%{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
413
414if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
415 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
478b6a69 416 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
b43abde7
ER
417fi
418
419%ifarch %{x8664}
420if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
421 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
478b6a69 422 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
b43abde7
ER
423fi
424%endif
425
767366b0 426%files -f %{name}.lang
b44549bf 427%defattr(644,root,root,755)
a9c9446a 428%doc ChangeLog README* NEWS TODO configs
b25cb9a7 429%dir %{_sysconfdir}/%{name}
08335479 430%dir %{_sysconfdir}/%{name}/repos.d
168acc54 431%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
b43abde7 432%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
5e2c5cc3
JB
433%attr(755,root,root) %{_bindir}/ipoldek
434%attr(755,root,root) %{_bindir}/poldek
435%attr(755,root,root) %{_bindir}/rpmvercmp
b25cb9a7
JB
436%dir %{_libdir}/%{name}
437%attr(755,root,root) %{_libdir}/%{name}/*
5e2c5cc3 438%{_mandir}/man1/%{name}*.1*
d8826405 439%lang(pl) %{_mandir}/pl/man1/%{name}*
b25cb9a7 440%{_infodir}/poldek.info*
9e6ff4ef 441%if %{with imode}
442%{_desktopdir}/%{name}.desktop
443%{_pixmapsdir}/%{name}.png
444%endif
27edf30a 445%dir /var/cache/%{name}
b25cb9a7 446
b43abde7 447%if %{without static}
b25cb9a7
JB
448%files libs
449%defattr(644,root,root,755)
d8aeff9a
MB
450%attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
451%attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
452%attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
453%attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
454%attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
455%attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
456%attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
457%attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
458%attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
459%attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
b25cb9a7
JB
460%endif
461
462%files devel
463%defattr(644,root,root,755)
5e2c5cc3
JB
464%if %{without static}
465%attr(755,root,root) %{_libdir}/libpoclidek.so
466%attr(755,root,root) %{_libdir}/libpoldek.so
467%attr(755,root,root) %{_libdir}/libtndb.so
468%attr(755,root,root) %{_libdir}/libtrurl.so
469%attr(755,root,root) %{_libdir}/libvfile.so
470%endif
471%{_libdir}/libpoclidek.la
472%{_libdir}/libpoldek.la
473%{_libdir}/libtndb.la
474%{_libdir}/libtrurl.la
475%{_libdir}/libvfile.la
476%{_includedir}/poldek
477%{_includedir}/tndb
478%{_includedir}/trurl
479%{_includedir}/vfile
480%{_pkgconfigdir}/tndb.pc
b25cb9a7
JB
481
482%files static
483%defattr(644,root,root,755)
5e2c5cc3
JB
484%{_libdir}/libtndb.a
485%{_libdir}/libtrurl.a
58c31de0
JB
486
487%if %{with python}
488%files -n python-poldek
489%defattr(644,root,root,755)
490%attr(755,root,root) %{py_sitedir}/_poldekmod.so
491%{py_sitescriptdir}/poldek.py[co]
492%{py_sitescriptdir}/poldekmod.py[co]
493%endif
This page took 0.171998 seconds and 4 git commands to generate.