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