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