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