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