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