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