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