]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
- added -missing-symbol.patch
[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.9-1
10 #
11 %define         snap    20080225.00
12 %define         rel     0.3
13 Summary:        RPM packages management helper tool
14 Summary(pl.UTF-8):      Pomocnicze narzędzie do zarządzania pakietami RPM
15 Name:           poldek
16 Version:        0.30
17 Release:        0.%{snap}.%{rel}
18 License:        GPL v2
19 Group:          Applications/System
20 Source0:        http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
21 # Source0-md5:  22b2cfb19cebd123e8d8148fb6ca27de
22 Source1:        %{name}.conf
23 Source2:        %{name}-multilib.conf
24 Source3:        %{name}-aliases.conf
25 Source4:        %{name}.desktop
26 Source5:        %{name}.png
27 Patch1:         %{name}-vserver-packages.patch
28 Patch2:         %{name}-config.patch
29 Patch3:         %{name}-multilib.patch
30 Patch4:         %{name}-bug117hack.patch
31 Patch5:         %{name}-missing-symbol.patch
32 URL:            http://poldek.pld-linux.org/
33 BuildRequires:  autoconf
34 BuildRequires:  automake
35 BuildRequires:  bzip2-devel
36 BuildRequires:  check
37 BuildRequires:  db-devel >= %{ver_db}
38 BuildRequires:  gettext-autopoint
39 BuildRequires:  libtool
40 BuildRequires:  libxml2-devel
41 BuildRequires:  openssl-devel >= 0.9.7d
42 BuildRequires:  pcre-devel
43 BuildRequires:  perl-tools-pod
44 BuildRequires:  pkgconfig
45 BuildRequires:  popt-devel
46 %{?with_python:BuildRequires:   python-devel}
47 BuildRequires:  readline-devel >= 5.0
48 BuildRequires:  rpm-devel >= %{ver_rpm}
49 %{?with_python:BuildRequires:   rpm-pythonprov}
50 BuildRequires:  xmlto
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:       rpm >= %{ver_rpm}
71 Requires:       rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
72 # vf* scripts use sed
73 Requires:       sed
74 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75
76 %description
77 poldek is an RPM package management tool which allows you to easily
78 perform package verification, installation (including system
79 installation from scratch), upgrading, and removal.
80
81 Program can be used in batch (like apt-get from Debian's APT) or
82 interactive mode. The interactive mode puts you into a readline
83 interface with command line autocompletion and history, similar to the
84 shell mode of Perl's CPAN.
85
86 %{?with_static:This version is statically linked.}
87
88 %{!?with_imode:This version hasn't got interactive mode.}
89 #'vim
90
91 %description -l pl.UTF-8
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.UTF-8):      Biblioteki poldka
108 Group:          Libraries
109
110 %description libs
111 poldek libraries.
112
113 %description libs -l pl.UTF-8
114 Biblioteki poldka.
115
116 %package devel
117 Summary:        Header files for poldek libraries
118 Summary(pl.UTF-8):      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.UTF-8
126 Pliki nagłówkowe bibliotek poldka.
127
128 %package static
129 Summary:        poldek static libraries
130 Summary(pl.UTF-8):      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.UTF-8
138 Biblioteki statyczne poldka.
139
140 %package -n python-poldek
141 Summary:        Python modules for poldek
142 Summary(pl.UTF-8):      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.UTF-8
151 Moduły języka Python dla poldka.
152
153 %prep
154 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
155 %patch1 -p1
156 %patch2 -p1
157 %ifarch %{x8664}
158 %patch3 -p1
159 %endif
160 %patch4 -p0
161 %patch5 -p1
162
163 # cleanup backups after patching
164 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
165
166 %build
167 %{__autopoint}
168 %{__aclocal} -I m4
169 %{__autoconf}
170 %{__automake}
171 cp -f config.sub trurlib
172
173 CPPFLAGS="-std=gnu99"
174 %configure \
175         %{?with_static:--enable-static --disable-shared} \
176         %{!?with_imode:--disable-imode} \
177         --enable-nls \
178         %{?with_python:--with-python}
179 %{__make}
180
181 %install
182 rm -rf $RPM_BUILD_ROOT
183 install -d $RPM_BUILD_ROOT%{_sysconfdir}
184
185 %{__make} install \
186         DESTDIR=$RPM_BUILD_ROOT
187
188 %if %{with python}
189 %{__make} -C python install \
190         DESTDIR=$RPM_BUILD_ROOT \
191         libdir=%{py_sitedir}
192 %endif
193
194 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
195
196 %ifarch i486 i686 ppc sparc alpha athlon
197 %define         _ftp_arch       %{_target_cpu}
198 %else
199 %ifarch %{x8664}
200 %define         _ftp_arch       x86_64
201 %define         _ftp_alt_arch   i686
202 %else
203 %ifarch i586
204 %define         _ftp_arch       i486
205 %else
206 %ifarch pentium2 pentium3 pentium4
207 %define         _ftp_arch       i686
208 %else
209 %ifarch sparcv9 sparc64
210 %define         _ftp_arch       sparc
211 %endif
212 %endif
213 %endif
214 %endif
215 %endif
216
217 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
218
219 sed -e '
220         s|%%ARCH%%|%{_ftp_arch}|g
221 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
222
223 %ifarch %{x8664}
224 sed '
225         s|%%ARCH%%|%{_ftp_alt_arch}|g
226 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
227 %endif
228
229 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
230
231 %if %{with imode}
232 # add desktop file and icon
233 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
234 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
235 install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
236 %endif
237
238 # get rid of non-pld sources
239 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
240 # include them in %doc
241 rm -rf configs
242 cp -a conf configs
243 rm -f configs/Makefile*
244
245 %if %{with python}
246 %py_postclean
247 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
248 %endif
249
250 %find_lang %{name}
251
252 %clean
253 rm -rf $RPM_BUILD_ROOT
254
255 %post   -p      /sbin/postshell
256 -/usr/sbin/fix-info-dir -c %{_infodir}
257
258 %postun -p      /sbin/postshell
259 -/usr/sbin/fix-info-dir -c %{_infodir}
260
261 %post   libs -p /sbin/ldconfig
262 %postun libs -p /sbin/ldconfig
263
264 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
265 if [ -f /etc/poldek.conf.rpmsave ]; then
266         awk '/^source/ {
267         name = $3;
268         path = $4;
269         auto = "yes";
270         autoup = "yes";
271         type = "pdir";
272         pri = "";
273
274         if (sub(",noauto", "", name)) {
275                 auto = "no";
276         }
277
278         # process pri=\d+
279         if (match(name, /,pri=[0-9]+/)) {
280                 pri = substr(name, RSTART + 5, RLENGTH - 5);
281                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
282         }
283
284         # skip ac sources. already in new config.
285         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
286                 print "";
287                 print "[source]";
288                 print "name = " name;
289                 print "type = " type;
290                 print "path = " path;
291                 print "auto = " auto;
292                 print "autoup = " autoup;
293                 if (pri) {
294                         print "pri = " pri;
295                 }
296         }
297
298         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
299         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
300
301         # copy hold=
302         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
303         if [ "$hold" ]; then
304                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
305         fi
306 fi
307
308 %files -f %{name}.lang
309 %defattr(644,root,root,755)
310 %doc README* NEWS TODO configs/
311 %dir %{_sysconfdir}/%{name}
312 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
313 %attr(755,root,root) %{_bindir}/*
314 %dir %{_libdir}/%{name}
315 %attr(755,root,root) %{_libdir}/%{name}/*
316 %{_mandir}/man1/%{name}*
317 %lang(pl) %{_mandir}/pl/man1/%{name}*
318 %{_infodir}/poldek.info*
319 %if %{with imode}
320 %{_desktopdir}/%{name}.desktop
321 %{_pixmapsdir}/%{name}.png
322 %endif
323
324 %if !%{with static}
325 %files libs
326 %defattr(644,root,root,755)
327 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
328 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
329 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
330 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
331 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
332 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
333 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
334 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
335 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
336 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
337 %endif
338
339 %files devel
340 %defattr(644,root,root,755)
341 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
342 %{_libdir}/lib*.la
343 %{_includedir}/*
344
345 %files static
346 %defattr(644,root,root,755)
347 %{_libdir}/lib*.a
348
349 %if %{with python}
350 %files -n python-poldek
351 %defattr(644,root,root,755)
352 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
353 %{py_sitescriptdir}/poldek.py[co]
354 %{py_sitescriptdir}/poldekmod.py[co]
355 %endif
This page took 0.050325 seconds and 4 git commands to generate.