]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
- ignore vserver-packages in default install
[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 #
6 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
7 %define ver_db  4.3.27-1
8 %define ver_rpm 4.4.3
9 Summary:        RPM packages management helper tool
10 Summary(pl):    Pomocnicze narzêdzie do zarz±dzania pakietami RPM
11 Name:           poldek
12 Version:        0.20
13 Release:        5
14 License:        GPL v2
15 Group:          Applications/System
16 Source0:        http://poldek.pld-linux.org/download/%{name}-%{version}.tar.bz2
17 # Source0-md5:  61c0c03ee4a9de36339fc943b6901266
18 Source1:        %{name}.conf
19 Source2:        %{name}-multilib.conf
20 Source3:        %{name}-aliases.conf
21 # drop?
22 #PatchX:        %{name}-etc_dir.patch
23 # drop?
24 #PatchX:        %{name}-retr_term.patch
25 # is still needed?
26 #Patch2:        %{name}-simplestatic.patch
27 Patch0:         %{name}-cvs-fixes.patch
28 Patch1:         %{name}-ask-abort.patch
29 Patch2:         %{name}-obsoletes.patch
30 Patch3:         %{name}-rpm_4_4_3.patch
31 Patch4:         %{name}-cli-hist.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:  popt-devel
45 BuildRequires:  readline-devel >= 5.0
46 BuildRequires:  rpm-devel >= %{ver_rpm}
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 %prep
135 %setup -q
136 %patch0 -p2
137 %patch1 -p0
138 %patch2 -p0
139 %patch3 -p0
140 %patch4 -p2
141
142 %build
143 %{__autopoint}
144 %{__aclocal} -I m4
145 %{__autoconf}
146 %{__automake}
147 cp -f config.sub trurlib
148
149 %configure \
150         %{?with_static:--enable-static --disable-shared} \
151         %{!?with_imode:--disable-imode} \
152         --enable-nls
153 %{__make}
154
155 %install
156 rm -rf $RPM_BUILD_ROOT
157 install -d $RPM_BUILD_ROOT%{_sysconfdir}
158
159 %{__make} install \
160         DESTDIR=$RPM_BUILD_ROOT
161
162 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
163
164 %ifarch i486 i686 ppc sparc alpha athlon
165 %define         _ftp_arch       %{_target_cpu}
166 %else
167 %ifarch %{x8664}
168 %define         _ftp_arch       x86_64
169 %define         _ftp_alt_arch   i686
170 %else
171 %ifarch i586
172 %define         _ftp_arch       i486
173 %else
174 %ifarch pentium2 pentium3 pentium4
175 %define         _ftp_arch       i686
176 %else
177 %ifarch sparcv9 sparc64
178 %define         _ftp_arch       sparc
179 %endif
180 %endif
181 %endif
182 %endif
183 %endif
184
185 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
186
187 sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
188 %ifarch %{x8664}
189         -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
190 %else
191         -e '/%%ALT_ARCH%%/d' \
192 %endif
193         < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
194
195 %ifarch %{x8664}
196 sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
197 %endif
198
199 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
200
201 # get rid of non-pld sources
202 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
203 # include them in %doc
204 rm -rf configs
205 cp -a conf configs
206 rm -f configs/Makefile*
207
208 %find_lang %{name}
209
210 %clean
211 rm -rf $RPM_BUILD_ROOT
212
213 %post
214 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
215
216 %postun
217 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
218
219 %post   libs -p /sbin/ldconfig
220 %postun libs -p /sbin/ldconfig
221
222 %triggerpostun -- poldek <= 0.18.3-5
223 if [ -f /etc/poldek.conf ]; then
224         sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
225 fi
226
227 # otherwise don't touch
228 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
229 %triggerpostun -- poldek <= 0.18.7-1
230 if [ -f /etc/poldek.conf ]; then
231         sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
232 fi
233 %endif
234
235 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
236 if [ -f /etc/poldek.conf.rpmsave ]; then
237         awk '/^source/ {
238         name = $3;
239         path = $4;
240         auto = "yes";
241         autoup = "yes";
242         type = "pdir";
243         pri = "";
244
245         if (sub(",noauto", "", name)) {
246                 auto = "no";
247         }
248
249         # process pri=\d+
250         if (match(name, /,pri=[0-9]+/)) {
251                 pri = substr(name, RSTART + 5, RLENGTH - 5);
252                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
253         }
254
255         # skip ac sources. already in new config.
256         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
257                 print "";
258                 print "[source]";
259                 print "name = " name;
260                 print "type = " type;
261                 print "path = " path;
262                 print "auto = " auto;
263                 print "autoup = " autoup;
264                 if (pri) {
265                         print "pri = " pri;
266                 }
267         }
268
269         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
270         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
271
272         # copy hold=
273         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
274         if [ "$hold" ]; then
275                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
276         fi
277 fi
278
279 %files -f %{name}.lang
280 %defattr(644,root,root,755)
281 %doc README* NEWS TODO configs/
282 %dir %{_sysconfdir}/%{name}
283 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
284 %attr(755,root,root) %{_bindir}/*
285 %dir %{_libdir}/%{name}
286 %attr(755,root,root) %{_libdir}/%{name}/*
287 %{_mandir}/man1/%{name}*
288 %lang(pl) %{_mandir}/pl/man1/%{name}*
289 %{_infodir}/poldek.info*
290
291 %if %{without static}
292 %files libs
293 %defattr(644,root,root,755)
294 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
295 %endif
296
297 %files devel
298 %defattr(644,root,root,755)
299 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
300 %{_libdir}/lib*.la
301 %{_includedir}/*
302
303 %files static
304 %defattr(644,root,root,755)
305 %{_libdir}/lib*.a
This page took 0.435836 seconds and 3 git commands to generate.