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