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