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