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