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