]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
- merge from HEAD
[packages/poldek.git] / poldek.spec
1 # Conditional build:
2 %bcond_with     static  # don't use shared libraries
3 %bcond_without  imode   # don't build interactive mode
4 %bcond_without  python  # don't build python bindings
5 #
6 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
7 %define ver_db  4.3.27-1
8 %define ver_rpm 4.4.9-1
9 %define snap    20080225.00
10 %define rel             0.4
11 Summary:        RPM packages management helper tool
12 Summary(pl.UTF-8):      Pomocnicze narzędzie do zarządzania pakietami RPM
13 Name:           poldek
14 Version:        0.30
15 Release:        0.%{snap}.%{rel}
16 License:        GPL v2
17 Group:          Applications/System
18 Source0:        http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
19 # Source0-md5:  22b2cfb19cebd123e8d8148fb6ca27de
20 Source1:        %{name}.conf
21 Source2:        %{name}-multilib.conf
22 Source3:        %{name}-aliases.conf
23 Source4:        %{name}.desktop
24 Source5:        %{name}.png
25 Patch0:         %{name}-dirdeps.patch
26 Patch1:         %{name}-vserver-packages.patch
27 Patch2:         %{name}-config.patch
28 Patch3:         %{name}-nonoorder.patch
29 Patch4:         %{name}-bug117hack.patch
30 Patch5:         %{name}-missing-symbol.patch
31 Patch6:         %{name}-abort-on-upgrade.patch
32 Patch7:         %{name}-uninstall-greedy-fix.patch
33 Patch8:         %{name}-pkguinf-kill-assert.patch
34 Patch9:         %{name}-pkguinf-sourcerpm.patch
35 Patch10:        %{name}-sigint_emit.patch
36 Patch11:        %{name}-bug139.patch
37 URL:            http://poldek.pld-linux.org/
38 BuildRequires:  autoconf
39 BuildRequires:  automake
40 BuildRequires:  bzip2-devel
41 BuildRequires:  check
42 BuildRequires:  db-devel >= %{ver_db}
43 BuildRequires:  gettext-autopoint
44 BuildRequires:  libtool
45 BuildRequires:  libxml2-devel
46 BuildRequires:  openssl-devel >= 0.9.7d
47 BuildRequires:  pcre-devel
48 BuildRequires:  perl-tools-pod
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:  xmlto
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 pl.UTF-8
99 poldek jest narzędziem linii poleceń służącym do weryfikacji,
100 instalacji (włączając instalację systemu od zera), aktualizacji i
101 usuwania pakietów.
102
103 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
104 interaktywnym. Tryb interaktywny posiada interfejs readline z
105 dopełnianiem komend i historią, podobny do trybu shell perlowego
106 modułu CPAN.
107
108 %{?with_static:Ta wersja jest konsolidowana statycznie.}
109
110 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
111
112 %package libs
113 Summary:        poldek libraries
114 Summary(pl.UTF-8):      Biblioteki poldka
115 Group:          Libraries
116
117 %description libs
118 poldek libraries.
119
120 %description libs -l pl.UTF-8
121 Biblioteki poldka.
122
123 %package devel
124 Summary:        Header files for poldek libraries
125 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek poldka
126 Group:          Development/Libraries
127 Requires:       %{name}-libs = %{version}-%{release}
128
129 %description devel
130 Header files for poldek libraries.
131
132 %description devel -l pl.UTF-8
133 Pliki nagłówkowe bibliotek poldka.
134
135 %package static
136 Summary:        poldek static libraries
137 Summary(pl.UTF-8):      Biblioteki statyczne poldka
138 Group:          Development/Libraries
139 Requires:       %{name}-devel = %{version}-%{release}
140
141 %description static
142 poldek static libraries.
143
144 %description static -l pl.UTF-8
145 Biblioteki statyczne poldka.
146
147 %package -n python-poldek
148 Summary:        Python modules for poldek
149 Summary(pl.UTF-8):      Moduły języka Python dla poldka
150 Group:          Libraries/Python
151 Requires:       %{name}-libs = %{version}-%{release}
152 %pyrequires_eq  python-libs
153
154 %description -n python-poldek
155 Python modules for poldek.
156
157 %description -n python-poldek -l pl.UTF-8
158 Moduły języka Python dla poldka.
159
160 %prep
161 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
162 %patch0 -p1
163 %patch1 -p1
164 %patch2 -p1
165 %patch3 -p1
166 %patch4 -p0
167 %patch5 -p1
168 %patch6 -p1
169 %patch7 -p0
170 %patch8 -p1
171 %patch9 -p1
172 %patch10 -p1
173 %patch11 -p0
174
175 # cleanup backups after patching
176 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
177
178 %build
179 %{__autopoint}
180 %{__aclocal} -I m4
181 %{__autoconf}
182 %{__automake}
183 cp -f config.sub trurlib
184
185 CPPFLAGS="-std=gnu99"
186 %configure \
187         %{?with_static:--enable-static --disable-shared} \
188         %{!?with_imode:--disable-imode} \
189         --enable-nls \
190         %{?with_python:--with-python}
191 %{__make}
192
193 %install
194 rm -rf $RPM_BUILD_ROOT
195 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
196
197 %{__make} install \
198         DESTDIR=$RPM_BUILD_ROOT
199
200 %if %{with python}
201 %{__make} -C python install \
202         DESTDIR=$RPM_BUILD_ROOT \
203         libdir=%{py_sitedir}
204 %endif
205
206 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
207
208 %ifarch i386 i586 i686 ppc sparc alpha athlon
209 %define         _ftp_arch       %{_target_cpu}
210 %else
211 %ifarch %{x8664}
212 %define         _ftp_arch       amd64
213 %define         _ftp_alt_arch   i686
214 %else
215 %ifarch i486
216 %define         _ftp_arch       i386
217 %else
218 %ifarch pentium2 pentium3 pentium4
219 %define         _ftp_arch       i686
220 %else
221 %ifarch sparcv9 sparc64
222 %define         _ftp_arch       sparc
223 %endif
224 %endif
225 %endif
226 %endif
227 %endif
228
229 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
230
231 sed -e '
232         s|%%ARCH%%|%{_ftp_arch}|g
233 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
234
235 %ifarch %{x8664}
236 sed '
237         s|%%ARCH%%|%{_ftp_alt_arch}|g
238 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
239 %endif
240
241 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
242
243 %if %{with imode}
244 # add desktop file and icon
245 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
246 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
247 install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
248 %endif
249
250 # sources we don't package
251 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
252 # include them in %doc
253 rm -rf configs
254 cp -a conf configs
255 rm -f configs/Makefile*
256
257 %if %{with python}
258 %py_postclean
259 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
260 %endif
261
262 %find_lang %{name}
263
264 %clean
265 rm -rf $RPM_BUILD_ROOT
266
267 %post   -p      /sbin/postshell
268 -/usr/sbin/fix-info-dir -c %{_infodir}
269
270 %postun -p      /sbin/postshell
271 -/usr/sbin/fix-info-dir -c %{_infodir}
272
273 %post   libs -p /sbin/ldconfig
274 %postun libs -p /sbin/ldconfig
275
276 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
277 if [ -f /etc/poldek.conf.rpmsave ]; then
278         awk '/^source/ {
279         name = $3;
280         path = $4;
281         auto = "yes";
282         autoup = "yes";
283         type = "pdir";
284         pri = "";
285
286         if (sub(",noauto", "", name)) {
287                 auto = "no";
288         }
289
290         # process pri=\d+
291         if (match(name, /,pri=[0-9]+/)) {
292                 pri = substr(name, RSTART + 5, RLENGTH - 5);
293                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
294         }
295
296         # skip ac sources. already in new config.
297         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
298                 print "";
299                 print "[source]";
300                 print "name = " name;
301                 print "type = " type;
302                 print "path = " path;
303                 print "auto = " auto;
304                 print "autoup = " autoup;
305                 if (pri) {
306                         print "pri = " pri;
307                 }
308         }
309
310         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
311         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
312
313         # copy hold=
314         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
315         if [ "$hold" ]; then
316                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
317         fi
318 fi
319
320 %triggerpostun -- poldek < 0.30-0.20080225.00.1
321 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
322         %{__sed} -i -e '/^%%include source.conf/{
323                 a
324                 a# /etc/poldek/repos.d/*.conf
325                 a%%includedir repos.d
326         }' %{_sysconfdir}/%{name}/poldek.conf
327 fi
328
329 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
330 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
331
332 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
333         cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
334         mv -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
335 fi
336
337 %ifarch %{x8664}
338 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
339         cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
340         mv -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
341 fi
342 %endif
343
344 %files -f %{name}.lang
345 %defattr(644,root,root,755)
346 %doc README* NEWS TODO configs
347 %dir %{_sysconfdir}/%{name}
348 %dir %{_sysconfdir}/%{name}/repos.d
349 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
350 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
351 %attr(755,root,root) %{_bindir}/*
352 %dir %{_libdir}/%{name}
353 %attr(755,root,root) %{_libdir}/%{name}/*
354 %{_mandir}/man1/%{name}*
355 %lang(pl) %{_mandir}/pl/man1/%{name}*
356 %{_infodir}/poldek.info*
357 %if %{with imode}
358 %{_desktopdir}/%{name}.desktop
359 %{_pixmapsdir}/%{name}.png
360 %endif
361
362 %if %{without static}
363 %files libs
364 %defattr(644,root,root,755)
365 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
366 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
367 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
368 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
369 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
370 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
371 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
372 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
373 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
374 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
375 %endif
376
377 %files devel
378 %defattr(644,root,root,755)
379 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
380 %{_libdir}/lib*.la
381 %{_includedir}/*
382
383 %files static
384 %defattr(644,root,root,755)
385 %{_libdir}/lib*.a
386
387 %if %{with python}
388 %files -n python-poldek
389 %defattr(644,root,root,755)
390 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
391 %{py_sitescriptdir}/poldek.py[co]
392 %{py_sitescriptdir}/poldekmod.py[co]
393 %endif
This page took 1.685561 seconds and 3 git commands to generate.