]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
This commit was manufactured by cvs2git to create tag 'auto-ac-poldek-
[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 %define ver_db  4.5.20
11 %define ver_rpm 4.5-49
12
13 %define         snap    rc2
14 %define         rel             4%{pld_release}
15 Summary:        RPM packages management helper tool
16 Summary(hu.UTF-8):      RPM csomagkezelést segítő eszköz
17 Summary(pl.UTF-8):      Pomocnicze narzędzie do zarządzania pakietami RPM
18 Name:           poldek
19 Version:        0.30
20 Release:        0.%{snap}.%{rel}
21 License:        GPL v2
22 Group:          Applications/System
23 #Source0:       http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
24 #Source0:       http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}%{snap}.tar.bz2
25 Source0:        http://carme.pld-linux.org/~cactus/snaps/poldek/%{name}-%{version}%{snap}.tar.bz2
26 # Source0-md5:  14135ae2960da09990c50d5b5342be64
27 Source1:        %{name}.conf
28 Source2:        %{name}-multilib.conf
29 Source5:        %{name}-aliases.conf
30 Source6:        %{name}.desktop
31 Source7:        %{name}.png
32 Patch100:       %{name}-dirdeps.patch
33 Patch0:         %{name}-vserver-packages.patch
34 Patch1:         %{name}-config.patch
35 Patch2:         %{name}-size-type.patch
36 Patch4:         %{name}-Os-fail-workaround.patch
37 URL:            http://poldek.pld-linux.org/
38 BuildRequires:  autoconf
39 BuildRequires:  automake
40 BuildRequires:  bzip2-devel
41 BuildRequires:  check-devel
42 BuildRequires:  db-devel >= %{ver_db}
43 BuildRequires:  gettext-autopoint
44 BuildRequires:  gettext-devel
45 BuildRequires:  libtool
46 BuildRequires:  libxml2-devel
47 BuildRequires:  openssl-devel >= 0.9.7d
48 BuildRequires:  pcre-devel
49 BuildRequires:  pkgconfig
50 BuildRequires:  popt-devel
51 %{?with_python:BuildRequires:   python-devel}
52 BuildRequires:  readline-devel >= 5.0
53 BuildRequires:  rpm-devel >= %{ver_rpm}
54 %{?with_python:BuildRequires:   rpm-pythonprov}
55 BuildRequires:  sed >= 4.0
56 BuildRequires:  swig-python
57 BuildRequires:  zlib-devel
58 %if %{with static}
59 BuildRequires:  bzip2-static
60 BuildRequires:  db-static >= %{ver_db}
61 BuildRequires:  glibc-static
62 BuildRequires:  libselinux-static
63 BuildRequires:  libxml2-static
64 BuildRequires:  ncurses-static
65 BuildRequires:  openssl-static
66 BuildRequires:  pcre-static
67 BuildRequires:  popt-static
68 BuildRequires:  readline-static
69 BuildRequires:  rpm-static
70 BuildRequires:  zlib-static
71 %endif
72 Requires(triggerpostun):        awk
73 Requires(triggerpostun):        sed >= 4.0
74 Requires:       %{name}-libs = %{version}-%{release}
75 Requires:       db >= %{ver_db}
76 Requires:       openssl >= 0.9.7d
77 Requires:       rpm >= %{ver_rpm}
78 Requires:       rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
79 # vf* scripts use sed
80 Requires:       sed
81 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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 %pyrequires_eq  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 %patch4 -p1
198
199 rm -f m4/libtool.m4 m4/lt*.m4
200
201 # cleanup backups after patching
202 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
203 chmod u+x ./configure ./doc/conf-xml2.sh
204
205 %build
206 %{__libtoolize}
207 %{__aclocal} -I m4
208 %{__autoheader}
209 %{__autoconf}
210 %{__automake}
211 cp -f config.sub trurlib
212
213 CPPFLAGS="-std=gnu99"
214 %configure \
215         %{?with_static:--enable-static --disable-shared} \
216         %{!?with_imode:--disable-imode} \
217         --enable-nls \
218         %{?with_python:--with-python}
219 %{__make}
220 #       --enable-trace
221
222 %install
223 rm -rf $RPM_BUILD_ROOT
224 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
225
226 # -j1 due: https://bugs.launchpad.net/poldek/+bug/891997
227 %{__make} -j1 install \
228         DESTDIR=$RPM_BUILD_ROOT
229
230 %if %{with python}
231 %{__make} -C python install \
232         DESTDIR=$RPM_BUILD_ROOT \
233         libdir=%{py_sitedir}
234 %endif
235
236 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
237
238 %ifarch i386 i586 i686 ppc sparc alpha athlon
239 %define         _ftp_arch       %{_target_cpu}
240 %endif
241 %ifarch %{x8664}
242 %define         _ftp_arch       amd64
243 %define         _ftp_alt_arch   i686
244 %endif
245 %ifarch i486
246 %define         _ftp_arch       i386
247 %endif
248 %ifarch pentium2 pentium3 pentium4
249 %define         _ftp_arch       i686
250 %endif
251 %ifarch sparcv9 sparc64
252 %define         _ftp_arch       sparc
253 %endif
254
255 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
256
257 sed -e '
258         s|%%ARCH%%|%{_ftp_arch}|g
259 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
260
261 %ifarch %{x8664}
262 sed '
263         s|%%ARCH%%|%{_ftp_alt_arch}|g
264 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
265 %endif
266
267 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
268
269 %if %{with imode}
270 # add desktop file and icon
271 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
272 cp -a %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
273 cp -a %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
274 %endif
275
276 # sources we don't package
277 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
278 # include them in %doc
279 rm -rf configs
280 cp -a conf configs
281 rm -f configs/Makefile*
282
283 %if %{with python}
284 %py_postclean
285 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
286 %endif
287
288 %find_lang %{name}
289
290 %clean
291 rm -rf $RPM_BUILD_ROOT
292
293 %post
294 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
295 if [ "$1" = "1" ]; then
296         # remove ignore = vserver-packages inside vserver on first install
297         {
298                 while read f ctx; do
299                         [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
300                 done </proc/self/status
301         } 2>/dev/null
302         if [ -z "$ctx" -o "$ctx" = "0" ]; then
303                 VSERVER=no
304         else
305                 VSERVER=yes
306         fi
307         if [ "$VSERVER" = "yes" ]; then
308                 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
309         fi
310 fi
311
312 %postun -p      /sbin/postshell
313 -/usr/sbin/fix-info-dir -c %{_infodir}
314
315 %post   libs -p /sbin/ldconfig
316 %postun libs -p /sbin/ldconfig
317
318 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
319 if [ -f /etc/poldek.conf.rpmsave ]; then
320         awk '/^source/ {
321         name = $3;
322         path = $4;
323         auto = "yes";
324         autoup = "yes";
325         type = "pdir";
326         pri = "";
327
328         if (sub(",noauto", "", name)) {
329                 auto = "no";
330         }
331
332         # process pri=\d+
333         if (match(name, /,pri=[0-9]+/)) {
334                 pri = substr(name, RSTART + 5, RLENGTH - 5);
335                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
336         }
337
338         # skip ac sources. already in new config.
339         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
340                 print "";
341                 print "[source]";
342                 print "name = " name;
343                 print "type = " type;
344                 print "path = " path;
345                 print "auto = " auto;
346                 print "autoup = " autoup;
347                 if (pri) {
348                         print "pri = " pri;
349                 }
350         }
351
352         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
353         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
354
355         # copy hold=
356         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
357         if [ "$hold" ]; then
358                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
359         fi
360 fi
361
362 %triggerpostun -- poldek < 0.30-0.20080225.00.1
363 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
364         %{__sed} -i -e '/^%%include source.conf/{
365                 a
366                 a# /etc/poldek/repos.d/*.conf
367                 a%%includedir repos.d
368         }' %{_sysconfdir}/%{name}/poldek.conf
369 fi
370
371 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
372 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
373
374 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
375         cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
376         mv -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
377         %{__sed} -i -e 's,_pld_arch,_arch,g;s,_ac_idxtype,_type,g;s,_pld_prefix,_prefix,g' \
378                  %{_sysconfdir}/%{name}/repos.d/pld.conf
379 fi
380
381 %ifarch %{x8664}
382 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
383         cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
384         mv -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
385         %{__sed} -i -e 's,_pld_arch,_arch,g;s,_ac_idxtype,_type,g;s,_pld_prefix,_prefix,g' \
386                  %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
387 fi
388 %endif
389
390 %files -f %{name}.lang
391 %defattr(644,root,root,755)
392 %doc ChangeLog README* NEWS TODO configs
393 %dir %{_sysconfdir}/%{name}
394 %dir %{_sysconfdir}/%{name}/repos.d
395 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
396 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
397 %attr(755,root,root) %{_bindir}/*
398 %dir %{_libdir}/%{name}
399 %attr(755,root,root) %{_libdir}/%{name}/*
400 %{_mandir}/man1/%{name}*
401 %lang(pl) %{_mandir}/pl/man1/%{name}*
402 %{_infodir}/poldek.info*
403 %if %{with imode}
404 %{_desktopdir}/%{name}.desktop
405 %{_pixmapsdir}/%{name}.png
406 %endif
407
408 %if %{without static}
409 %files libs
410 %defattr(644,root,root,755)
411 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
412 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
413 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
414 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
415 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
416 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
417 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
418 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
419 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
420 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
421 %endif
422
423 %files devel
424 %defattr(644,root,root,755)
425 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
426 %{_libdir}/lib*.la
427 %{_includedir}/*
428
429 %files static
430 %defattr(644,root,root,755)
431 %{_libdir}/lib*.a
432
433 %if %{with python}
434 %files -n python-poldek
435 %defattr(644,root,root,755)
436 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
437 %{py_sitescriptdir}/poldek.py[co]
438 %{py_sitescriptdir}/poldekmod.py[co]
439 %endif
This page took 0.13113 seconds and 4 git commands to generate.