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