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