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