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