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