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