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