]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
02cafce84ab4b598569a272bf831e5e3dc28939c
[packages/poldek.git] / poldek.spec
1 # TODO
2 # - python bindings need some patch :)
3 #
4 # Conditional build:
5 %bcond_with     static  # don't use shared libraries
6 %bcond_without  imode   # don't build interactive mode
7 %bcond_without  python  # don't build python bindings
8 #
9 %ifarch %{x8664} alpha
10 %undefine       with_python
11 %endif
12 #
13 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
14 %define ver_db  4.2.50-1
15 %define ver_rpm 4.4.1
16 Summary:        RPM packages management helper tool
17 Summary(pl):    Pomocnicze narzêdzie do zarz±dzania pakietami RPM
18 Name:           poldek
19 Version:        0.20
20 Release:        14
21 License:        GPL v2
22 Group:          Applications/System
23 Source0:        http://poldek.pld-linux.org/download/%{name}-%{version}.tar.bz2
24 # Source0-md5:  61c0c03ee4a9de36339fc943b6901266
25 Source1:        %{name}.conf
26 Source2:        %{name}-multilib.conf
27 Source3:        %{name}-aliases.conf
28 Patch0:         %{name}-cvs-fixes.patch
29 Patch1:         %{name}-ask-abort.patch
30 Patch2:         %{name}-obsoletes.patch
31 Patch3:         %{name}-completion.patch
32 Patch4:         %{name}-notimestamps.patch
33 Patch5:         %{name}-config.patch
34 Patch6:         %{name}-uninstall-multilib.patch
35 Patch7:         %{name}-bug-5774.patch
36 Patch8:         %{name}-cli-hist.patch
37 Patch9:         %{name}-vserver-packages.patch
38 Patch10:        %{name}-multilib.patch
39 Patch11:        %{name}-as_needed-fix.patch
40 Patch12:        %{name}-ignorecaps.patch
41 URL:            http://poldek.pld-linux.org/
42 BuildRequires:  autoconf
43 BuildRequires:  automake
44 BuildRequires:  bzip2-devel
45 BuildRequires:  check
46 BuildRequires:  db-devel >= %{ver_db}
47 BuildRequires:  gettext-autopoint
48 BuildRequires:  libtool
49 BuildRequires:  libxml2-devel
50 BuildRequires:  openssl-devel >= 0.9.7d
51 BuildRequires:  pcre-devel
52 BuildRequires:  perl-tools-pod
53 BuildRequires:  popt-devel
54 %{?with_python:BuildRequires:   python-devel}
55 BuildRequires:  readline-devel >= 5.0
56 BuildRequires:  rpm-devel >= %{ver_rpm}
57 BuildRequires:  sed >= 4.0
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:       openssl >= 0.9.7d
78 Requires:       rpm >= %{ver_rpm}
79 Requires:       sed
80 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
81
82 %description
83 poldek is an RPM package management tool which allows you to easily
84 perform package verification, installation (including system
85 installation from scratch), upgrading, and removal.
86
87 Program can be used in batch (like apt-get from Debian's APT) or
88 interactive mode. The interactive mode puts you into a readline
89 interface with command line autocompletion and history, similar to the
90 shell mode of Perl's CPAN.
91
92 %{?with_static:This version is statically linked.}
93
94 %{!?with_imode:This version hasn't got interactive mode.}
95
96 #'
97
98 %description -l pl
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):    Biblioteki poldka
115 Group:          Libraries
116
117 %description libs
118 poldek libraries.
119
120 %description libs -l pl
121 Biblioteki poldka.
122
123 %package devel
124 Summary:        Header files for poldek libraries
125 Summary(pl):    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
133 Pliki nag³ówkowe bibliotek poldka.
134
135 %package static
136 Summary:        poldek static libraries
137 Summary(pl):    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
145 Biblioteki statyczne poldka.
146
147 %package -n python-poldek
148 Summary:        Python modules for poldek
149 Summary(pl):    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
158 Modu³y jêzyka Python dla poldka.
159
160 %prep
161 %setup -q
162 %patch0 -p2
163 %patch1 -p0
164 %patch2 -p0
165 %patch3 -p2
166 %patch4 -p1
167 %patch5 -p1
168 %patch6 -p0
169 %patch7 -p2
170 %patch8 -p2
171 %patch9 -p1
172 %ifarch %{x8664}
173 %patch10 -p1
174 %endif
175 %patch11 -p1
176 %patch12 -p1
177
178 %build
179 %{__libtoolize}
180 %{__autopoint}
181 %{__aclocal} -I m4
182 %{__autoconf}
183 %{__automake}
184 cd trurlib
185 %{__libtoolize}
186 %{__aclocal}
187 %{__autoconf}
188 %{__automake}
189 cd ../tndb
190 %{__libtoolize}
191 %{__aclocal}
192 %{__autoconf}
193 %{__automake}
194 cd ..
195
196 %configure \
197         %{?with_static:--enable-static --disable-shared} \
198         %{!?with_imode:--disable-imode} \
199         %{?with_python:--with-python} \
200         --enable-nls
201 %{__make}
202
203 %install
204 rm -rf $RPM_BUILD_ROOT
205 install -d $RPM_BUILD_ROOT%{_sysconfdir}
206
207 %{__make} install \
208         DESTDIR=$RPM_BUILD_ROOT
209
210 %if %{with python}
211 %{__make} -C python install \
212         DESTDIR=$RPM_BUILD_ROOT
213 %endif
214
215 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
216
217 #
218 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
219 #
220 %ifarch i386 i586 i686 ppc sparc alpha athlon
221 %define         _ftp_arch       %{_target_cpu}
222 %else
223 %ifarch %{x8664}
224 %define         _ftp_arch       amd64
225 %define         _ftp_alt_arch   i686
226 %else
227 %ifarch i486
228 %define         _ftp_arch       i386
229 %else
230 %ifarch pentium2 pentium3 pentium4
231 %define         _ftp_arch       i686
232 %else
233 %ifarch sparcv9 sparc64
234 %define         _ftp_arch       sparc
235 %endif
236 %endif
237 %endif
238 %endif
239 %endif
240
241 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
242
243 sed -e '
244         s|%%ARCH%%|%{_ftp_arch}|g
245 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
246
247 %ifarch %{x8664}
248 sed '
249         s|%%ARCH%%|%{_ftp_alt_arch}|g
250 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
251 %endif
252
253 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
254
255 # get rid of non-pld sources
256 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
257 # include them in %doc
258 rm -rf configs
259 cp -a conf configs
260 rm -f configs/Makefile*
261
262 %find_lang %{name}
263
264 %if %{with python}
265 %py_postclean
266 install -d $RPM_BUILD_ROOT%{py_sitedir}
267 mv $RPM_BUILD_ROOT{%{_libdir},%{py_sitedir}}/_poldekmod.so
268 rm -f $RPM_BUILD_ROOT%{_libdir}/_poldekmod.la
269 %endif
270
271 %clean
272 rm -rf $RPM_BUILD_ROOT
273
274 %post
275 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
276
277 %postun
278 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
279
280 %post   libs -p /sbin/ldconfig
281 %postun libs -p /sbin/ldconfig
282
283 %triggerpostun -- poldek <= 0.18.3-5
284 if [ -f /etc/poldek.conf ]; then
285         sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
286 fi
287
288 # otherwise don't touch
289 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
290 %triggerpostun -- poldek <= 0.18.7-1
291 if [ -f /etc/poldek.conf ]; then
292         sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
293 fi
294 %endif
295
296 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
297 if [ -f /etc/poldek.conf.rpmsave ]; then
298         awk '/^source/ {
299         name = $3;
300         path = $4;
301         auto = "yes";
302         autoup = "yes";
303         type = "pdir";
304         pri = "";
305
306         if (sub(",noauto", "", name)) {
307                 auto = "no";
308         }
309
310         # process pri=\d+
311         if (match(name, /,pri=[0-9]+/)) {
312                 pri = substr(name, RSTART + 5, RLENGTH - 5);
313                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
314         }
315
316         # skip ac sources. already in new config.
317         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
318                 print "";
319                 print "[source]";
320                 print "name = " name;
321                 print "type = " type;
322                 print "path = " path;
323                 print "auto = " auto;
324                 print "autoup = " autoup;
325                 if (pri) {
326                         print "pri = " pri;
327                 }
328         }
329
330         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
331         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
332
333         # copy hold=
334         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
335         if [ "$hold" ]; then
336                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
337         fi
338 fi
339
340 %files -f %{name}.lang
341 %defattr(644,root,root,755)
342 %doc README* NEWS TODO configs/
343 %dir %{_sysconfdir}/%{name}
344 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
345 %attr(755,root,root) %{_bindir}/*
346 %dir %{_libdir}/%{name}
347 %attr(755,root,root) %{_libdir}/%{name}/*
348 %{_mandir}/man1/%{name}*
349 %lang(pl) %{_mandir}/pl/man1/%{name}*
350 %{_infodir}/poldek.info*
351
352 %if %{without static}
353 %files libs
354 %defattr(644,root,root,755)
355 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
356 %endif
357
358 %files devel
359 %defattr(644,root,root,755)
360 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
361 %{_libdir}/lib*.la
362 %{_includedir}/*
363
364 %files static
365 %defattr(644,root,root,755)
366 %{_libdir}/lib*.a
367
368 %if %{with python}
369 %files -n python-poldek
370 %defattr(644,root,root,755)
371 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
372 %{py_sitescriptdir}/poldek.py[co]
373 %{py_sitescriptdir}/poldekmod.py[co]
374 %endif
This page took 0.189673 seconds and 2 git commands to generate.