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