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