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