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