]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
- added R: rpm-devel for poldek-devel
[packages/poldek.git] / poldek.spec
1 #
2 # Conditional build:
3 %bcond_with     static  # don't use shared libraries
4 %bcond_without  imode   # don't build interactive mode
5 %bcond_without  python  # don't build python bindings
6 #
7 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
8 %if "%{pld_release}" == "ti"
9 %define ver_db  4.5.20
10 %define ver_db_rel      8
11 %else
12 %define ver_db  4.7.25
13 %define ver_db_rel      1
14 %endif
15 %define ver_rpm 4.5-5
16 #
17 %define         snap    20080820.23
18 %define         rel             26
19 Summary:        RPM packages management helper tool
20 Summary(pl.UTF-8):      Pomocnicze narzędzie do zarządzania pakietami RPM
21 Name:           poldek
22 Version:        0.30
23 Release:        0.%{snap}.%{rel}
24 License:        GPL v2
25 Group:          Applications/System
26 #Source0:       http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
27 Source0:        http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}-cvs%{snap}.tar.bz2
28 # Source0-md5:  2738eb3996f1cdf1e5d74b913d6e7414
29 Source1:        %{name}.conf
30 Source2:        %{name}-multilib.conf
31 Source3:        %{name}-ti.conf
32 Source4:        %{name}-multilib-ti.conf
33 Source5:        %{name}-aliases.conf
34 Source6:        %{name}.desktop
35 Source7:        %{name}.png
36 Patch0:         %{name}-vserver-packages.patch
37 Patch1:         %{name}-config.patch
38 Patch2:         %{name}-abort-on-upgrade.patch
39 Patch3:         %{name}-inline.patch
40 Patch4:         %{name}-ls-llu.patch
41 Patch5:         %{name}-op-ldalldesc.patch
42 Patch6:         %{name}-nocolor-upgrade.patch
43 Patch7:         %{name}-upgrade-dist.patch
44 Patch8:         %{name}-keep-reinstalled-provides.patch
45 Patch9:         %{name}-dont-ask-for-suggests-on-errors.patch
46 Patch10:        %{name}-crash-on-invalid-locale.patch
47 Patch11:        %{name}-noutf8.patch
48 Patch12:        %{name}-dont-suggests-required-packages.patch
49 Patch13:        %{name}-tty-for-erasures.patch
50 Patch14:        %{name}-both_langs.patch
51 Patch15:        %{name}-317130.patch
52 Patch16:        %{name}-321546.patch
53 Patch17:        %{name}-size-type.patch
54 Patch18:        %{name}-no-inlines.patch
55 Patch19:        %{name}-export-missing-symbol.patch
56 Patch20:        %{name}-skip-suggests-on-upgrade.patch
57 Patch21:        %{name}-po.patch
58 Patch22:        %{name}-refcnt.patch
59 Patch23:        %{name}-assertion-failed.patch
60 URL:            http://poldek.pld-linux.org/
61 BuildRequires:  autoconf
62 BuildRequires:  automake
63 BuildRequires:  bzip2-devel
64 BuildRequires:  check
65 BuildRequires:  db-devel >= %{ver_db}-%{ver_db_rel}
66 BuildRequires:  gettext-autopoint
67 BuildRequires:  libtool
68 BuildRequires:  libxml2-devel
69 BuildRequires:  openssl-devel >= 0.9.7d
70 BuildRequires:  pcre-devel
71 BuildRequires:  perl-tools-pod
72 BuildRequires:  pkgconfig
73 BuildRequires:  popt-devel
74 %{?with_python:BuildRequires:   python-devel}
75 BuildRequires:  readline-devel >= 5.0
76 BuildRequires:  rpm-devel >= %{ver_rpm}
77 %{?with_python:BuildRequires:   rpm-pythonprov}
78 BuildRequires:  xmlto
79 BuildRequires:  zlib-devel
80 %if %{with static}
81 BuildRequires:  bzip2-static
82 BuildRequires:  db-static >= %{ver_db}-%{ver_db_rel}
83 BuildRequires:  glibc-static
84 BuildRequires:  libselinux-static
85 BuildRequires:  libxml2-static
86 BuildRequires:  ncurses-static
87 BuildRequires:  openssl-static
88 BuildRequires:  pcre-static
89 BuildRequires:  popt-static
90 BuildRequires:  readline-static
91 BuildRequires:  rpm-static
92 BuildRequires:  zlib-static
93 %endif
94 Requires(triggerpostun):        awk
95 Requires(triggerpostun):        sed >= 4.0
96 Requires:       %{name}-libs = %{version}-%{release}
97 Requires:       db >= %{ver_db}-%{ver_db_rel}
98 Requires:       rpm >= %{ver_rpm}
99 Requires:       rpm-db-ver = %{ver_db}
100 Requires:       rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
101 # vf* scripts use sed
102 Requires:       sed
103 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
104
105 %description
106 poldek is an RPM package management tool which allows you to easily
107 perform package verification, installation (including system
108 installation from scratch), upgrading, and removal.
109
110 Program can be used in batch (like apt-get from Debian's APT) or
111 interactive mode. The interactive mode puts you into a readline
112 interface with command line autocompletion and history, similar to the
113 shell mode of Perl's CPAN.
114
115 %{?with_static:This version is statically linked.}
116
117 %{!?with_imode:This version hasn't got interactive mode.}
118 #'vim
119
120 %description -l pl.UTF-8
121 poldek jest narzędziem linii poleceń służącym do weryfikacji,
122 instalacji (włączając instalację systemu od zera), aktualizacji i
123 usuwania pakietów.
124
125 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
126 interaktywnym. Tryb interaktywny posiada interfejs readline z
127 dopełnianiem komend i historią, podobny do trybu shell perlowego
128 modułu CPAN.
129
130 %{?with_static:Ta wersja jest konsolidowana statycznie.}
131
132 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
133
134 %package libs
135 Summary:        poldek libraries
136 Summary(pl.UTF-8):      Biblioteki poldka
137 Group:          Libraries
138
139 %description libs
140 poldek libraries.
141
142 %description libs -l pl.UTF-8
143 Biblioteki poldka.
144
145 %package devel
146 Summary:        Header files for poldek libraries
147 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek poldka
148 Group:          Development/Libraries
149 Requires:       %{name}-libs = %{version}-%{release}
150 Requires:       rpm-devel >= %{ver_rpm}
151
152 %description devel
153 Header files for poldek libraries.
154
155 %description devel -l pl.UTF-8
156 Pliki nagłówkowe bibliotek poldka.
157
158 %package static
159 Summary:        poldek static libraries
160 Summary(pl.UTF-8):      Biblioteki statyczne poldka
161 Group:          Development/Libraries
162 Requires:       %{name}-devel = %{version}-%{release}
163
164 %description static
165 poldek static libraries.
166
167 %description static -l pl.UTF-8
168 Biblioteki statyczne poldka.
169
170 %package -n python-poldek
171 Summary:        Python modules for poldek
172 Summary(pl.UTF-8):      Moduły języka Python dla poldka
173 Group:          Libraries/Python
174 Requires:       %{name}-libs = %{version}-%{release}
175 %pyrequires_eq  python-libs
176
177 %description -n python-poldek
178 Python modules for poldek.
179
180 %description -n python-poldek -l pl.UTF-8
181 Moduły języka Python dla poldka.
182
183 %prep
184 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
185 %patch0 -p1
186 %patch1 -p1
187 %patch2 -p1
188 %patch3 -p1
189 %patch4 -p1
190 %patch5 -p1
191 %patch6 -p0
192 %patch7 -p0
193 %patch8 -p0
194 %patch9 -p0
195 %patch10 -p1
196 %patch11 -p1
197 %patch12 -p1
198 %patch13 -p1
199 %patch14 -p1
200 %patch15 -p1
201 %patch16 -p1
202 %patch17 -p1
203 %patch18 -p1
204 %patch19 -p0
205 %patch20 -p1
206 %patch21 -p1
207 %patch22 -p0
208 %patch23 -p1
209
210 # cleanup backups after patching
211 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
212
213 %build
214 %{__libtoolize}
215 %{__aclocal} -I m4
216 %{__autoconf}
217 %{__automake}
218 cp -f config.sub trurlib
219
220 CPPFLAGS="-std=gnu99"
221 %configure \
222         %{?with_static:--enable-static --disable-shared} \
223         %{!?with_imode:--disable-imode} \
224         --enable-nls \
225         %{?with_python:--with-python}
226 %{__make}
227
228 %install
229 rm -rf $RPM_BUILD_ROOT
230 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
231
232 %{__make} install \
233         DESTDIR=$RPM_BUILD_ROOT
234
235 %if %{with python}
236 %{__make} -C python install \
237         DESTDIR=$RPM_BUILD_ROOT \
238         libdir=%{py_sitedir}
239 %endif
240
241 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
242
243 %ifarch i486 i686 ppc sparc alpha athlon
244 %define         _ftp_arch       %{_target_cpu}
245 %endif
246 %ifarch %{x8664}
247 %define         _ftp_arch       x86_64
248 %define         _ftp_alt_arch   i686
249 %endif
250 %ifarch i586
251 %if "%{pld_release}" == "ti"
252 %define         _ftp_arch       i586
253 %else
254 %define         _ftp_arch       i486
255 %endif
256 %endif
257 %ifarch pentium2 pentium3 pentium4
258 %define         _ftp_arch       i686
259 %endif
260 %ifarch sparcv9 sparc64
261 %define         _ftp_arch       sparc
262 %endif
263
264 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
265
266 %if "%{pld_release}" == "ti"
267 sed -e '
268         s|%%ARCH%%|%{_ftp_arch}|g
269 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
270
271 %ifarch %{x8664}
272 sed '
273         s|%%ARCH%%|%{_ftp_alt_arch}|g
274 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
275 %endif
276 %else
277 sed -e '
278         s|%%ARCH%%|%{_ftp_arch}|g
279 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
280
281 %ifarch %{x8664}
282 sed '
283         s|%%ARCH%%|%{_ftp_alt_arch}|g
284 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
285 %endif
286 %endif
287
288 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
289
290 %if %{with imode}
291 # add desktop file and icon
292 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
293 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
294 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
295 %endif
296
297 # sources we don't package
298 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
299 # include them in %doc
300 rm -rf configs
301 cp -a conf configs
302 rm -f configs/Makefile*
303
304 %if %{with python}
305 %py_postclean
306 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
307 %endif
308
309 %find_lang %{name}
310
311 %clean
312 rm -rf $RPM_BUILD_ROOT
313
314 %post   -p      /sbin/postshell
315 -/usr/sbin/fix-info-dir -c %{_infodir}
316
317 %postun -p      /sbin/postshell
318 -/usr/sbin/fix-info-dir -c %{_infodir}
319
320 %post   libs -p /sbin/ldconfig
321 %postun libs -p /sbin/ldconfig
322
323 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
324 if [ -f /etc/poldek.conf.rpmsave ]; then
325         awk '/^source/ {
326         name = $3;
327         path = $4;
328         auto = "yes";
329         autoup = "yes";
330         type = "pdir";
331         pri = "";
332
333         if (sub(",noauto", "", name)) {
334                 auto = "no";
335         }
336
337         # process pri=\d+
338         if (match(name, /,pri=[0-9]+/)) {
339                 pri = substr(name, RSTART + 5, RLENGTH - 5);
340                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
341         }
342
343         # skip ac sources. already in new config.
344         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
345                 print "";
346                 print "[source]";
347                 print "name = " name;
348                 print "type = " type;
349                 print "path = " path;
350                 print "auto = " auto;
351                 print "autoup = " autoup;
352                 if (pri) {
353                         print "pri = " pri;
354                 }
355         }
356
357         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
358         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
359
360         # copy hold=
361         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
362         if [ "$hold" ]; then
363                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
364         fi
365 fi
366
367 %triggerpostun -- poldek < 0.30-0.20080225.00.1
368 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
369         %{__sed} -i -e '/^%%include source.conf/{
370                 a
371                 a# /etc/poldek/repos.d/*.conf
372                 a%%includedir repos.d
373         }' %{_sysconfdir}/%{name}/poldek.conf
374 fi
375
376 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
377 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
378
379 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
380         cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
381         cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
382 fi
383
384 %ifarch %{x8664}
385 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
386         cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
387         cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
388 fi
389 %endif
390
391 %files -f %{name}.lang
392 %defattr(644,root,root,755)
393 %doc README* NEWS TODO configs
394 %dir %{_sysconfdir}/%{name}
395 %dir %{_sysconfdir}/%{name}/repos.d
396 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
397 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
398 %attr(755,root,root) %{_bindir}/*
399 %dir %{_libdir}/%{name}
400 %attr(755,root,root) %{_libdir}/%{name}/*
401 %{_mandir}/man1/%{name}*
402 %lang(pl) %{_mandir}/pl/man1/%{name}*
403 %{_infodir}/poldek.info*
404 %if %{with imode}
405 %{_desktopdir}/%{name}.desktop
406 %{_pixmapsdir}/%{name}.png
407 %endif
408
409 %if %{without static}
410 %files libs
411 %defattr(644,root,root,755)
412 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
413 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
414 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
415 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
416 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
417 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
418 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
419 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
420 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
421 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
422 %endif
423
424 %files devel
425 %defattr(644,root,root,755)
426 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
427 %{_libdir}/lib*.la
428 %{_includedir}/*
429
430 %files static
431 %defattr(644,root,root,755)
432 %{_libdir}/lib*.a
433
434 %if %{with python}
435 %files -n python-poldek
436 %defattr(644,root,root,755)
437 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
438 %{py_sitescriptdir}/poldek.py[co]
439 %{py_sitescriptdir}/poldekmod.py[co]
440 %endif
This page took 0.068608 seconds and 3 git commands to generate.