]> git.pld-linux.org Git - packages/poldek.git/blame_incremental - poldek.spec
- fix public API
[packages/poldek.git] / poldek.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_with static # don't use shared libraries
4%bcond_without imode # don't build interactive mode
5%bcond_without python # don't build python bindings
6#
7# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
8%if "%{pld_release}" == "ti"
9%define ver_db 4.5.20
10%define ver_db_rel 8
11%else
12%define ver_db 4.7.25
13%define ver_db_rel 1
14%endif
15%define ver_rpm 4.5-5
16#
17%define snap 20080820.23
18%define rel 15
19Summary: RPM packages management helper tool
20Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
21Name: poldek
22Version: 0.30
23Release: 0.%{snap}.%{rel}
24License: GPL v2
25Group: Applications/System
26#Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
27Source0: http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}-cvs%{snap}.tar.bz2
28# Source0-md5: 2738eb3996f1cdf1e5d74b913d6e7414
29Source1: %{name}.conf
30Source2: %{name}-multilib.conf
31Source3: %{name}-ti.conf
32Source4: %{name}-multilib-ti.conf
33Source5: %{name}-aliases.conf
34Source6: %{name}.desktop
35Source7: %{name}.png
36Patch0: %{name}-vserver-packages.patch
37Patch1: %{name}-config.patch
38Patch2: %{name}-abort-on-upgrade.patch
39Patch3: %{name}-inline.patch
40Patch4: %{name}-ls-llu.patch
41Patch5: %{name}-op-ldalldesc.patch
42Patch6: %{name}-nocolor-upgrade.patch
43Patch7: %{name}-upgrade-dist.patch
44Patch8: %{name}-keep-reinstalled-provides.patch
45Patch9: %{name}-dont-ask-for-suggests-on-errors.patch
46Patch10: %{name}-crash-on-invalid-locale.patch
47Patch11: %{name}-noutf8.patch
48Patch12: %{name}-dont-suggests-required-packages.patch
49Patch13: %{name}-tty-for-erasures.patch
50Patch14: %{name}-both_langs.patch
51Patch15: %{name}-317130.patch
52Patch16: %{name}-321546.patch
53URL: http://poldek.pld-linux.org/
54BuildRequires: autoconf
55BuildRequires: automake
56BuildRequires: bzip2-devel
57BuildRequires: check
58BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
59BuildRequires: gettext-autopoint
60BuildRequires: libtool
61BuildRequires: libxml2-devel
62BuildRequires: openssl-devel >= 0.9.7d
63BuildRequires: pcre-devel
64BuildRequires: perl-tools-pod
65BuildRequires: pkgconfig
66BuildRequires: popt-devel
67%{?with_python:BuildRequires: python-devel}
68BuildRequires: readline-devel >= 5.0
69BuildRequires: rpm-devel >= %{ver_rpm}
70%{?with_python:BuildRequires: rpm-pythonprov}
71BuildRequires: xmlto
72BuildRequires: zlib-devel
73%if %{with static}
74BuildRequires: bzip2-static
75BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
76BuildRequires: glibc-static
77BuildRequires: libselinux-static
78BuildRequires: libxml2-static
79BuildRequires: ncurses-static
80BuildRequires: openssl-static
81BuildRequires: pcre-static
82BuildRequires: popt-static
83BuildRequires: readline-static
84BuildRequires: rpm-static
85BuildRequires: zlib-static
86%endif
87Requires(triggerpostun): awk
88Requires(triggerpostun): sed >= 4.0
89Requires: %{name}-libs = %{version}-%{release}
90Requires: db >= %{ver_db}-%{ver_db_rel}
91Requires: rpm >= %{ver_rpm}
92Requires: rpm-db-ver = %{ver_db}
93Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
94# vf* scripts use sed
95Requires: sed
96BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
97
98%description
99poldek is an RPM package management tool which allows you to easily
100perform package verification, installation (including system
101installation from scratch), upgrading, and removal.
102
103Program can be used in batch (like apt-get from Debian's APT) or
104interactive mode. The interactive mode puts you into a readline
105interface with command line autocompletion and history, similar to the
106shell mode of Perl's CPAN.
107
108%{?with_static:This version is statically linked.}
109
110%{!?with_imode:This version hasn't got interactive mode.}
111#'vim
112
113%description -l pl.UTF-8
114poldek jest narzędziem linii poleceń służącym do weryfikacji,
115instalacji (włączając instalację systemu od zera), aktualizacji i
116usuwania pakietów.
117
118Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
119interaktywnym. Tryb interaktywny posiada interfejs readline z
120dopełnianiem komend i historią, podobny do trybu shell perlowego
121modułu CPAN.
122
123%{?with_static:Ta wersja jest konsolidowana statycznie.}
124
125%{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
126
127%package libs
128Summary: poldek libraries
129Summary(pl.UTF-8): Biblioteki poldka
130Group: Libraries
131
132%description libs
133poldek libraries.
134
135%description libs -l pl.UTF-8
136Biblioteki poldka.
137
138%package devel
139Summary: Header files for poldek libraries
140Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
141Group: Development/Libraries
142Requires: %{name}-libs = %{version}-%{release}
143
144%description devel
145Header files for poldek libraries.
146
147%description devel -l pl.UTF-8
148Pliki nagłówkowe bibliotek poldka.
149
150%package static
151Summary: poldek static libraries
152Summary(pl.UTF-8): Biblioteki statyczne poldka
153Group: Development/Libraries
154Requires: %{name}-devel = %{version}-%{release}
155
156%description static
157poldek static libraries.
158
159%description static -l pl.UTF-8
160Biblioteki statyczne poldka.
161
162%package -n python-poldek
163Summary: Python modules for poldek
164Summary(pl.UTF-8): Moduły języka Python dla poldka
165Group: Libraries/Python
166Requires: %{name}-libs = %{version}-%{release}
167%pyrequires_eq python-libs
168
169%description -n python-poldek
170Python modules for poldek.
171
172%description -n python-poldek -l pl.UTF-8
173Moduły języka Python dla poldka.
174
175%prep
176%setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
177%patch0 -p1
178%patch1 -p1
179%patch2 -p1
180%patch3 -p1
181%patch4 -p1
182%patch5 -p1
183%patch6 -p0
184%patch7 -p0
185%patch8 -p0
186%patch9 -p0
187%patch10 -p1
188%patch11 -p1
189%patch12 -p1
190%patch13 -p1
191%patch14 -p1
192%patch15 -p1
193%patch16 -p1
194
195# cleanup backups after patching
196find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
197
198%build
199%{__libtoolize}
200%{__aclocal} -I m4
201%{__autoconf}
202%{__automake}
203cp -f config.sub trurlib
204
205CPPFLAGS="-std=gnu99"
206%configure \
207 %{?with_static:--enable-static --disable-shared} \
208 %{!?with_imode:--disable-imode} \
209 --enable-nls \
210 %{?with_python:--with-python}
211%{__make}
212
213%install
214rm -rf $RPM_BUILD_ROOT
215install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
216
217%{__make} install \
218 DESTDIR=$RPM_BUILD_ROOT
219
220%if %{with python}
221%{__make} -C python install \
222 DESTDIR=$RPM_BUILD_ROOT \
223 libdir=%{py_sitedir}
224%endif
225
226%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
227
228%ifarch i486 i686 ppc sparc alpha athlon
229%define _ftp_arch %{_target_cpu}
230%endif
231%ifarch %{x8664}
232%define _ftp_arch x86_64
233%define _ftp_alt_arch i686
234%endif
235%ifarch i586
236%if "%{pld_release}" == "ti"
237%define _ftp_arch i586
238%else
239%define _ftp_arch i486
240%endif
241%endif
242%ifarch pentium2 pentium3 pentium4
243%define _ftp_arch i686
244%endif
245%ifarch sparcv9 sparc64
246%define _ftp_arch sparc
247%endif
248
249%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
250
251%if "%{pld_release}" == "ti"
252sed -e '
253 s|%%ARCH%%|%{_ftp_arch}|g
254' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
255
256%ifarch %{x8664}
257sed '
258 s|%%ARCH%%|%{_ftp_alt_arch}|g
259' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
260%endif
261%else
262sed -e '
263 s|%%ARCH%%|%{_ftp_arch}|g
264' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
265
266%ifarch %{x8664}
267sed '
268 s|%%ARCH%%|%{_ftp_alt_arch}|g
269' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
270%endif
271%endif
272
273install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
274
275%if %{with imode}
276# add desktop file and icon
277install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
278install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
279install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
280%endif
281
282# sources we don't package
283rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
284# include them in %doc
285rm -rf configs
286cp -a conf configs
287rm -f configs/Makefile*
288
289%if %{with python}
290%py_postclean
291rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
292%endif
293
294%find_lang %{name}
295
296%clean
297rm -rf $RPM_BUILD_ROOT
298
299%post -p /sbin/postshell
300-/usr/sbin/fix-info-dir -c %{_infodir}
301
302%postun -p /sbin/postshell
303-/usr/sbin/fix-info-dir -c %{_infodir}
304
305%post libs -p /sbin/ldconfig
306%postun libs -p /sbin/ldconfig
307
308%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
309if [ -f /etc/poldek.conf.rpmsave ]; then
310 awk '/^source/ {
311 name = $3;
312 path = $4;
313 auto = "yes";
314 autoup = "yes";
315 type = "pdir";
316 pri = "";
317
318 if (sub(",noauto", "", name)) {
319 auto = "no";
320 }
321
322 # process pri=\d+
323 if (match(name, /,pri=[0-9]+/)) {
324 pri = substr(name, RSTART + 5, RLENGTH - 5);
325 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
326 }
327
328 # skip ac sources. already in new config.
329 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
330 print "";
331 print "[source]";
332 print "name = " name;
333 print "type = " type;
334 print "path = " path;
335 print "auto = " auto;
336 print "autoup = " autoup;
337 if (pri) {
338 print "pri = " pri;
339 }
340 }
341
342 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
343 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
344
345 # copy hold=
346 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
347 if [ "$hold" ]; then
348 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
349 fi
350fi
351
352%triggerpostun -- poldek < 0.30-0.20080225.00.1
353if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
354 %{__sed} -i -e '/^%%include source.conf/{
355 a
356 a# /etc/poldek/repos.d/*.conf
357 a%%includedir repos.d
358 }' %{_sysconfdir}/%{name}/poldek.conf
359fi
360
361%{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
362%{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
363
364if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
365 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
366 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
367fi
368
369%ifarch %{x8664}
370if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
371 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
372 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
373fi
374%endif
375
376%files -f %{name}.lang
377%defattr(644,root,root,755)
378%doc README* NEWS TODO configs
379%dir %{_sysconfdir}/%{name}
380%dir %{_sysconfdir}/%{name}/repos.d
381%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
382%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
383%attr(755,root,root) %{_bindir}/*
384%dir %{_libdir}/%{name}
385%attr(755,root,root) %{_libdir}/%{name}/*
386%{_mandir}/man1/%{name}*
387%lang(pl) %{_mandir}/pl/man1/%{name}*
388%{_infodir}/poldek.info*
389%if %{with imode}
390%{_desktopdir}/%{name}.desktop
391%{_pixmapsdir}/%{name}.png
392%endif
393
394%if %{without static}
395%files libs
396%defattr(644,root,root,755)
397%attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
398%attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
399%attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
400%attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
401%attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
402%attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
403%attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
404%attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
405%attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
406%attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
407%endif
408
409%files devel
410%defattr(644,root,root,755)
411%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
412%{_libdir}/lib*.la
413%{_includedir}/*
414
415%files static
416%defattr(644,root,root,755)
417%{_libdir}/lib*.a
418
419%if %{with python}
420%files -n python-poldek
421%defattr(644,root,root,755)
422%attr(755,root,root) %{py_sitedir}/_poldekmod.so
423%{py_sitescriptdir}/poldek.py[co]
424%{py_sitescriptdir}/poldekmod.py[co]
425%endif
This page took 0.035943 seconds and 4 git commands to generate.