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