]> 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 #
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.2.50-1
9 %define ver_rpm 4.4.1
10 Summary:        RPM packages management helper tool
11 Summary(pl):    Pomocnicze narzêdzie do zarz±dzania pakietami RPM
12 Name:           poldek
13 Version:        0.20
14 Release:        11
15 License:        GPL v2
16 Group:          Applications/System
17 Source0:        http://poldek.pld-linux.org/download/%{name}-%{version}.tar.bz2
18 # Source0-md5:  61c0c03ee4a9de36339fc943b6901266
19 Source1:        %{name}.conf
20 Source2:        %{name}-multilib.conf
21 Source3:        %{name}-aliases.conf
22 Patch0:         %{name}-cvs-fixes.patch
23 Patch1:         %{name}-ask-abort.patch
24 Patch2:         %{name}-obsoletes.patch
25 Patch3:         %{name}-completion.patch
26 Patch4:         %{name}-notimestamps.patch
27 Patch5:         %{name}-config.patch
28 Patch6:         %{name}-uninstall-multilib.patch
29 Patch7:         %{name}-bug-5774.patch
30 Patch8:         %{name}-cli-hist.patch
31 Patch9:         %{name}-vserver-packages.patch
32 Patch10:        %{name}-multilib.patch
33 Patch11:        %{name}-as_needed-fix.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:  popt-devel
47 %{?with_python:BuildRequires:   python-devel}
48 BuildRequires:  readline-devel >= 5.0
49 BuildRequires:  rpm-devel >= %{ver_rpm}
50 BuildRequires:  sed >= 4.0
51 BuildRequires:  zlib-devel
52 %if %{with static}
53 BuildRequires:  bzip2-static
54 BuildRequires:  db-static >= %{ver_db}
55 BuildRequires:  glibc-static
56 BuildRequires:  libselinux-static
57 BuildRequires:  libxml2-static
58 BuildRequires:  ncurses-static
59 BuildRequires:  openssl-static
60 BuildRequires:  pcre-static
61 BuildRequires:  popt-static
62 BuildRequires:  readline-static
63 BuildRequires:  rpm-static
64 BuildRequires:  zlib-static
65 %endif
66 Requires(triggerpostun):        awk
67 Requires(triggerpostun):        sed >= 4.0
68 Requires:       %{name}-libs = %{version}-%{release}
69 Requires:       db >= %{ver_db}
70 Requires:       openssl >= 0.9.7d
71 Requires:       rpm >= %{ver_rpm}
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
89 #'
90
91 %description -l pl
92 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
93 instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
94 usuwania pakietów.
95
96 Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
97 interaktywnym. Tryb interaktywny posiada interfejs readline z
98 dope³nianiem komend i histori±, podobny do trybu shell perlowego
99 modu³u CPAN.
100
101 %{?with_static:Ta wersja jest konsolidowana statycznie.}
102
103 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
104
105 %package libs
106 Summary:        poldek libraries
107 Summary(pl):    Biblioteki poldka
108 Group:          Libraries
109
110 %description libs
111 poldek libraries.
112
113 %description libs -l pl
114 Biblioteki poldka.
115
116 %package devel
117 Summary:        Header files for poldek libraries
118 Summary(pl):    Pliki nag³ówkowe bibliotek poldka
119 Group:          Development/Libraries
120 Requires:       %{name}-libs = %{version}-%{release}
121
122 %description devel
123 Header files for poldek libraries.
124
125 %description devel -l pl
126 Pliki nag³ówkowe bibliotek poldka.
127
128 %package static
129 Summary:        poldek static libraries
130 Summary(pl):    Biblioteki statyczne poldka
131 Group:          Development/Libraries
132 Requires:       %{name}-devel = %{version}-%{release}
133
134 %description static
135 poldek static libraries.
136
137 %description static -l pl
138 Biblioteki statyczne poldka.
139
140 %package -n python-poldek
141 Summary:        Python modules for poldek
142 Summary(pl):    Modu³y jêzyka Python dla poldka
143 Group:          Libraries/Python
144 Requires:       %{name}-libs = %{version}-%{release}
145 %pyrequires_eq  python-libs
146
147 %description -n python-poldek
148 Python modules for poldek.
149
150 %description -n python-poldek -l pl
151 Modu³y jêzyka Python dla poldka.
152
153 %prep
154 %setup -q
155 %patch0 -p2
156 %patch1 -p0
157 %patch2 -p0
158 %patch3 -p2
159 %patch4 -p1
160 %patch5 -p1
161 %patch6 -p0
162 %patch7 -p2
163 %patch8 -p2
164 %patch9 -p1
165 %ifarch %{x8664}
166 %patch10 -p1
167 %endif
168 %patch11 -p1
169
170 %build
171 %{__libtoolize}
172 %{__autopoint}
173 %{__aclocal} -I m4
174 %{__autoconf}
175 %{__automake}
176 cd trurlib
177 %{__libtoolize}
178 %{__aclocal}
179 %{__autoconf}
180 %{__automake}
181 cd ../tndb
182 %{__libtoolize}
183 %{__aclocal}
184 %{__autoconf}
185 %{__automake}
186 cd ..
187
188 %configure \
189         %{?with_static:--enable-static --disable-shared} \
190         %{!?with_imode:--disable-imode} \
191         %{?with_python:--with-python} \
192         --enable-nls
193 %{__make}
194
195 %install
196 rm -rf $RPM_BUILD_ROOT
197 install -d $RPM_BUILD_ROOT%{_sysconfdir}
198
199 %{__make} install \
200         DESTDIR=$RPM_BUILD_ROOT
201
202 %if %{with python}
203 %{__make} -C python install \
204         DESTDIR=$RPM_BUILD_ROOT
205 %endif
206
207 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
208
209 #
210 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
211 #
212 %ifarch i386 i586 i686 ppc sparc alpha athlon
213 %define         _ftp_arch       %{_target_cpu}
214 %else
215 %ifarch %{x8664}
216 %define         _ftp_arch       amd64
217 %define         _ftp_alt_arch   i686
218 %else
219 %ifarch i486
220 %define         _ftp_arch       i386
221 %else
222 %ifarch pentium2 pentium3 pentium4
223 %define         _ftp_arch       i686
224 %else
225 %ifarch sparcv9 sparc64
226 %define         _ftp_arch       sparc
227 %endif
228 %endif
229 %endif
230 %endif
231 %endif
232
233 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
234
235 sed -e '
236         s|%%ARCH%%|%{_ftp_arch}|g
237 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
238
239 %ifarch %{x8664}
240 sed '
241         s|%%ARCH%%|%{_ftp_alt_arch}|g
242 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
243 %endif
244
245 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
246
247 # get rid of non-pld sources
248 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
249 # include them in %doc
250 rm -rf configs
251 cp -a conf configs
252 rm -f configs/Makefile*
253
254 %find_lang %{name}
255
256 %if %{with python}
257 %py_postclean
258 install -d $RPM_BUILD_ROOT%{py_sitedir}
259 mv $RPM_BUILD_ROOT{%{_libdir},%{py_sitedir}}/_poldekmod.so
260 rm -f $RPM_BUILD_ROOT%{_libdir}/_poldekmod.la
261 %endif
262
263 %clean
264 rm -rf $RPM_BUILD_ROOT
265
266 %post
267 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
268
269 %postun
270 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
271
272 %post   libs -p /sbin/ldconfig
273 %postun libs -p /sbin/ldconfig
274
275 %triggerpostun -- poldek <= 0.18.3-5
276 if [ -f /etc/poldek.conf ]; then
277         sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
278 fi
279
280 # otherwise don't touch
281 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
282 %triggerpostun -- poldek <= 0.18.7-1
283 if [ -f /etc/poldek.conf ]; then
284         sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
285 fi
286 %endif
287
288 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
289 if [ -f /etc/poldek.conf.rpmsave ]; then
290         awk '/^source/ {
291         name = $3;
292         path = $4;
293         auto = "yes";
294         autoup = "yes";
295         type = "pdir";
296         pri = "";
297
298         if (sub(",noauto", "", name)) {
299                 auto = "no";
300         }
301
302         # process pri=\d+
303         if (match(name, /,pri=[0-9]+/)) {
304                 pri = substr(name, RSTART + 5, RLENGTH - 5);
305                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
306         }
307
308         # skip ac sources. already in new config.
309         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
310                 print "";
311                 print "[source]";
312                 print "name = " name;
313                 print "type = " type;
314                 print "path = " path;
315                 print "auto = " auto;
316                 print "autoup = " autoup;
317                 if (pri) {
318                         print "pri = " pri;
319                 }
320         }
321
322         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
323         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
324
325         # copy hold=
326         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
327         if [ "$hold" ]; then
328                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
329         fi
330 fi
331
332 %files -f %{name}.lang
333 %defattr(644,root,root,755)
334 %doc README* NEWS TODO configs/
335 %dir %{_sysconfdir}/%{name}
336 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
337 %attr(755,root,root) %{_bindir}/*
338 %dir %{_libdir}/%{name}
339 %attr(755,root,root) %{_libdir}/%{name}/*
340 %{_mandir}/man1/%{name}*
341 %lang(pl) %{_mandir}/pl/man1/%{name}*
342 %{_infodir}/poldek.info*
343
344 %if %{without static}
345 %files libs
346 %defattr(644,root,root,755)
347 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
348 %endif
349
350 %files devel
351 %defattr(644,root,root,755)
352 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
353 %{_libdir}/lib*.la
354 %{_includedir}/*
355
356 %files static
357 %defattr(644,root,root,755)
358 %{_libdir}/lib*.a
359
360 %if %{with python}
361 %files -n python-poldek
362 %defattr(644,root,root,755)
363 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
364 %{py_sitescriptdir}/poldek.py[co]
365 %{py_sitescriptdir}/poldekmod.py[co]
366 %endif
This page took 0.087349 seconds and 3 git commands to generate.