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