]>
Commit | Line | Data |
---|---|---|
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 | 11 | Summary: RPM packages management helper tool |
12 | Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM | |
13 | Name: poldek | |
ac5b976e | 14 | Version: 0.21 |
dd5c3473 | 15 | Release: 0.%{snap}.%{rel} |
a7d09531 | 16 | License: GPL v2 |
17 | Group: Applications/System | |
dd5c3473 | 18 | Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2 |
55fcd157 | 19 | # Source0-md5: dae23dec560fad954abf157fd250e4c3 |
a7d09531 | 20 | Source1: %{name}.conf |
21 | Source2: %{name}-multilib.conf | |
22 | Source3: %{name}-aliases.conf | |
83b5d2fc ER |
23 | Source4: %{name}.desktop |
24 | Source5: %{name}.png | |
25 | Patch0: %{name}-dirdeps.patch | |
a7d09531 | 26 | Patch1: %{name}-vserver-packages.patch |
27 | Patch2: %{name}-config.patch | |
28 | Patch3: %{name}-multilib.patch | |
9e651e85 | 29 | Patch4: %{name}-ndie_fix.patch |
a6fe12ac ER |
30 | Patch5: %{name}-uri-escape-fix.patch |
31 | Patch6: %{name}-install-dist.patch | |
32 | Patch7: %{name}-nohold-fix.patch | |
b2dde539 | 33 | Patch8: %{name}-dir-dot.patch |
56b258f4 | 34 | Patch9: %{name}-suggests-one-package.patch |
83b5d2fc | 35 | Patch10: %{name}-reversed-prompt.patch |
c9c8dd0b | 36 | Patch11: %{name}-abort-on-upgrade.patch |
3b7a1c4a | 37 | Patch12: %{name}-nonoorder.patch |
b9033c27 | 38 | Patch13: %{name}-bug-79.patch |
a7d09531 | 39 | URL: http://poldek.pld-linux.org/ |
40 | BuildRequires: autoconf | |
41 | BuildRequires: automake | |
42 | BuildRequires: bzip2-devel | |
43 | BuildRequires: check | |
44 | BuildRequires: db-devel >= %{ver_db} | |
45 | BuildRequires: gettext-autopoint | |
46 | BuildRequires: libtool | |
47 | BuildRequires: libxml2-devel | |
48 | BuildRequires: openssl-devel >= 0.9.7d | |
49 | BuildRequires: pcre-devel | |
50 | BuildRequires: perl-tools-pod | |
bdba0a51 | 51 | BuildRequires: pkgconfig |
a7d09531 | 52 | BuildRequires: popt-devel |
53 | %{?with_python:BuildRequires: python-devel} | |
54 | BuildRequires: readline-devel >= 5.0 | |
55 | BuildRequires: rpm-devel >= %{ver_rpm} | |
56 | %{?with_python:BuildRequires: rpm-pythonprov} | |
57 | BuildRequires: sed >= 4.0 | |
58 | BuildRequires: xmlto | |
59 | BuildRequires: zlib-devel | |
60 | %if %{with static} | |
61 | BuildRequires: bzip2-static | |
62 | BuildRequires: db-static >= %{ver_db} | |
63 | BuildRequires: glibc-static | |
64 | BuildRequires: libselinux-static | |
65 | BuildRequires: libxml2-static | |
66 | BuildRequires: ncurses-static | |
67 | BuildRequires: openssl-static | |
68 | BuildRequires: pcre-static | |
69 | BuildRequires: popt-static | |
70 | BuildRequires: readline-static | |
71 | BuildRequires: rpm-static | |
72 | BuildRequires: zlib-static | |
73 | %endif | |
74 | Requires(triggerpostun): awk | |
75 | Requires(triggerpostun): sed >= 4.0 | |
76 | Requires: %{name}-libs = %{version}-%{release} | |
77 | Requires: db >= %{ver_db} | |
78 | Requires: openssl >= 0.9.7d | |
79 | Requires: rpm >= %{ver_rpm} | |
7fe46a22 | 80 | Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib) |
dd48d890 ER |
81 | # vf* scripts use sed |
82 | Requires: sed | |
a7d09531 | 83 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
84 | ||
85 | %description | |
86 | poldek is an RPM package management tool which allows you to easily | |
87 | perform package verification, installation (including system | |
88 | installation from scratch), upgrading, and removal. | |
89 | ||
90 | Program can be used in batch (like apt-get from Debian's APT) or | |
91 | interactive mode. The interactive mode puts you into a readline | |
92 | interface with command line autocompletion and history, similar to the | |
93 | shell 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 | |
101 | poldek jest narzędziem linii poleceń służącym do weryfikacji, | |
102 | instalacji (włączając instalację systemu od zera), aktualizacji i | |
103 | usuwania pakietów. | |
104 | ||
105 | Program może być używany w trybie wsadowym (jak debianowy apt-get) lub | |
106 | interaktywnym. Tryb interaktywny posiada interfejs readline z | |
107 | dopełnianiem komend i historią, podobny do trybu shell perlowego | |
108 | moduł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 | |
115 | Summary: poldek libraries | |
116 | Summary(pl.UTF-8): Biblioteki poldka | |
117 | Group: Libraries | |
118 | ||
119 | %description libs | |
120 | poldek libraries. | |
121 | ||
122 | %description libs -l pl.UTF-8 | |
123 | Biblioteki poldka. | |
124 | ||
125 | %package devel | |
126 | Summary: Header files for poldek libraries | |
127 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka | |
128 | Group: Development/Libraries | |
129 | Requires: %{name}-libs = %{version}-%{release} | |
130 | ||
131 | %description devel | |
132 | Header files for poldek libraries. | |
133 | ||
134 | %description devel -l pl.UTF-8 | |
135 | Pliki nagłówkowe bibliotek poldka. | |
136 | ||
137 | %package static | |
138 | Summary: poldek static libraries | |
139 | Summary(pl.UTF-8): Biblioteki statyczne poldka | |
140 | Group: Development/Libraries | |
141 | Requires: %{name}-devel = %{version}-%{release} | |
142 | ||
143 | %description static | |
144 | poldek static libraries. | |
145 | ||
146 | %description static -l pl.UTF-8 | |
147 | Biblioteki statyczne poldka. | |
148 | ||
149 | %package -n python-poldek | |
150 | Summary: Python modules for poldek | |
151 | Summary(pl.UTF-8): Moduły języka Python dla poldka | |
152 | Group: Libraries/Python | |
153 | Requires: %{name}-libs = %{version}-%{release} | |
154 | %pyrequires_eq python-libs | |
155 | ||
156 | %description -n python-poldek | |
157 | Python modules for poldek. | |
158 | ||
159 | %description -n python-poldek -l pl.UTF-8 | |
160 | Moduł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 |
182 | find . '(' -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} | |
189 | cp -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 | |
199 | rm -rf $RPM_BUILD_ROOT | |
b9033c27 | 200 | install -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 | ||
236 | sed -e ' | |
237 | s|%%ARCH%%|%{_ftp_arch}|g | |
238 | ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf | |
239 | ||
240 | %ifarch %{x8664} | |
241 | sed ' | |
242 | s|%%ARCH%%|%{_ftp_alt_arch}|g | |
243 | ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf | |
244 | %endif | |
245 | ||
246 | install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf | |
247 | ||
83b5d2fc ER |
248 | %if %{with imode} |
249 | # add desktop file and icon | |
250 | install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}} | |
251 | install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop | |
252 | install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png | |
253 | %endif | |
254 | ||
a7d09531 | 255 | # get rid of non-pld sources |
b9033c27 | 256 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf |
a7d09531 | 257 | # include them in %doc |
258 | rm -rf configs | |
259 | cp -a conf configs | |
260 | rm -f configs/Makefile* | |
261 | ||
262 | %if %{with python} | |
263 | %py_postclean | |
264 | rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la | |
265 | %endif | |
266 | ||
267 | %find_lang %{name} | |
268 | ||
269 | %clean | |
270 | rm -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 |
282 | if [ -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 | |
323 | fi | |
324 | ||
b9033c27 | 325 | %triggerpostun -- poldek < 0.21-0.20070703.00.15.7 |
7a9723a5 ER |
326 | if ! 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 |
332 | fi | |
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 |