]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
- never use '<=' in trigger comparision (drop old triggers)jobs -l
[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.2.50-1
9 %define         ver_rpm 4.4.1
10 %define         snap    20070703.00
11 %define         rel     13
12 Summary:        RPM packages management helper tool
13 Summary(pl.UTF-8):      Pomocnicze narzędzie do zarządzania pakietami RPM
14 Name:           poldek
15 Version:        0.21
16 Release:        0.%{snap}.%{rel}
17 License:        GPL v2
18 Group:          Applications/System
19 Source0:        http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
20 # Source0-md5:  dae23dec560fad954abf157fd250e4c3
21 Source1:        %{name}.conf
22 Source2:        %{name}-multilib.conf
23 Source3:        %{name}-aliases.conf
24 %if %{with imode}
25 Source4:        %{name}.desktop
26 Source5:        %{name}.png
27 %endif
28 Patch1:         %{name}-vserver-packages.patch
29 Patch2:         %{name}-config.patch
30 Patch3:         %{name}-multilib.patch
31 Patch4:         %{name}-ndie_fix.patch
32 Patch5:         %{name}-uri-escape-fix.patch
33 Patch6:         %{name}-install-dist.patch
34 Patch7:         %{name}-nohold-fix.patch
35 Patch8:         %{name}-dir-dot.patch
36 Patch9:         %{name}-suggests-one-package.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 %patch1 -p1
161 %patch2 -p1
162 %ifarch %{x8664}
163 %patch3 -p1
164 %endif
165 %patch4 -p0
166 %patch5 -p0
167 %patch6 -p1
168 %patch7 -p1
169 %patch8 -p1
170 %patch9 -p1
171
172 # cleanup backups after patching
173 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
174
175 %build
176 %{__autopoint}
177 %{__aclocal} -I m4
178 %{__autoconf}
179 %{__automake}
180 cp -f config.sub trurlib
181
182 %configure \
183         %{?with_static:--enable-static --disable-shared} \
184         %{!?with_imode:--disable-imode} \
185         --enable-nls \
186         %{?with_python:--with-python}
187 %{__make}
188
189 %install
190 rm -rf $RPM_BUILD_ROOT
191 install -d $RPM_BUILD_ROOT%{_sysconfdir}
192
193 %{__make} install \
194         DESTDIR=$RPM_BUILD_ROOT
195
196 %if %{with python}
197 %{__make} -C python install \
198         DESTDIR=$RPM_BUILD_ROOT \
199         libdir=%{py_sitedir}
200 %endif
201
202 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
203
204 %ifarch i486 i686 ppc sparc alpha athlon
205 %define         _ftp_arch       %{_target_cpu}
206 %else
207 %ifarch %{x8664}
208 %define         _ftp_arch       x86_64
209 %define         _ftp_alt_arch   i686
210 %else
211 %ifarch i586
212 %define         _ftp_arch       i486
213 %else
214 %ifarch pentium2 pentium3 pentium4
215 %define         _ftp_arch       i686
216 %else
217 %ifarch sparcv9 sparc64
218 %define         _ftp_arch       sparc
219 %endif
220 %endif
221 %endif
222 %endif
223 %endif
224
225 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
226
227 sed -e '
228         s|%%ARCH%%|%{_ftp_arch}|g
229 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
230
231 %ifarch %{x8664}
232 sed '
233         s|%%ARCH%%|%{_ftp_alt_arch}|g
234 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
235 %endif
236
237 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
238
239 %if %{with imode}
240 # add desktop file and icon
241 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
242 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
243 install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
244 %endif
245
246 # get rid of non-pld sources
247 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
248 # include them in %doc
249 rm -rf configs
250 cp -a conf configs
251 rm -f configs/Makefile*
252
253 %if %{with python}
254 %py_postclean
255 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
256 %endif
257
258 %find_lang %{name}
259
260 %clean
261 rm -rf $RPM_BUILD_ROOT
262
263 %post   -p      /sbin/postshell
264 -/usr/sbin/fix-info-dir -c %{_infodir}
265
266 %postun -p      /sbin/postshell
267 -/usr/sbin/fix-info-dir -c %{_infodir}
268
269 %post   libs -p /sbin/ldconfig
270 %postun libs -p /sbin/ldconfig
271
272 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
273 if [ -f /etc/poldek.conf.rpmsave ]; then
274         awk '/^source/ {
275         name = $3;
276         path = $4;
277         auto = "yes";
278         autoup = "yes";
279         type = "pdir";
280         pri = "";
281
282         if (sub(",noauto", "", name)) {
283                 auto = "no";
284         }
285
286         # process pri=\d+
287         if (match(name, /,pri=[0-9]+/)) {
288                 pri = substr(name, RSTART + 5, RLENGTH - 5);
289                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
290         }
291
292         # skip ac sources. already in new config.
293         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
294                 print "";
295                 print "[source]";
296                 print "name = " name;
297                 print "type = " type;
298                 print "path = " path;
299                 print "auto = " auto;
300                 print "autoup = " autoup;
301                 if (pri) {
302                         print "pri = " pri;
303                 }
304         }
305
306         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
307         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
308
309         # copy hold=
310         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
311         if [ "$hold" ]; then
312                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
313         fi
314 fi
315
316 %files -f %{name}.lang
317 %defattr(644,root,root,755)
318 %doc README* NEWS TODO configs/
319 %dir %{_sysconfdir}/%{name}
320 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
321 %attr(755,root,root) %{_bindir}/*
322 %dir %{_libdir}/%{name}
323 %attr(755,root,root) %{_libdir}/%{name}/*
324 %{_mandir}/man1/%{name}*
325 %lang(pl) %{_mandir}/pl/man1/%{name}*
326 %{_infodir}/poldek.info*
327 %if %{with imode}
328 %{_desktopdir}/%{name}.desktop
329 %{_pixmapsdir}/%{name}.png
330 %endif
331
332 %if !%{with static}
333 %files libs
334 %defattr(644,root,root,755)
335 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
336 %endif
337
338 %files devel
339 %defattr(644,root,root,755)
340 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
341 %{_libdir}/lib*.la
342 %{_includedir}/*
343
344 %files static
345 %defattr(644,root,root,755)
346 %{_libdir}/lib*.a
347
348 %if %{with python}
349 %files -n python-poldek
350 %defattr(644,root,root,755)
351 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
352 %{py_sitescriptdir}/poldek.py[co]
353 %{py_sitescriptdir}/poldekmod.py[co]
354 %endif
This page took 0.079252 seconds and 4 git commands to generate.