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