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