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