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