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