]> TLD Linux GIT Repositories - packages/poldek.git/blob - poldek.spec
- updated to 0.32.2, partial PLD merge
[packages/poldek.git] / poldek.spec
1 # TODO
2 # - fix config having escaped html entities:
3 #   # package A requires capability foo >= 1.0 while package B provides "foo"
4
5 # Conditional build:
6 %bcond_with     static  # don't use shared libraries
7 %bcond_without  imode   # don't build interactive mode
8 %bcond_without  python  # don't build python bindings
9
10 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
11 # NOTE: poldek links with "system db" (-ldb) anyway if it exists
12 %define         db_pkg          db4.7
13 %define         ver_db          4.7.25
14 %define         ver_db_rel      1
15 %define         ver_rpm         4.5-49
16
17 %define         rel     1
18 Summary:        RPM packages management helper tool
19 Summary(hu.UTF-8):      RPM csomagkezelést segítő eszköz
20 Summary(pl.UTF-8):      Pomocnicze narzędzie do zarządzania pakietami RPM
21 Name:           poldek
22 Version:        0.32.2
23 Release:        %{rel}
24 License:        GPL v2
25 Group:          Applications/System
26 Source0:        https://launchpad.net/poldek/0.32/%{version}/+download/%{name}-%{version}.tar.xz
27 # Source0-md5:  60b964723880569531f88f084cd3ae65
28 Source1:        %{name}.conf
29 Source2:        %{name}-multilib.conf
30 Source3:        %{name}-config.sh
31 Source5:        %{name}-aliases.conf
32 Source6:        %{name}.desktop
33 Source7:        %{name}.png
34 # Source7-md5:  ee487abede50874e9eceb6495d5ee150
35 Patch0:         %{name}-size-type.patch
36 Patch1:         %{name}-config.patch
37 Patch2:         pm-hooks.patch
38 Patch3:         WTERMSIG.patch
39 URL:            http://poldek.pld-linux.org/
40 BuildRequires:  %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
41 BuildRequires:  autoconf
42 BuildRequires:  automake >= 1:1.11
43 BuildRequires:  bzip2-devel
44 BuildRequires:  check-devel
45 BuildRequires:  docbook-dtd412-xml
46 BuildRequires:  gettext-tools
47 BuildRequires:  libgomp-devel
48 BuildRequires:  libtool
49 BuildRequires:  libxml2-devel
50 BuildRequires:  openssl-devel >= 0.9.7d
51 BuildRequires:  pcre-devel
52 BuildRequires:  pkgconfig
53 BuildRequires:  popt-devel
54 %{?with_python:BuildRequires:   python-devel}
55 BuildRequires:  readline-devel >= 5.0
56 BuildRequires:  rpm-devel >= %{ver_rpm}
57 %{?with_python:BuildRequires:   rpm-pythonprov}
58 BuildRequires:  tar >= 1:1.22
59 BuildRequires:  xmlto
60 BuildRequires:  xz
61 BuildRequires:  zlib-devel
62 %if %{with static}
63 BuildRequires:  %{db_pkg}-static >= %{ver_db}-%{ver_db_rel}
64 BuildRequires:  bzip2-static
65 BuildRequires:  glibc-static
66 BuildRequires:  libxml2-static
67 BuildRequires:  ncurses-static
68 BuildRequires:  openssl-static
69 BuildRequires:  pcre-static
70 BuildRequires:  popt-static
71 BuildRequires:  readline-static
72 BuildRequires:  rpm-static
73 BuildRequires:  zlib-static
74 %endif
75 Requires(triggerpostun):        awk
76 Requires(triggerpostun):        sed >= 4.0
77 Requires:       %{db_pkg} >= %{ver_db}-%{ver_db_rel}
78 Requires:       %{name}-libs = %{version}-%{release}
79 Requires:       /bin/run-parts
80 Requires:       rpm >= %{ver_rpm}
81 Requires:       rpm-db-ver = %{ver_db}
82 Requires:       rpm-lib >= %{ver_rpm}
83 Requires:       sed
84 Conflicts:      etckeeper < 1.18-2
85 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86
87 %define         _libexecdir     %{_prefix}/lib/%{name}
88
89 %description
90 poldek is an RPM package management tool which allows you to easily
91 perform package verification, installation (including system
92 installation from scratch), upgrading, and removal.
93
94 Program can be used in batch (like apt-get from Debian's APT) or
95 interactive mode. The interactive mode puts you into a readline
96 interface with command line autocompletion and history, similar to the
97 shell mode of Perl's CPAN.
98
99 %{?with_static:This version is statically linked.}
100
101 %{!?with_imode:This version hasn't got interactive mode.}
102 #'vim
103
104 %description -l hu.UTF-8
105 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
106 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
107 nulláról), frissítést és eltávolítást.
108
109 A program használható parancssorból (mint a Debian apt-get programja)
110 vagy interaktív módban. Az interaktív mód egy readline környezetet
111 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
112 shell módjához.
113
114 %{?with_static:Ez a verzió statikusan linkelt.}
115
116 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
117
118 %description -l pl.UTF-8
119 poldek jest narzędziem linii poleceń służącym do weryfikacji,
120 instalacji (włączając instalację systemu od zera), aktualizacji i
121 usuwania pakietów.
122
123 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
124 interaktywnym. Tryb interaktywny posiada interfejs readline z
125 dopełnianiem komend i historią, podobny do trybu shell perlowego
126 modułu CPAN.
127
128 %{?with_static:Ta wersja jest konsolidowana statycznie.}
129
130 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
131
132 %package libs
133 Summary:        poldek libraries
134 Summary(hu.UTF-8):      A poldek könyvtárai
135 Summary(pl.UTF-8):      Biblioteki poldka
136 Group:          Libraries
137
138 %description libs
139 poldek libraries.
140
141 %description libs -l hu.UTF-8
142 A poldek könyvtárai.
143
144 %description libs -l pl.UTF-8
145 Biblioteki poldka.
146
147 %package devel
148 Summary:        Header files for poldek libraries
149 Summary(hu.UTF-8):      A poldek könyvtár fejlesztői fájljai
150 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek poldka
151 Group:          Development/Libraries
152 Requires:       %{name}-libs = %{version}-%{release}
153 Requires:       rpm-devel >= %{ver_rpm}
154
155 %description devel
156 Header files for poldek libraries.
157
158 %description devel -l hu.UTF-8
159 A poldek könyvtár fejlesztői fájljai.
160
161 %description devel -l pl.UTF-8
162 Pliki nagłówkowe bibliotek poldka.
163
164 %package static
165 Summary:        poldek static libraries
166 Summary(hu.UTF-8):      poldek statikus könyvtárak
167 Summary(pl.UTF-8):      Biblioteki statyczne poldka
168 Group:          Development/Libraries
169 Requires:       %{name}-devel = %{version}-%{release}
170
171 %description static
172 poldek static libraries.
173
174 %description static -l hu.UTF-8
175 poldek statikus könyvtárak.
176
177 %description static -l pl.UTF-8
178 Biblioteki statyczne poldka.
179
180 %package -n python-poldek
181 Summary:        Python modules for poldek
182 Summary(hu.UTF-8):      Python modulok poldek-hez
183 Summary(pl.UTF-8):      Moduły języka Python dla poldka
184 Group:          Libraries/Python
185 Requires:       %{name}-libs = %{version}-%{release}
186 Requires:       python-libs
187
188 %description -n python-poldek
189 Python modules for poldek.
190
191 %description -n python-poldek -l hu.UTF-8
192 Python modulok poldek-hez.
193
194 %description -n python-poldek -l pl.UTF-8
195 Moduły języka Python dla poldka.
196
197 %prep
198 %setup -q
199 %patch0 -p1
200 %patch1 -p1
201 %patch2 -p1
202 %patch3 -p1
203
204 %{__rm} m4/libtool.m4 m4/lt*.m4
205
206 # cleanup backups after patching
207 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
208 chmod u+x ./configure ./doc/conf-xml2.sh
209
210 %build
211 %{__gettextize}
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 -fgnu89-inline"
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/var/cache/%{name}
244
245 %{__make} install -j1 \
246         DESTDIR=$RPM_BUILD_ROOT
247
248 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/poldek-config
249
250 %if %{with python}
251 %{__make} -C python -j1 install \
252         DESTDIR=$RPM_BUILD_ROOT \
253         libdir=%{py_sitedir}
254 %endif
255
256 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
257
258 %ifarch i686
259         %define         ftp_arch        %{_target_cpu}
260 %endif
261 %ifarch %{x8664}
262         %define         ftp_arch        x86_64
263         %define         ftp_alt_arch    i686
264 %endif
265 %ifarch pentium2 pentium3 pentium4
266         %define         ftp_arch        i686
267 %endif
268
269 %define tld_conf %{SOURCE1}
270
271 %ifarch %{x8664}
272         %define tld_multilib_conf %{SOURCE2}
273 %endif
274
275 %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{tld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld.conf
276
277 %if 0%{?tld_multilib_conf:1}
278         %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{tld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
279 %endif
280
281 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
282
283 %if %{with imode}
284 # add desktop file and icon
285 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
286 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
287 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
288 %endif
289
290 # sources we don't package
291 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
292 # include them in %doc
293 %{__rm} -rf configs
294 cp -a conf configs
295 %{__rm} -f configs/Makefile*
296
297 %if %{with python}
298 %py_postclean
299 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
300 %endif
301
302
303 %find_lang %{name}
304
305 %clean
306 rm -rf $RPM_BUILD_ROOT
307
308 %post
309 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
310 if [ "$1" = "1" ]; then
311         # remove ignore = vserver-packages inside vserver on first install
312         {
313                 while read f ctx; do
314                         [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
315                 done </proc/self/status
316         } 2>/dev/null
317         if [ -z "$ctx" -o "$ctx" = "0" ]; then
318                 VSERVER=no
319         else
320                 VSERVER=yes
321         fi
322         if [ "$VSERVER" = "yes" ]; then
323                 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
324         fi
325 fi
326
327 %postun -p      /sbin/postshell
328 -/usr/sbin/fix-info-dir -c %{_infodir}
329
330 %post   libs -p /sbin/ldconfig
331 %postun libs -p /sbin/ldconfig
332
333 %triggerpostun -- poldek < 0.30-0.20080225.00.1
334 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
335         %{__sed} -i -e '/^%%include source.conf/{
336                 a
337                 a# /etc/poldek/repos.d/*.conf
338                 a%%includedir repos.d
339         }' %{_sysconfdir}/%{name}/poldek.conf
340 fi
341
342 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
343 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
344
345 if [ -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave ]; then
346         %{__mv} -f %{_sysconfdir}/%{name}/repos.d/tld.conf{,.rpmnew}
347         %{__mv} -v %{_sysconfdir}/%{name}/tld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld.conf
348 fi
349
350 %ifarch %{x8664}
351 if [ -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave ]; then
352         %{__mv} -f %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf{,.rpmnew}
353         %{__mv} -v %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
354 fi
355 %endif
356
357 %triggerpostun -- %{name} < 0.30.1-8
358 if [ $1 -le 1 ]; then
359         # revert change on  --downgrade
360         %{__sed} -i -re 's,^pm command = %{_libexecdir}/pm-command.sh,#&,' %{_sysconfdir}/%{name}/%{name}.conf
361 else
362         # setup pm command
363         %{__sed} -i -re 's,#?(pm command =).*,\1 %{_libexecdir}/pm-command.sh,' %{_sysconfdir}/%{name}/%{name}.conf
364 fi
365
366 %files -f %{name}.lang
367 %defattr(644,root,root,755)
368 %doc ChangeLog README* NEWS TODO configs
369 %dir %{_sysconfdir}/%{name}
370 %dir %{_sysconfdir}/%{name}/pre-install.d
371 %{_sysconfdir}/%{name}/pre-install.d/README
372 %dir %{_sysconfdir}/%{name}/post-install.d
373 %{_sysconfdir}/%{name}/post-install.d/README
374 %dir %{_sysconfdir}/%{name}/repos.d
375 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/cli.conf
376 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/fetch.conf
377 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/poldek.conf
378 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/source.conf
379 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/tld.conf
380 %if 0%{?tld_multilib_conf:1}
381 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
382 %endif
383 %attr(755,root,root) %{_bindir}/ipoldek
384 %attr(755,root,root) %{_bindir}/poldek
385 %attr(755,root,root) %{_bindir}/poldek-config
386 %attr(755,root,root) %{_bindir}/rpmvercmp
387 %dir %{_libexecdir}
388 %attr(755,root,root) %{_libexecdir}/pm-command.sh
389 %attr(755,root,root) %{_libexecdir}/poldekuser-setup.sh
390 %attr(755,root,root) %{_libexecdir}/vfcompr
391 %attr(755,root,root) %{_libexecdir}/vfjuggle
392 %attr(755,root,root) %{_libexecdir}/vfsmb
393 %attr(755,root,root) %{_libexecdir}/zlib-in-rpm.sh
394 %{_mandir}/man1/%{name}*.1*
395 %lang(pl) %{_mandir}/pl/man1/%{name}*
396 %{_infodir}/poldek.info*
397 %if %{with imode}
398 %{_desktopdir}/%{name}.desktop
399 %{_pixmapsdir}/%{name}.png
400 %endif
401 %dir /var/cache/%{name}
402
403 %if %{without static}
404 %files libs
405 %defattr(644,root,root,755)
406 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
407 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
408 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
409 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
410 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
411 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
412 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
413 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
414 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
415 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
416 %endif
417
418 %files devel
419 %defattr(644,root,root,755)
420 %if %{without static}
421 %attr(755,root,root) %{_libdir}/libpoclidek.so
422 %attr(755,root,root) %{_libdir}/libpoldek.so
423 %attr(755,root,root) %{_libdir}/libtndb.so
424 %attr(755,root,root) %{_libdir}/libtrurl.so
425 %attr(755,root,root) %{_libdir}/libvfile.so
426 %endif
427 %{_libdir}/libpoclidek.la
428 %{_libdir}/libpoldek.la
429 %{_libdir}/libtndb.la
430 %{_libdir}/libtrurl.la
431 %{_libdir}/libvfile.la
432 %{_includedir}/poldek
433 %{_includedir}/tndb
434 %{_includedir}/trurl
435 %{_includedir}/vfile
436 %{_pkgconfigdir}/tndb.pc
437 %{_pkgconfigdir}/trurlib.pc
438
439 %files static
440 %defattr(644,root,root,755)
441 %{_libdir}/libtndb.a
442 %{_libdir}/libtrurl.a
443
444 %if %{with python}
445 %files -n python-poldek
446 %defattr(644,root,root,755)
447 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
448 %{py_sitescriptdir}/poldek.py[co]
449 %{py_sitescriptdir}/poldekmod.py[co]
450 %endif