]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
d0b691e9d6029d6fdd8c5da3473d9d4472b848eb
[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    20080604.13
18 %define         rel             3
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:  2e1b9bbaf5c39cc626c22978852f6371
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}-158fix.patch
40 Patch4:         %{name}-inline.patch
41 Patch5:         %{name}-ls-llu.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 -p0
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 %{__autopoint}
178 %{__libtoolize}
179 %{__aclocal} -I m4
180 %{__autoconf}
181 %{__automake}
182 cp -f config.sub trurlib
183
184 CPPFLAGS="-std=gnu99"
185 %configure \
186         %{?with_static:--enable-static --disable-shared} \
187         %{!?with_imode:--disable-imode} \
188         --enable-nls \
189         %{?with_python:--with-python}
190 %{__make}
191
192 %install
193 rm -rf $RPM_BUILD_ROOT
194 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
195
196 %{__make} install \
197         DESTDIR=$RPM_BUILD_ROOT
198
199 %if %{with python}
200 %{__make} -C python install \
201         DESTDIR=$RPM_BUILD_ROOT \
202         libdir=%{py_sitedir}
203 %endif
204
205 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
206
207 %ifarch i486 i686 ppc sparc alpha athlon
208 %define         _ftp_arch       %{_target_cpu}
209 %endif
210 %ifarch %{x8664}
211 %define         _ftp_arch       x86_64
212 %define         _ftp_alt_arch   i686
213 %endif
214 %ifarch i586
215 %if "%{pld_release}" == "ti"
216 %define         _ftp_arch       i586
217 %else
218 %define         _ftp_arch       i486
219 %endif
220 %endif
221 %ifarch pentium2 pentium3 pentium4
222 %define         _ftp_arch       i686
223 %endif
224 %ifarch sparcv9 sparc64
225 %define         _ftp_arch       sparc
226 %endif
227
228 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
229
230 %if "%{pld_release}" == "ti"
231 sed -e '
232         s|%%ARCH%%|%{_ftp_arch}|g
233 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
234
235 %ifarch %{x8664}
236 sed '
237         s|%%ARCH%%|%{_ftp_alt_arch}|g
238 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
239 %endif
240 %else
241 sed -e '
242         s|%%ARCH%%|%{_ftp_arch}|g
243 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
244
245 %ifarch %{x8664}
246 sed '
247         s|%%ARCH%%|%{_ftp_alt_arch}|g
248 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
249 %endif
250 %endif
251
252 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
253
254 %if %{with imode}
255 # add desktop file and icon
256 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
257 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
258 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
259 %endif
260
261 # sources we don't package
262 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
263 # include them in %doc
264 rm -rf configs
265 cp -a conf configs
266 rm -f configs/Makefile*
267
268 %if %{with python}
269 %py_postclean
270 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
271 %endif
272
273 %find_lang %{name}
274
275 %clean
276 rm -rf $RPM_BUILD_ROOT
277
278 %post   -p      /sbin/postshell
279 -/usr/sbin/fix-info-dir -c %{_infodir}
280
281 %postun -p      /sbin/postshell
282 -/usr/sbin/fix-info-dir -c %{_infodir}
283
284 %post   libs -p /sbin/ldconfig
285 %postun libs -p /sbin/ldconfig
286
287 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
288 if [ -f /etc/poldek.conf.rpmsave ]; then
289         awk '/^source/ {
290         name = $3;
291         path = $4;
292         auto = "yes";
293         autoup = "yes";
294         type = "pdir";
295         pri = "";
296
297         if (sub(",noauto", "", name)) {
298                 auto = "no";
299         }
300
301         # process pri=\d+
302         if (match(name, /,pri=[0-9]+/)) {
303                 pri = substr(name, RSTART + 5, RLENGTH - 5);
304                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
305         }
306
307         # skip ac sources. already in new config.
308         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
309                 print "";
310                 print "[source]";
311                 print "name = " name;
312                 print "type = " type;
313                 print "path = " path;
314                 print "auto = " auto;
315                 print "autoup = " autoup;
316                 if (pri) {
317                         print "pri = " pri;
318                 }
319         }
320
321         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
322         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
323
324         # copy hold=
325         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
326         if [ "$hold" ]; then
327                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
328         fi
329 fi
330
331 %triggerpostun -- poldek < 0.30-0.20080225.00.1
332 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
333         %{__sed} -i -e '/^%%include source.conf/{
334                 a
335                 a# /etc/poldek/repos.d/*.conf
336                 a%%includedir repos.d
337         }' %{_sysconfdir}/%{name}/poldek.conf
338 fi
339
340 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
341 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
342
343 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
344         cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
345         cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
346 fi
347
348 %ifarch %{x8664}
349 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
350         cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
351         cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
352 fi
353 %endif
354
355 %files -f %{name}.lang
356 %defattr(644,root,root,755)
357 %doc README* NEWS TODO configs
358 %dir %{_sysconfdir}/%{name}
359 %dir %{_sysconfdir}/%{name}/repos.d
360 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
361 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
362 %attr(755,root,root) %{_bindir}/*
363 %dir %{_libdir}/%{name}
364 %attr(755,root,root) %{_libdir}/%{name}/*
365 %{_mandir}/man1/%{name}*
366 %lang(pl) %{_mandir}/pl/man1/%{name}*
367 %{_infodir}/poldek.info*
368 %if %{with imode}
369 %{_desktopdir}/%{name}.desktop
370 %{_pixmapsdir}/%{name}.png
371 %endif
372
373 %if %{without static}
374 %files libs
375 %defattr(644,root,root,755)
376 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
377 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
378 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
379 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
380 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
381 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
382 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
383 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
384 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
385 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
386 %endif
387
388 %files devel
389 %defattr(644,root,root,755)
390 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
391 %{_libdir}/lib*.la
392 %{_includedir}/*
393
394 %files static
395 %defattr(644,root,root,755)
396 %{_libdir}/lib*.a
397
398 %if %{with python}
399 %files -n python-poldek
400 %defattr(644,root,root,755)
401 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
402 %{py_sitescriptdir}/poldek.py[co]
403 %{py_sitescriptdir}/poldekmod.py[co]
404 %endif
This page took 0.099659 seconds and 3 git commands to generate.