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