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