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