]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
- fix crash witn index build lp#321546; rel 15
[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 %if "%{pld_release}" == "ti"
9 %define ver_db  4.5.20
10 %define ver_db_rel      8
11 %else
12 %define ver_db  4.7.25
13 %define ver_db_rel      1
14 %endif
15 %define ver_rpm 4.5-5
16 #
17 %define         snap    20080820.23
18 %define         rel             15
19 Summary:        RPM packages management helper tool
20 Summary(pl.UTF-8):      Pomocnicze narzędzie do zarządzania pakietami RPM
21 Name:           poldek
22 Version:        0.30
23 Release:        0.%{snap}.%{rel}
24 License:        GPL v2
25 Group:          Applications/System
26 #Source0:       http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
27 Source0:        http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}-cvs%{snap}.tar.bz2
28 # Source0-md5:  2738eb3996f1cdf1e5d74b913d6e7414
29 Source1:        %{name}.conf
30 Source2:        %{name}-multilib.conf
31 Source3:        %{name}-ti.conf
32 Source4:        %{name}-multilib-ti.conf
33 Source5:        %{name}-aliases.conf
34 Source6:        %{name}.desktop
35 Source7:        %{name}.png
36 Patch0:         %{name}-vserver-packages.patch
37 Patch1:         %{name}-config.patch
38 Patch2:         %{name}-abort-on-upgrade.patch
39 Patch3:         %{name}-inline.patch
40 Patch4:         %{name}-ls-llu.patch
41 Patch5:         %{name}-op-ldalldesc.patch
42 Patch6:         %{name}-nocolor-upgrade.patch
43 Patch7:         %{name}-upgrade-dist.patch
44 Patch8:         %{name}-keep-reinstalled-provides.patch
45 Patch9:         %{name}-dont-ask-for-suggests-on-errors.patch
46 Patch10:        %{name}-crash-on-invalid-locale.patch
47 Patch11:        %{name}-noutf8.patch
48 Patch12:        %{name}-dont-suggests-required-packages.patch
49 Patch13:        %{name}-tty-for-erasures.patch
50 Patch14:        %{name}-both_langs.patch
51 Patch15:        %{name}-317130.patch
52 Patch16:        %{name}-321546.patch
53 URL:            http://poldek.pld-linux.org/
54 BuildRequires:  autoconf
55 BuildRequires:  automake
56 BuildRequires:  bzip2-devel
57 BuildRequires:  check
58 BuildRequires:  db-devel >= %{ver_db}-%{ver_db_rel}
59 BuildRequires:  gettext-autopoint
60 BuildRequires:  libtool
61 BuildRequires:  libxml2-devel
62 BuildRequires:  openssl-devel >= 0.9.7d
63 BuildRequires:  pcre-devel
64 BuildRequires:  perl-tools-pod
65 BuildRequires:  pkgconfig
66 BuildRequires:  popt-devel
67 %{?with_python:BuildRequires:   python-devel}
68 BuildRequires:  readline-devel >= 5.0
69 BuildRequires:  rpm-devel >= %{ver_rpm}
70 %{?with_python:BuildRequires:   rpm-pythonprov}
71 BuildRequires:  xmlto
72 BuildRequires:  zlib-devel
73 %if %{with static}
74 BuildRequires:  bzip2-static
75 BuildRequires:  db-static >= %{ver_db}-%{ver_db_rel}
76 BuildRequires:  glibc-static
77 BuildRequires:  libselinux-static
78 BuildRequires:  libxml2-static
79 BuildRequires:  ncurses-static
80 BuildRequires:  openssl-static
81 BuildRequires:  pcre-static
82 BuildRequires:  popt-static
83 BuildRequires:  readline-static
84 BuildRequires:  rpm-static
85 BuildRequires:  zlib-static
86 %endif
87 Requires(triggerpostun):        awk
88 Requires(triggerpostun):        sed >= 4.0
89 Requires:       %{name}-libs = %{version}-%{release}
90 Requires:       db >= %{ver_db}-%{ver_db_rel}
91 Requires:       rpm >= %{ver_rpm}
92 Requires:       rpm-db-ver = %{ver_db}
93 Requires:       rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
94 # vf* scripts use sed
95 Requires:       sed
96 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
97
98 %description
99 poldek is an RPM package management tool which allows you to easily
100 perform package verification, installation (including system
101 installation from scratch), upgrading, and removal.
102
103 Program can be used in batch (like apt-get from Debian's APT) or
104 interactive mode. The interactive mode puts you into a readline
105 interface with command line autocompletion and history, similar to the
106 shell mode of Perl's CPAN.
107
108 %{?with_static:This version is statically linked.}
109
110 %{!?with_imode:This version hasn't got interactive mode.}
111 #'vim
112
113 %description -l pl.UTF-8
114 poldek jest narzędziem linii poleceń służącym do weryfikacji,
115 instalacji (włączając instalację systemu od zera), aktualizacji i
116 usuwania pakietów.
117
118 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
119 interaktywnym. Tryb interaktywny posiada interfejs readline z
120 dopełnianiem komend i historią, podobny do trybu shell perlowego
121 modułu CPAN.
122
123 %{?with_static:Ta wersja jest konsolidowana statycznie.}
124
125 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
126
127 %package libs
128 Summary:        poldek libraries
129 Summary(pl.UTF-8):      Biblioteki poldka
130 Group:          Libraries
131
132 %description libs
133 poldek libraries.
134
135 %description libs -l pl.UTF-8
136 Biblioteki poldka.
137
138 %package devel
139 Summary:        Header files for poldek libraries
140 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek poldka
141 Group:          Development/Libraries
142 Requires:       %{name}-libs = %{version}-%{release}
143
144 %description devel
145 Header files for poldek libraries.
146
147 %description devel -l pl.UTF-8
148 Pliki nagłówkowe bibliotek poldka.
149
150 %package static
151 Summary:        poldek static libraries
152 Summary(pl.UTF-8):      Biblioteki statyczne poldka
153 Group:          Development/Libraries
154 Requires:       %{name}-devel = %{version}-%{release}
155
156 %description static
157 poldek static libraries.
158
159 %description static -l pl.UTF-8
160 Biblioteki statyczne poldka.
161
162 %package -n python-poldek
163 Summary:        Python modules for poldek
164 Summary(pl.UTF-8):      Moduły języka Python dla poldka
165 Group:          Libraries/Python
166 Requires:       %{name}-libs = %{version}-%{release}
167 %pyrequires_eq  python-libs
168
169 %description -n python-poldek
170 Python modules for poldek.
171
172 %description -n python-poldek -l pl.UTF-8
173 Moduły języka Python dla poldka.
174
175 %prep
176 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
177 %patch0 -p1
178 %patch1 -p1
179 %patch2 -p1
180 %patch3 -p1
181 %patch4 -p1
182 %patch5 -p1
183 %patch6 -p0
184 %patch7 -p0
185 %patch8 -p0
186 %patch9 -p0
187 %patch10 -p1
188 %patch11 -p1
189 %patch12 -p1
190 %patch13 -p1
191 %patch14 -p1
192 %patch15 -p1
193 %patch16 -p1
194
195 # cleanup backups after patching
196 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
197
198 %build
199 %{__libtoolize}
200 %{__aclocal} -I m4
201 %{__autoconf}
202 %{__automake}
203 cp -f config.sub trurlib
204
205 CPPFLAGS="-std=gnu99"
206 %configure \
207         %{?with_static:--enable-static --disable-shared} \
208         %{!?with_imode:--disable-imode} \
209         --enable-nls \
210         %{?with_python:--with-python}
211 %{__make}
212
213 %install
214 rm -rf $RPM_BUILD_ROOT
215 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
216
217 %{__make} install \
218         DESTDIR=$RPM_BUILD_ROOT
219
220 %if %{with python}
221 %{__make} -C python install \
222         DESTDIR=$RPM_BUILD_ROOT \
223         libdir=%{py_sitedir}
224 %endif
225
226 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
227
228 %ifarch i486 i686 ppc sparc alpha athlon
229 %define         _ftp_arch       %{_target_cpu}
230 %endif
231 %ifarch %{x8664}
232 %define         _ftp_arch       x86_64
233 %define         _ftp_alt_arch   i686
234 %endif
235 %ifarch i586
236 %if "%{pld_release}" == "ti"
237 %define         _ftp_arch       i586
238 %else
239 %define         _ftp_arch       i486
240 %endif
241 %endif
242 %ifarch pentium2 pentium3 pentium4
243 %define         _ftp_arch       i686
244 %endif
245 %ifarch sparcv9 sparc64
246 %define         _ftp_arch       sparc
247 %endif
248
249 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
250
251 %if "%{pld_release}" == "ti"
252 sed -e '
253         s|%%ARCH%%|%{_ftp_arch}|g
254 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
255
256 %ifarch %{x8664}
257 sed '
258         s|%%ARCH%%|%{_ftp_alt_arch}|g
259 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
260 %endif
261 %else
262 sed -e '
263         s|%%ARCH%%|%{_ftp_arch}|g
264 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
265
266 %ifarch %{x8664}
267 sed '
268         s|%%ARCH%%|%{_ftp_alt_arch}|g
269 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
270 %endif
271 %endif
272
273 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
274
275 %if %{with imode}
276 # add desktop file and icon
277 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
278 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
279 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
280 %endif
281
282 # sources we don't package
283 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
284 # include them in %doc
285 rm -rf configs
286 cp -a conf configs
287 rm -f configs/Makefile*
288
289 %if %{with python}
290 %py_postclean
291 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
292 %endif
293
294 %find_lang %{name}
295
296 %clean
297 rm -rf $RPM_BUILD_ROOT
298
299 %post   -p      /sbin/postshell
300 -/usr/sbin/fix-info-dir -c %{_infodir}
301
302 %postun -p      /sbin/postshell
303 -/usr/sbin/fix-info-dir -c %{_infodir}
304
305 %post   libs -p /sbin/ldconfig
306 %postun libs -p /sbin/ldconfig
307
308 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
309 if [ -f /etc/poldek.conf.rpmsave ]; then
310         awk '/^source/ {
311         name = $3;
312         path = $4;
313         auto = "yes";
314         autoup = "yes";
315         type = "pdir";
316         pri = "";
317
318         if (sub(",noauto", "", name)) {
319                 auto = "no";
320         }
321
322         # process pri=\d+
323         if (match(name, /,pri=[0-9]+/)) {
324                 pri = substr(name, RSTART + 5, RLENGTH - 5);
325                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
326         }
327
328         # skip ac sources. already in new config.
329         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
330                 print "";
331                 print "[source]";
332                 print "name = " name;
333                 print "type = " type;
334                 print "path = " path;
335                 print "auto = " auto;
336                 print "autoup = " autoup;
337                 if (pri) {
338                         print "pri = " pri;
339                 }
340         }
341
342         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
343         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
344
345         # copy hold=
346         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
347         if [ "$hold" ]; then
348                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
349         fi
350 fi
351
352 %triggerpostun -- poldek < 0.30-0.20080225.00.1
353 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
354         %{__sed} -i -e '/^%%include source.conf/{
355                 a
356                 a# /etc/poldek/repos.d/*.conf
357                 a%%includedir repos.d
358         }' %{_sysconfdir}/%{name}/poldek.conf
359 fi
360
361 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
362 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
363
364 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
365         cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
366         cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
367 fi
368
369 %ifarch %{x8664}
370 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
371         cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
372         cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
373 fi
374 %endif
375
376 %files -f %{name}.lang
377 %defattr(644,root,root,755)
378 %doc README* NEWS TODO configs
379 %dir %{_sysconfdir}/%{name}
380 %dir %{_sysconfdir}/%{name}/repos.d
381 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
382 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
383 %attr(755,root,root) %{_bindir}/*
384 %dir %{_libdir}/%{name}
385 %attr(755,root,root) %{_libdir}/%{name}/*
386 %{_mandir}/man1/%{name}*
387 %lang(pl) %{_mandir}/pl/man1/%{name}*
388 %{_infodir}/poldek.info*
389 %if %{with imode}
390 %{_desktopdir}/%{name}.desktop
391 %{_pixmapsdir}/%{name}.png
392 %endif
393
394 %if %{without static}
395 %files libs
396 %defattr(644,root,root,755)
397 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
398 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
399 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
400 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
401 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
402 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
403 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
404 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
405 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
406 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
407 %endif
408
409 %files devel
410 %defattr(644,root,root,755)
411 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
412 %{_libdir}/lib*.la
413 %{_includedir}/*
414
415 %files static
416 %defattr(644,root,root,755)
417 %{_libdir}/lib*.a
418
419 %if %{with python}
420 %files -n python-poldek
421 %defattr(644,root,root,755)
422 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
423 %{py_sitescriptdir}/poldek.py[co]
424 %{py_sitescriptdir}/poldekmod.py[co]
425 %endif
This page took 0.144535 seconds and 3 git commands to generate.