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