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