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