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