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