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