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