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