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