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