]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
- updated to 0.30rc2
[packages/poldek.git] / poldek.spec
1 # TODO:
2 # - fails to build without poldek-devel - fix it !
3 #
4 # Conditional build:
5 %bcond_with     static  # don't use shared libraries
6 %bcond_without  imode   # don't build interactive mode
7 %bcond_without  python  # don't build python bindings
8
9 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
10 %if "%{pld_release}" == "ti"
11 %define ver_db  4.5.20
12 %define ver_db_rel      8
13 %else
14 %define ver_db  4.7.25
15 %define ver_db_rel      1
16 %endif
17 %define ver_rpm 4.5-5
18
19 %define         snap    rc2
20 %define         rel     1
21 Summary:        RPM packages management helper tool
22 Summary(hu.UTF-8):      RPM csomagkezelést segítő eszköz
23 Summary(pl.UTF-8):      Pomocnicze narzędzie do zarządzania pakietami RPM
24 Name:           poldek
25 Version:        0.30
26 Release:        0.%{snap}.%{rel}
27 License:        GPL v2
28 Group:          Applications/System
29 #Source0:       http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
30 Source0:        http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}%{snap}.tar.bz2
31 # Source0-md5:  98806c2c6c8b5b840e7cfde6164fdeb4
32 Source1:        %{name}.conf
33 Source2:        %{name}-multilib.conf
34 Source3:        %{name}-ti.conf
35 Source4:        %{name}-multilib-ti.conf
36 Source5:        %{name}-aliases.conf
37 Source6:        %{name}.desktop
38 Source7:        %{name}.png
39 Source8:        %{name}-debuginfo.conf
40 Source9:        %{name}-aidath.conf
41 Source10:       %{name}-multilib-aidath.conf
42 Source11:       %{name}-archive.conf
43 Patch0:         %{name}-vserver-packages.patch
44 Patch1:         %{name}-config.patch
45 Patch2:         %{name}-size-type.patch
46 Patch3:         ac-prog-libtool.patch
47 URL:            http://poldek.pld-linux.org/
48 BuildRequires:  autoconf
49 BuildRequires:  automake
50 BuildRequires:  bzip2-devel
51 BuildRequires:  check-devel
52 BuildRequires:  db-devel >= %{ver_db}-%{ver_db_rel}
53 BuildRequires:  gettext-devel
54 BuildRequires:  libtool
55 BuildRequires:  libxml2-devel
56 BuildRequires:  openssl-devel >= 0.9.7d
57 BuildRequires:  pcre-devel
58 BuildRequires:  pkgconfig
59 BuildRequires:  popt-devel
60 %{?with_python:BuildRequires:   python-devel}
61 BuildRequires:  readline-devel >= 5.0
62 BuildRequires:  rpm-devel >= %{ver_rpm}
63 %{?with_python:BuildRequires:   rpm-pythonprov}
64 BuildRequires:  zlib-devel
65 %if %{with static}
66 BuildRequires:  bzip2-static
67 BuildRequires:  db-static >= %{ver_db}-%{ver_db_rel}
68 BuildRequires:  glibc-static
69 BuildRequires:  libselinux-static
70 BuildRequires:  libxml2-static
71 BuildRequires:  ncurses-static
72 BuildRequires:  openssl-static
73 BuildRequires:  pcre-static
74 BuildRequires:  popt-static
75 BuildRequires:  readline-static
76 BuildRequires:  rpm-static
77 BuildRequires:  zlib-static
78 %endif
79 Requires(triggerpostun):        awk
80 Requires(triggerpostun):        sed >= 4.0
81 Requires:       %{name}-libs = %{version}-%{release}
82 Requires:       db >= %{ver_db}-%{ver_db_rel}
83 Requires:       rpm >= %{ver_rpm}
84 Requires:       rpm-db-ver = %{ver_db}
85 Requires:       rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
86 # vf* scripts use sed
87 Requires:       sed
88 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
89
90 %description
91 poldek is an RPM package management tool which allows you to easily
92 perform package verification, installation (including system
93 installation from scratch), upgrading, and removal.
94
95 Program can be used in batch (like apt-get from Debian's APT) or
96 interactive mode. The interactive mode puts you into a readline
97 interface with command line autocompletion and history, similar to the
98 shell mode of Perl's CPAN.
99
100 %{?with_static:This version is statically linked.}
101
102 %{!?with_imode:This version hasn't got interactive mode.}
103 #'vim
104
105 %description -l hu.UTF-8
106 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
107 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
108 nulláról), frissítést és eltávolítást.
109
110 A program használható parancssorból (mint a Debian apt-get programja)
111 vagy interaktív módban. Az interaktív mód egy readline környezetet
112 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
113 shell módjához.
114
115 %{?with_static:Ez a verzió statikusan linkelt.}
116
117 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
118
119 %description -l pl.UTF-8
120 poldek jest narzędziem linii poleceń służącym do weryfikacji,
121 instalacji (włączając instalację systemu od zera), aktualizacji i
122 usuwania pakietów.
123
124 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
125 interaktywnym. Tryb interaktywny posiada interfejs readline z
126 dopełnianiem komend i historią, podobny do trybu shell perlowego
127 modułu CPAN.
128
129 %{?with_static:Ta wersja jest konsolidowana statycznie.}
130
131 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
132
133 %package libs
134 Summary:        poldek libraries
135 Summary(hu.UTF-8):      A poldek könyvtárai
136 Summary(pl.UTF-8):      Biblioteki poldka
137 Group:          Libraries
138
139 %description libs
140 poldek libraries.
141
142 %description libs -l hu.UTF-8
143 A poldek könyvtárai.
144
145 %description libs -l pl.UTF-8
146 Biblioteki poldka.
147
148 %package devel
149 Summary:        Header files for poldek libraries
150 Summary(hu.UTF-8):      A poldek könyvtár fejlesztői fájljai
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 hu.UTF-8
160 A poldek könyvtár fejlesztői fájljai.
161
162 %description devel -l pl.UTF-8
163 Pliki nagłówkowe bibliotek poldka.
164
165 %package static
166 Summary:        poldek static libraries
167 Summary(hu.UTF-8):      poldek statikus könyvtárak
168 Summary(pl.UTF-8):      Biblioteki statyczne poldka
169 Group:          Development/Libraries
170 Requires:       %{name}-devel = %{version}-%{release}
171
172 %description static
173 poldek static libraries.
174
175 %description static -l hu.UTF-8
176 poldek statikus könyvtárak.
177
178 %description static -l pl.UTF-8
179 Biblioteki statyczne poldka.
180
181 %package -n python-poldek
182 Summary:        Python modules for poldek
183 Summary(hu.UTF-8):      Python modulok poldek-hez
184 Summary(pl.UTF-8):      Moduły języka Python dla poldka
185 Group:          Libraries/Python
186 Requires:       %{name}-libs = %{version}-%{release}
187 %pyrequires_eq  python-libs
188
189 %description -n python-poldek
190 Python modules for poldek.
191
192 %description -n python-poldek -l hu.UTF-8
193 Python modulok poldek-hez.
194
195 %description -n python-poldek -l pl.UTF-8
196 Moduły języka Python dla poldka.
197
198 %prep
199 %setup -q
200 %patch0 -p1
201 %patch1 -p1
202 %patch2 -p1
203 %patch3 -p1
204
205 rm -f m4/libtool.m4 m4/lt*.m4
206
207 # cleanup backups after patching
208 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
209
210 %build
211 %{__libtoolize}
212 %{__aclocal} -I m4
213 %{__autoheader}
214 %{__autoconf}
215 %{__automake}
216 cp -f config.sub trurlib
217
218 CPPFLAGS="-std=gnu99"
219 %configure \
220         %{?with_static:--enable-static --disable-shared} \
221         %{!?with_imode:--disable-imode} \
222         --enable-nls \
223         %{?with_python:--with-python}
224 %{__make}
225 #       --enable-trace
226
227 %install
228 rm -rf $RPM_BUILD_ROOT
229 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
230
231 %{__make} install \
232         DESTDIR=$RPM_BUILD_ROOT
233
234 %if %{with python}
235 %{__make} -C python install \
236         DESTDIR=$RPM_BUILD_ROOT \
237         libdir=%{py_sitedir}
238 %endif
239
240 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
241
242 %ifarch i486 i686 ppc sparc alpha athlon
243         %define         _ftp_arch       %{_target_cpu}
244 %endif
245 %ifarch %{x8664}
246         %define         _ftp_arch       x86_64
247         %define         _ftp_alt_arch   i686
248 %endif
249 %ifarch i586
250         %if "%{pld_release}" == "ti"
251                 %define         _ftp_arch       i586
252         %else
253                 %define         _ftp_arch       i486
254         %endif
255 %endif
256 %ifarch pentium2 pentium3 pentium4
257         %define         _ftp_arch       i686
258 %endif
259 %ifarch sparcv9 sparc64
260         %define         _ftp_arch       sparc
261         %if "%{pld_release}" == "th"
262                 %define         _ftp_arch       %{_target_cpu}
263                 %ifarch sparc64
264                 %define         _ftp_alt_arch   sparcv9
265                 %endif
266         %endif
267 %endif
268
269 %if "%{pld_release}" == "ti"
270         %define pld_conf %{SOURCE3}
271         %ifarch %{x8664}
272                 %define pld_multilib_conf %{SOURCE4}
273         %endif
274 %endif
275
276 %if "%{pld_release}" == "th"
277         %define pld_conf %{SOURCE1}
278         %define pld_debuginfo_conf %{SOURCE8}
279         %define pld_archive_conf %{SOURCE11}
280
281         %ifarch %{x8664}
282                 %define pld_multilib_conf %{SOURCE2}
283         %endif
284
285         # aidath
286         %ifarch sparcv9 sparc64
287                 %define pld_conf %{SOURCE9}
288                 %undefine pld_archive_conf
289         %endif
290         %ifarch sparc64
291                 %define pld_multilib_conf %{SOURCE10}
292         %endif
293 %endif
294
295 sed -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
296
297 %if 0%{?pld_multilib_conf:1}
298         sed 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
299 %endif
300
301 %if 0%{?pld_debuginfo_conf:1}
302 sed -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
303 %endif
304
305 %if 0%{?pld_archive_conf:1}
306 sed -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf
307 %endif
308
309 cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
310
311 %if %{with imode}
312 # add desktop file and icon
313 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
314 cp -a %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
315 cp -a %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
316 %endif
317
318 # sources we don't package
319 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
320 # include them in %doc
321 rm -rf configs
322 cp -a conf configs
323 rm -f configs/Makefile*
324
325 %if %{with python}
326 %py_postclean
327 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
328 %endif
329
330 %find_lang %{name}
331
332 %clean
333 rm -rf $RPM_BUILD_ROOT
334
335 %post
336 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
337 if [ "$1" = "1" ]; then
338         # remove ignore = vserver-packages inside vserver on first install
339         {
340                 while read f ctx; do
341                         [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
342                 done </proc/self/status
343         } 2>/dev/null
344         if [ -z "$ctx" -o "$ctx" = "0" ]; then
345                 VSERVER=no
346         else
347                 VSERVER=yes
348         fi
349         if [ "$VSERVER" = "yes" ]; then
350                 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
351         fi
352 fi
353
354 %postun -p      /sbin/postshell
355 -/usr/sbin/fix-info-dir -c %{_infodir}
356
357 %post   libs -p /sbin/ldconfig
358 %postun libs -p /sbin/ldconfig
359
360 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
361 if [ -f /etc/poldek.conf.rpmsave ]; then
362         awk '/^source/ {
363         name = $3;
364         path = $4;
365         auto = "yes";
366         autoup = "yes";
367         type = "pdir";
368         pri = "";
369
370         if (sub(",noauto", "", name)) {
371                 auto = "no";
372         }
373
374         # process pri=\d+
375         if (match(name, /,pri=[0-9]+/)) {
376                 pri = substr(name, RSTART + 5, RLENGTH - 5);
377                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
378         }
379
380         # skip ac sources. already in new config.
381         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
382                 print "";
383                 print "[source]";
384                 print "name = " name;
385                 print "type = " type;
386                 print "path = " path;
387                 print "auto = " auto;
388                 print "autoup = " autoup;
389                 if (pri) {
390                         print "pri = " pri;
391                 }
392         }
393
394         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
395         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
396
397         # copy hold=
398         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
399         if [ "$hold" ]; then
400                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
401         fi
402 fi
403
404 %triggerpostun -- poldek < 0.30-0.20080225.00.1
405 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
406         %{__sed} -i -e '/^%%include source.conf/{
407                 a
408                 a# /etc/poldek/repos.d/*.conf
409                 a%%includedir repos.d
410         }' %{_sysconfdir}/%{name}/poldek.conf
411 fi
412
413 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
414 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
415
416 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
417         cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
418         cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
419 fi
420
421 %ifarch %{x8664}
422 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
423         cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
424         cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
425 fi
426 %endif
427
428 %files -f %{name}.lang
429 %defattr(644,root,root,755)
430 %doc ChangeLog README* NEWS TODO configs
431 %dir %{_sysconfdir}/%{name}
432 %dir %{_sysconfdir}/%{name}/repos.d
433 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
434 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
435 %attr(755,root,root) %{_bindir}/*
436 %dir %{_libdir}/%{name}
437 %attr(755,root,root) %{_libdir}/%{name}/*
438 %{_mandir}/man1/%{name}*
439 %lang(pl) %{_mandir}/pl/man1/%{name}*
440 %{_infodir}/poldek.info*
441 %if %{with imode}
442 %{_desktopdir}/%{name}.desktop
443 %{_pixmapsdir}/%{name}.png
444 %endif
445
446 %if %{without static}
447 %files libs
448 %defattr(644,root,root,755)
449 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
450 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
451 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
452 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
453 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
454 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
455 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
456 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
457 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
458 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
459 %endif
460
461 %files devel
462 %defattr(644,root,root,755)
463 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
464 %{_libdir}/lib*.la
465 %{_includedir}/*
466
467 %files static
468 %defattr(644,root,root,755)
469 %{_libdir}/lib*.a
470
471 %if %{with python}
472 %files -n python-poldek
473 %defattr(644,root,root,755)
474 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
475 %{py_sitescriptdir}/poldek.py[co]
476 %{py_sitescriptdir}/poldekmod.py[co]
477 %endif
This page took 0.181646 seconds and 4 git commands to generate.