]>
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 AM |
11 | %define snap 20080225.00 |
12 | %define rel 0.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 |
24ad8b8d AM |
20 | Source0: %{name}-%{version}-cvs%{snap}.tar.bz2 |
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 | |
29 | Patch3: %{name}-multilib.patch | |
39ca2371 | 30 | URL: http://poldek.pld-linux.org/ |
a4268952 | 31 | BuildRequires: autoconf |
b25cb9a7 | 32 | BuildRequires: automake |
373c6f03 | 33 | BuildRequires: bzip2-devel |
b25cb9a7 | 34 | BuildRequires: check |
b1928c7a | 35 | BuildRequires: db-devel >= %{ver_db} |
c0d8905a | 36 | BuildRequires: gettext-autopoint |
b25cb9a7 JB |
37 | BuildRequires: libtool |
38 | BuildRequires: libxml2-devel | |
cbc6f56b | 39 | BuildRequires: openssl-devel >= 0.9.7d |
13fd950e | 40 | BuildRequires: pcre-devel |
f373d903 | 41 | BuildRequires: perl-tools-pod |
b3ea4b51 | 42 | BuildRequires: pkgconfig |
13fd950e | 43 | BuildRequires: popt-devel |
58c31de0 | 44 | %{?with_python:BuildRequires: python-devel} |
b25cb9a7 | 45 | BuildRequires: readline-devel >= 5.0 |
373c6f03 | 46 | BuildRequires: rpm-devel >= %{ver_rpm} |
300927eb | 47 | %{?with_python:BuildRequires: rpm-pythonprov} |
282cfaec | 48 | BuildRequires: xmlto |
96475e5e | 49 | BuildRequires: zlib-devel |
373c6f03 JB |
50 | %if %{with static} |
51 | BuildRequires: bzip2-static | |
b1928c7a | 52 | BuildRequires: db-static >= %{ver_db} |
2fac0b02 | 53 | BuildRequires: glibc-static |
acb26797 | 54 | BuildRequires: libselinux-static |
b25cb9a7 | 55 | BuildRequires: libxml2-static |
373c6f03 JB |
56 | BuildRequires: ncurses-static |
57 | BuildRequires: openssl-static | |
58 | BuildRequires: pcre-static | |
59 | BuildRequires: popt-static | |
60 | BuildRequires: readline-static | |
61 | BuildRequires: rpm-static | |
62 | BuildRequires: zlib-static | |
373c6f03 | 63 | %endif |
b25cb9a7 | 64 | Requires(triggerpostun): awk |
168acc54 | 65 | Requires(triggerpostun): sed >= 4.0 |
09d4c571 | 66 | Requires: %{name}-libs = %{version}-%{release} |
b1928c7a | 67 | Requires: db >= %{ver_db} |
373c6f03 | 68 | Requires: rpm >= %{ver_rpm} |
78b0cd64 | 69 | Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib) |
e202a52a ER |
70 | # vf* scripts use sed |
71 | Requires: sed | |
b44549bf | 72 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
73 | ||
74 | %description | |
0fa0dc36 | 75 | poldek is an RPM package management tool which allows you to easily |
76 | perform package verification, installation (including system | |
13fd950e | 77 | installation from scratch), upgrading, and removal. |
0fa0dc36 | 78 | |
13fd950e JB |
79 | Program can be used in batch (like apt-get from Debian's APT) or |
80 | interactive mode. The interactive mode puts you into a readline | |
81 | interface with command line autocompletion and history, similar to the | |
82 | shell mode of Perl's CPAN. | |
8efee472 | 83 | |
9fe14a3f | 84 | %{?with_static:This version is statically linked.} |
d94b28a6 | 85 | |
9fe14a3f | 86 | %{!?with_imode:This version hasn't got interactive mode.} |
7f07e487 | 87 | #'vim |
1f84648f | 88 | |
caed9b36 JR |
89 | %description -l pl.UTF-8 |
90 | poldek jest narzędziem linii poleceń służącym do weryfikacji, | |
91 | instalacji (włączając instalację systemu od zera), aktualizacji i | |
92 | usuwania pakietów. | |
56e1ab51 | 93 | |
caed9b36 | 94 | Program może być używany w trybie wsadowym (jak debianowy apt-get) lub |
d82a9cb2 | 95 | interaktywnym. Tryb interaktywny posiada interfejs readline z |
caed9b36 JR |
96 | dopełnianiem komend i historią, podobny do trybu shell perlowego |
97 | modułu CPAN. | |
8efee472 | 98 | |
9fe14a3f | 99 | %{?with_static:Ta wersja jest konsolidowana statycznie.} |
a611e0bc | 100 | |
9fe14a3f | 101 | %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.} |
b44549bf | 102 | |
b25cb9a7 | 103 | %package libs |
168acc54 | 104 | Summary: poldek libraries |
9faf625a | 105 | Summary(pl.UTF-8): Biblioteki poldka |
168acc54 | 106 | Group: Libraries |
b25cb9a7 JB |
107 | |
108 | %description libs | |
109 | poldek libraries. | |
110 | ||
caed9b36 | 111 | %description libs -l pl.UTF-8 |
b25cb9a7 JB |
112 | Biblioteki poldka. |
113 | ||
114 | %package devel | |
168acc54 | 115 | Summary: Header files for poldek libraries |
9faf625a | 116 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka |
168acc54 | 117 | Group: Development/Libraries |
09d4c571 | 118 | Requires: %{name}-libs = %{version}-%{release} |
b25cb9a7 JB |
119 | |
120 | %description devel | |
121 | Header files for poldek libraries. | |
122 | ||
caed9b36 JR |
123 | %description devel -l pl.UTF-8 |
124 | Pliki nagłówkowe bibliotek poldka. | |
b25cb9a7 JB |
125 | |
126 | %package static | |
168acc54 | 127 | Summary: poldek static libraries |
9faf625a | 128 | Summary(pl.UTF-8): Biblioteki statyczne poldka |
168acc54 | 129 | Group: Development/Libraries |
09d4c571 | 130 | Requires: %{name}-devel = %{version}-%{release} |
b25cb9a7 JB |
131 | |
132 | %description static | |
133 | poldek static libraries. | |
134 | ||
caed9b36 | 135 | %description static -l pl.UTF-8 |
b25cb9a7 JB |
136 | Biblioteki statyczne poldka. |
137 | ||
58c31de0 JB |
138 | %package -n python-poldek |
139 | Summary: Python modules for poldek | |
9faf625a | 140 | Summary(pl.UTF-8): Moduły języka Python dla poldka |
58c31de0 JB |
141 | Group: Libraries/Python |
142 | Requires: %{name}-libs = %{version}-%{release} | |
143 | %pyrequires_eq python-libs | |
144 | ||
145 | %description -n python-poldek | |
146 | Python modules for poldek. | |
147 | ||
caed9b36 JR |
148 | %description -n python-poldek -l pl.UTF-8 |
149 | Moduły języka Python dla poldka. | |
58c31de0 | 150 | |
03159b71 | 151 | %prep |
78b0cd64 | 152 | %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}} |
13aa6434 AM |
153 | %patch1 -p1 |
154 | %patch2 -p1 | |
3375120c | 155 | %ifarch %{x8664} |
13aa6434 | 156 | %patch3 -p1 |
3375120c | 157 | %endif |
b44549bf | 158 | |
0579f9b7 ER |
159 | # cleanup backups after patching |
160 | find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
161 | ||
b44549bf | 162 | %build |
df3bea74 | 163 | %{__autopoint} |
21a83253 MM |
164 | %{__aclocal} -I m4 |
165 | %{__autoconf} | |
166 | %{__automake} | |
63bd61a7 | 167 | cp -f config.sub trurlib |
b25cb9a7 | 168 | |
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 | |
23749bce | 178 | install -d $RPM_BUILD_ROOT%{_sysconfdir} |
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} |
193 | %else | |
9639596f | 194 | %ifarch %{x8664} |
590302c4 | 195 | %define _ftp_arch x86_64 |
b25cb9a7 JB |
196 | %define _ftp_alt_arch i686 |
197 | %else | |
9639596f PS |
198 | %ifarch i586 |
199 | %define _ftp_arch i486 | |
a49836bb | 200 | %else |
201 | %ifarch pentium2 pentium3 pentium4 | |
202 | %define _ftp_arch i686 | |
203 | %else | |
204 | %ifarch sparcv9 sparc64 | |
205 | %define _ftp_arch sparc | |
206 | %endif | |
207 | %endif | |
208 | %endif | |
209 | %endif | |
b25cb9a7 | 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 | |
216 | ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf | |
b44549bf | 217 | |
590302c4 | 218 | %ifarch %{x8664} |
7adf66ff ER |
219 | sed ' |
220 | s|%%ARCH%%|%{_ftp_alt_arch}|g | |
221 | ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.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 | ||
b25cb9a7 JB |
233 | # get rid of non-pld sources |
234 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf | |
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 | ||
767366b0 | 303 | %files -f %{name}.lang |
b44549bf | 304 | %defattr(644,root,root,755) |
b25cb9a7 JB |
305 | %doc README* NEWS TODO configs/ |
306 | %dir %{_sysconfdir}/%{name} | |
168acc54 | 307 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf |
8efee472 | 308 | %attr(755,root,root) %{_bindir}/* |
b25cb9a7 JB |
309 | %dir %{_libdir}/%{name} |
310 | %attr(755,root,root) %{_libdir}/%{name}/* | |
b44549bf | 311 | %{_mandir}/man1/%{name}* |
d8826405 | 312 | %lang(pl) %{_mandir}/pl/man1/%{name}* |
b25cb9a7 | 313 | %{_infodir}/poldek.info* |
9e6ff4ef | 314 | %if %{with imode} |
315 | %{_desktopdir}/%{name}.desktop | |
316 | %{_pixmapsdir}/%{name}.png | |
317 | %endif | |
b25cb9a7 | 318 | |
f8c7c6b5 | 319 | %if !%{with static} |
b25cb9a7 JB |
320 | %files libs |
321 | %defattr(644,root,root,755) | |
322 | %attr(755,root,root) %{_libdir}/lib*.so.*.*.* | |
323 | %endif | |
324 | ||
325 | %files devel | |
326 | %defattr(644,root,root,755) | |
327 | %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so} | |
328 | %{_libdir}/lib*.la | |
329 | %{_includedir}/* | |
330 | ||
331 | %files static | |
332 | %defattr(644,root,root,755) | |
333 | %{_libdir}/lib*.a | |
58c31de0 JB |
334 | |
335 | %if %{with python} | |
336 | %files -n python-poldek | |
337 | %defattr(644,root,root,755) | |
338 | %attr(755,root,root) %{py_sitedir}/_poldekmod.so | |
339 | %{py_sitescriptdir}/poldek.py[co] | |
340 | %{py_sitescriptdir}/poldekmod.py[co] | |
341 | %endif |