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