]>
Commit | Line | Data |
---|---|---|
7638abfc | 1 | # |
de1099c4 | 2 | # Conditional build: |
9fe14a3f | 3 | %bcond_with static # don't use shared libraries |
4 | %bcond_without imode # don't build interactive mode | |
58c31de0 | 5 | %bcond_without python # don't build python bindings |
cf6c3a30 | 6 | %bcond_with snap # install configs for official Th snapshot |
1fde4642 | 7 | %bcond_with db61 # DB 6.1 instead of 5.2 |
dbf5b095 | 8 | %bcond_with rpm4 # use rpm4/db4.7 instead of rpm5 |
7000d724 | 9 | |
e1015166 | 10 | # current snapshot name |
42c61fde | 11 | %define SNAP 2014 |
a584c5c5 | 12 | |
373c6f03 | 13 | # required versions (forced to avoid SEGV with mixed db used by rpm and poldek) |
6e185c37 | 14 | # NOTE: poldek links with "system db" (-ldb) anyway if it exists |
1fde4642 JB |
15 | %if %{with db61} |
16 | %define db_pkg db6.1 | |
17 | %define ver_db 6.1 | |
6e185c37 JB |
18 | %define ver_db_rel 1 |
19 | %else | |
ff4e68af | 20 | %define db_pkg db5.2 |
376a705c | 21 | %define ver_db 5.2 |
19e679c6 | 22 | %define ver_db_rel 3 |
6e185c37 | 23 | %endif |
5fda028a ER |
24 | |
25 | %if %{with rpm4} | |
26 | %define ver_db 4.7.25 | |
27 | %define ver_db_rel 1 | |
28 | %define ver_rpm 4.5-49 | |
29 | %else | |
a17726b5 | 30 | %define ver_rpm 5.4.10 |
5fda028a | 31 | %endif |
7000d724 | 32 | |
5eb97c67 | 33 | %define rel 2 |
b44549bf | 34 | Summary: RPM packages management helper tool |
9c03ea8f | 35 | Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz |
9faf625a | 36 | Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM |
b44549bf | 37 | Name: poldek |
e8dadd74 | 38 | Version: 0.30.1 |
9c1c2b52 | 39 | Release: %{rel}%{?with_snap:.%{SNAP}} |
9f931ada | 40 | License: GPL v2 |
8efee472 | 41 | Group: Applications/System |
85398bac | 42 | #Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2 |
e5009a66 | 43 | Source0: http://carme.pld-linux.org/~megabajt/releases/poldek/%{name}-%{version}.tar.xz |
e8dadd74 | 44 | # Source0-md5: e569c8454df0932df53b09cee9998927 |
911a8560 | 45 | Source1: %{name}.conf |
b25cb9a7 | 46 | Source2: %{name}-multilib.conf |
2ccd5d66 | 47 | Source5: %{name}-aliases.conf |
48 | Source6: %{name}.desktop | |
49 | Source7: %{name}.png | |
171e07f6 | 50 | Source8: %{name}-debuginfo.conf |
652b5bc5 | 51 | Source9: %{name}-aidath.conf |
52 | Source10: %{name}-multilib-aidath.conf | |
8db66c11 | 53 | Source11: %{name}-archive.conf |
a584c5c5 JR |
54 | Source100: %{name}-snap.conf |
55 | Source101: %{name}-multilib-snap.conf | |
56 | Source102: %{name}-debuginfo-snap.conf | |
e5009a66 | 57 | Patch0: %{name}-size-type.patch |
e8dadd74 | 58 | Patch1: %{name}-config.patch |
39ca2371 | 59 | URL: http://poldek.pld-linux.org/ |
340a1e21 | 60 | BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel} |
a4268952 | 61 | BuildRequires: autoconf |
4d0dcbcf | 62 | BuildRequires: automake >= 1:1.11 |
373c6f03 | 63 | BuildRequires: bzip2-devel |
065b86e0 | 64 | BuildRequires: check-devel |
1d67e563 | 65 | BuildRequires: docbook-dtd412-xml |
22329ccf | 66 | BuildRequires: gettext-tools |
b25cb9a7 JB |
67 | BuildRequires: libtool |
68 | BuildRequires: libxml2-devel | |
fc37ede0 | 69 | BuildRequires: neon-devel |
cbc6f56b | 70 | BuildRequires: openssl-devel >= 0.9.7d |
13fd950e | 71 | BuildRequires: pcre-devel |
b3ea4b51 | 72 | BuildRequires: pkgconfig |
13fd950e | 73 | BuildRequires: popt-devel |
58c31de0 | 74 | %{?with_python:BuildRequires: python-devel} |
b25cb9a7 | 75 | BuildRequires: readline-devel >= 5.0 |
373c6f03 | 76 | BuildRequires: rpm-devel >= %{ver_rpm} |
300927eb | 77 | %{?with_python:BuildRequires: rpm-pythonprov} |
65a99b8b | 78 | BuildRequires: swig-python |
340a1e21 | 79 | BuildRequires: tar >= 1:1.22 |
77cfda6e | 80 | BuildRequires: xmlto |
340a1e21 | 81 | BuildRequires: xz |
96475e5e | 82 | BuildRequires: zlib-devel |
373c6f03 | 83 | %if %{with static} |
ff4e68af | 84 | BuildRequires: %{db_pkg}-static >= %{ver_db}-%{ver_db_rel} |
340a1e21 | 85 | BuildRequires: bzip2-static |
2fac0b02 | 86 | BuildRequires: glibc-static |
b25cb9a7 | 87 | BuildRequires: libxml2-static |
373c6f03 JB |
88 | BuildRequires: ncurses-static |
89 | BuildRequires: openssl-static | |
90 | BuildRequires: pcre-static | |
91 | BuildRequires: popt-static | |
92 | BuildRequires: readline-static | |
93 | BuildRequires: rpm-static | |
94 | BuildRequires: zlib-static | |
373c6f03 | 95 | %endif |
b25cb9a7 | 96 | Requires(triggerpostun): awk |
168acc54 | 97 | Requires(triggerpostun): sed >= 4.0 |
ff4e68af | 98 | Requires: %{db_pkg} >= %{ver_db}-%{ver_db_rel} |
340a1e21 | 99 | Requires: %{name}-libs = %{version}-%{release} |
373c6f03 | 100 | Requires: rpm >= %{ver_rpm} |
530c8c41 | 101 | Requires: rpm-db-ver = %{ver_db} |
5fda028a | 102 | Requires: rpm-lib >= %{ver_rpm} |
e202a52a ER |
103 | # vf* scripts use sed |
104 | Requires: sed | |
b44549bf | 105 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
106 | ||
dcdcebb7 ER |
107 | %define _libexecdir %{_prefix}/lib/%{name} |
108 | ||
b44549bf | 109 | %description |
0fa0dc36 | 110 | poldek is an RPM package management tool which allows you to easily |
111 | perform package verification, installation (including system | |
13fd950e | 112 | installation from scratch), upgrading, and removal. |
0fa0dc36 | 113 | |
13fd950e JB |
114 | Program can be used in batch (like apt-get from Debian's APT) or |
115 | interactive mode. The interactive mode puts you into a readline | |
116 | interface with command line autocompletion and history, similar to the | |
117 | shell mode of Perl's CPAN. | |
8efee472 | 118 | |
9fe14a3f | 119 | %{?with_static:This version is statically linked.} |
d94b28a6 | 120 | |
9fe14a3f | 121 | %{!?with_imode:This version hasn't got interactive mode.} |
7f07e487 | 122 | #'vim |
1f84648f | 123 | |
9c03ea8f ZU |
124 | %description -l hu.UTF-8 |
125 | poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a | |
126 | csomagellenőrzést, telepítést (beleértve a rendszertelepítést a | |
127 | nulláról), frissítést és eltávolítást. | |
128 | ||
129 | A program használható parancssorból (mint a Debian apt-get programja) | |
130 | vagy interaktív módban. Az interaktív mód egy readline környezetet | |
131 | jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN | |
132 | shell módjához. | |
133 | ||
134 | %{?with_static:Ez a verzió statikusan linkelt.} | |
135 | ||
136 | %{!?with_imode:Ennek a verziónak nincs interaktív módja.} | |
137 | ||
caed9b36 JR |
138 | %description -l pl.UTF-8 |
139 | poldek jest narzędziem linii poleceń służącym do weryfikacji, | |
140 | instalacji (włączając instalację systemu od zera), aktualizacji i | |
141 | usuwania pakietów. | |
56e1ab51 | 142 | |
caed9b36 | 143 | Program może być używany w trybie wsadowym (jak debianowy apt-get) lub |
d82a9cb2 | 144 | interaktywnym. Tryb interaktywny posiada interfejs readline z |
caed9b36 JR |
145 | dopełnianiem komend i historią, podobny do trybu shell perlowego |
146 | modułu CPAN. | |
8efee472 | 147 | |
9fe14a3f | 148 | %{?with_static:Ta wersja jest konsolidowana statycznie.} |
a611e0bc | 149 | |
9fe14a3f | 150 | %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.} |
b44549bf | 151 | |
b25cb9a7 | 152 | %package libs |
168acc54 | 153 | Summary: poldek libraries |
9c03ea8f | 154 | Summary(hu.UTF-8): A poldek könyvtárai |
9faf625a | 155 | Summary(pl.UTF-8): Biblioteki poldka |
168acc54 | 156 | Group: Libraries |
b25cb9a7 JB |
157 | |
158 | %description libs | |
159 | poldek libraries. | |
160 | ||
9c03ea8f ZU |
161 | %description libs -l hu.UTF-8 |
162 | A poldek könyvtárai. | |
163 | ||
caed9b36 | 164 | %description libs -l pl.UTF-8 |
b25cb9a7 JB |
165 | Biblioteki poldka. |
166 | ||
167 | %package devel | |
168acc54 | 168 | Summary: Header files for poldek libraries |
9c03ea8f | 169 | Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai |
9faf625a | 170 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka |
168acc54 | 171 | Group: Development/Libraries |
09d4c571 | 172 | Requires: %{name}-libs = %{version}-%{release} |
b980560b | 173 | Requires: rpm-devel >= %{ver_rpm} |
b25cb9a7 JB |
174 | |
175 | %description devel | |
176 | Header files for poldek libraries. | |
177 | ||
9c03ea8f ZU |
178 | %description devel -l hu.UTF-8 |
179 | A poldek könyvtár fejlesztői fájljai. | |
180 | ||
caed9b36 JR |
181 | %description devel -l pl.UTF-8 |
182 | Pliki nagłówkowe bibliotek poldka. | |
b25cb9a7 JB |
183 | |
184 | %package static | |
168acc54 | 185 | Summary: poldek static libraries |
9c03ea8f | 186 | Summary(hu.UTF-8): poldek statikus könyvtárak |
9faf625a | 187 | Summary(pl.UTF-8): Biblioteki statyczne poldka |
168acc54 | 188 | Group: Development/Libraries |
09d4c571 | 189 | Requires: %{name}-devel = %{version}-%{release} |
b25cb9a7 JB |
190 | |
191 | %description static | |
192 | poldek static libraries. | |
193 | ||
9c03ea8f ZU |
194 | %description static -l hu.UTF-8 |
195 | poldek statikus könyvtárak. | |
196 | ||
caed9b36 | 197 | %description static -l pl.UTF-8 |
b25cb9a7 JB |
198 | Biblioteki statyczne poldka. |
199 | ||
58c31de0 JB |
200 | %package -n python-poldek |
201 | Summary: Python modules for poldek | |
9c03ea8f | 202 | Summary(hu.UTF-8): Python modulok poldek-hez |
9faf625a | 203 | Summary(pl.UTF-8): Moduły języka Python dla poldka |
58c31de0 JB |
204 | Group: Libraries/Python |
205 | Requires: %{name}-libs = %{version}-%{release} | |
340a1e21 | 206 | Requires: python-libs |
58c31de0 JB |
207 | |
208 | %description -n python-poldek | |
209 | Python modules for poldek. | |
210 | ||
9c03ea8f ZU |
211 | %description -n python-poldek -l hu.UTF-8 |
212 | Python modulok poldek-hez. | |
213 | ||
caed9b36 JR |
214 | %description -n python-poldek -l pl.UTF-8 |
215 | Moduły języka Python dla poldka. | |
58c31de0 | 216 | |
03159b71 | 217 | %prep |
a9c9446a | 218 | %setup -q |
85398bac | 219 | %patch0 -p1 |
13aa6434 | 220 | %patch1 -p1 |
8dcb75fc | 221 | |
5e2c5cc3 | 222 | %{__rm} m4/libtool.m4 m4/lt*.m4 |
b44549bf | 223 | |
0579f9b7 ER |
224 | # cleanup backups after patching |
225 | find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
4fa2b79c | 226 | chmod u+x ./configure ./doc/conf-xml2.sh |
0579f9b7 | 227 | |
b44549bf | 228 | %build |
5c81138a | 229 | %{__gettextize} |
bef9d2a3 | 230 | %{__libtoolize} |
21a83253 | 231 | %{__aclocal} -I m4 |
d878a63c | 232 | %{__autoheader} |
21a83253 MM |
233 | %{__autoconf} |
234 | %{__automake} | |
f8e81a61 | 235 | cd tndb |
313cd172 | 236 | %{__libtoolize} |
5e2c5cc3 JB |
237 | %{__aclocal} |
238 | %{__autoheader} | |
239 | %{__autoconf} | |
240 | %{__automake} | |
f8e81a61 | 241 | cd ../trurlib |
313cd172 | 242 | %{__libtoolize} |
5e2c5cc3 JB |
243 | %{__aclocal} |
244 | %{__autoheader} | |
245 | %{__autoconf} | |
246 | %{__automake} | |
f8e81a61 | 247 | cd .. |
b25cb9a7 | 248 | |
3e975db6 | 249 | CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline" |
1f84648f | 250 | %configure \ |
b25cb9a7 | 251 | %{?with_static:--enable-static --disable-shared} \ |
9fe14a3f | 252 | %{!?with_imode:--disable-imode} \ |
dcdcebb7 | 253 | --with-pkglibdir=%{_libexecdir} \ |
58c31de0 JB |
254 | --enable-nls \ |
255 | %{?with_python:--with-python} | |
9fb594dc | 256 | %{__make} -j1 |
a1f22296 | 257 | # --enable-trace |
8efee472 | 258 | |
b44549bf | 259 | %install |
260 | rm -rf $RPM_BUILD_ROOT | |
27edf30a | 261 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}} |
8efee472 | 262 | |
9fb594dc | 263 | %{__make} install -j1 \ |
c8f7d829 | 264 | DESTDIR=$RPM_BUILD_ROOT |
de1099c4 | 265 | |
58c31de0 | 266 | %if %{with python} |
9fb594dc | 267 | %{__make} -C python -j1 install \ |
58c31de0 JB |
268 | DESTDIR=$RPM_BUILD_ROOT \ |
269 | libdir=%{py_sitedir} | |
270 | %endif | |
271 | ||
5e2c5cc3 | 272 | %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp} |
a49836bb | 273 | |
9639596f | 274 | %ifarch i486 i686 ppc sparc alpha athlon |
23ead09a | 275 | %define _ftp_arch %{_target_cpu} |
36004ea3 | 276 | %endif |
9639596f | 277 | %ifarch %{x8664} |
23ead09a ER |
278 | %define _ftp_arch x86_64 |
279 | %define _ftp_alt_arch i686 | |
fabc4b40 JR |
280 | %define _ftp_alt2_arch x32 |
281 | %endif | |
282 | %ifarch x32 | |
283 | %define _ftp_arch x32 | |
284 | %define _ftp_alt_arch x86_64 | |
285 | %define _ftp_alt2_arch i686 | |
36004ea3 | 286 | %endif |
9639596f | 287 | %ifarch i586 |
b614e8f7 | 288 | %define _ftp_arch i486 |
58820d9b | 289 | %endif |
a49836bb | 290 | %ifarch pentium2 pentium3 pentium4 |
23ead09a | 291 | %define _ftp_arch i686 |
36004ea3 | 292 | %endif |
a49836bb | 293 | %ifarch sparcv9 sparc64 |
23ead09a | 294 | %define _ftp_arch sparc |
b614e8f7 JR |
295 | %define _ftp_arch %{_target_cpu} |
296 | %ifarch sparc64 | |
23ead09a | 297 | %define _ftp_alt_arch sparcv9 |
23ead09a | 298 | %endif |
652b5bc5 | 299 | %endif |
32697bd0 | 300 | |
b614e8f7 JR |
301 | %define pld_conf %{SOURCE1} |
302 | %define pld_debuginfo_conf %{SOURCE8} | |
303 | %define pld_archive_conf %{SOURCE11} | |
7c0e4fc5 | 304 | |
fabc4b40 | 305 | %ifarch %{x8664} x32 |
b614e8f7 | 306 | %define pld_multilib_conf %{SOURCE2} |
fabc4b40 | 307 | %define pld_multilib2_conf %{SOURCE2} |
b614e8f7 | 308 | %endif |
7c0e4fc5 | 309 | |
b614e8f7 JR |
310 | # aidath |
311 | %ifarch sparcv9 sparc64 | |
312 | %define pld_conf %{SOURCE9} | |
313 | %undefine pld_archive_conf | |
314 | %endif | |
315 | %ifarch sparc64 | |
316 | %define pld_multilib_conf %{SOURCE10} | |
7c0e4fc5 | 317 | %endif |
23ead09a | 318 | |
c88cf671 | 319 | %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf |
23ead09a | 320 | |
7c0e4fc5 | 321 | %if 0%{?pld_multilib_conf:1} |
c88cf671 | 322 | %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf |
7c0e4fc5 ER |
323 | %endif |
324 | ||
fabc4b40 JR |
325 | %if 0%{?pld_multilib2_conf:1} |
326 | %{__sed} 's|%%ARCH%%|%{_ftp_alt2_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib2.conf | |
327 | %endif | |
328 | ||
7c0e4fc5 | 329 | %if 0%{?pld_debuginfo_conf:1} |
c88cf671 | 330 | %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf |
652b5bc5 | 331 | %endif |
b25cb9a7 | 332 | |
8db66c11 | 333 | %if 0%{?pld_archive_conf:1} |
c88cf671 | 334 | %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf |
8db66c11 ER |
335 | %endif |
336 | ||
7e5296f4 | 337 | # Always install snapshot configs |
c88cf671 | 338 | %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \ |
a584c5c5 | 339 | -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf |
c88cf671 | 340 | %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' \ |
a584c5c5 | 341 | -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE102} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-debuginfo.conf |
fabc4b40 | 342 | %ifarch %{x8664} x32 |
c88cf671 | 343 | %{__sed} -e 's|%%ARCH%%|%{_ftp_alt_arch}|g' \ |
a584c5c5 | 344 | -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf |
fabc4b40 JR |
345 | %{__sed} -e 's|%%ARCH%%|%{_ftp_alt2_arch}|g' \ |
346 | -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib2.conf | |
a584c5c5 | 347 | %endif |
7e5296f4 JR |
348 | |
349 | %if %{with snap} | |
c88cf671 | 350 | %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf |
7e5296f4 | 351 | %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf |
a584c5c5 | 352 | %else |
7e5296f4 | 353 | %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf |
c88cf671 | 354 | %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf |
a584c5c5 JR |
355 | %endif |
356 | ||
27edf30a | 357 | cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf |
b25cb9a7 | 358 | |
9e6ff4ef | 359 | %if %{with imode} |
360 | # add desktop file and icon | |
361 | install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}} | |
27edf30a ER |
362 | cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop |
363 | cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png | |
9e6ff4ef | 364 | %endif |
365 | ||
b43abde7 | 366 | # sources we don't package |
5e2c5cc3 | 367 | %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf |
b25cb9a7 | 368 | # include them in %doc |
c88cf671 | 369 | %{__rm} -rf configs |
b25cb9a7 | 370 | cp -a conf configs |
c88cf671 | 371 | %{__rm} -f configs/Makefile* |
b25cb9a7 | 372 | |
62e80071 | 373 | %if %{with python} |
58c31de0 | 374 | %py_postclean |
5e2c5cc3 | 375 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la |
62e80071 | 376 | %endif |
58c31de0 | 377 | |
b25cb9a7 | 378 | %find_lang %{name} |
f373d903 | 379 | |
b44549bf | 380 | %clean |
381 | rm -rf $RPM_BUILD_ROOT | |
382 | ||
daf0e7ce ER |
383 | %post |
384 | [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1 | |
385 | if [ "$1" = "1" ]; then | |
386 | # remove ignore = vserver-packages inside vserver on first install | |
387 | { | |
388 | while read f ctx; do | |
389 | [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break | |
390 | done </proc/self/status | |
391 | } 2>/dev/null | |
392 | if [ -z "$ctx" -o "$ctx" = "0" ]; then | |
393 | VSERVER=no | |
394 | else | |
395 | VSERVER=yes | |
396 | fi | |
397 | if [ "$VSERVER" = "yes" ]; then | |
398 | %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf | |
399 | fi | |
400 | fi | |
b25cb9a7 | 401 | |
3896c8b1 ER |
402 | %postun -p /sbin/postshell |
403 | -/usr/sbin/fix-info-dir -c %{_infodir} | |
b25cb9a7 JB |
404 | |
405 | %post libs -p /sbin/ldconfig | |
406 | %postun libs -p /sbin/ldconfig | |
407 | ||
b25cb9a7 JB |
408 | %triggerpostun -- poldek < 0.19.0-1.20050613.22.0 |
409 | if [ -f /etc/poldek.conf.rpmsave ]; then | |
410 | awk '/^source/ { | |
411 | name = $3; | |
412 | path = $4; | |
413 | auto = "yes"; | |
414 | autoup = "yes"; | |
415 | type = "pdir"; | |
f154dd55 | 416 | pri = ""; |
b25cb9a7 JB |
417 | |
418 | if (sub(",noauto", "", name)) { | |
419 | auto = "no"; | |
420 | } | |
421 | ||
f154dd55 ER |
422 | # process pri=\d+ |
423 | if (match(name, /,pri=[0-9]+/)) { | |
424 | pri = substr(name, RSTART + 5, RLENGTH - 5); | |
425 | name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH); | |
426 | } | |
427 | ||
b25cb9a7 JB |
428 | # skip ac sources. already in new config. |
429 | if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) { | |
430 | print ""; | |
431 | print "[source]"; | |
432 | print "name = " name; | |
433 | print "type = " type; | |
434 | print "path = " path; | |
435 | print "auto = " auto; | |
436 | print "autoup = " autoup; | |
f154dd55 ER |
437 | if (pri) { |
438 | print "pri = " pri; | |
439 | } | |
b25cb9a7 JB |
440 | } |
441 | ||
442 | }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf | |
19cae196 | 443 | echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf" |
b25cb9a7 JB |
444 | |
445 | # copy hold= | |
446 | hold=$(grep ^hold /etc/poldek.conf.rpmsave) | |
447 | if [ "$hold" ]; then | |
c88cf671 | 448 | %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf |
b25cb9a7 JB |
449 | fi |
450 | fi | |
451 | ||
b43abde7 ER |
452 | %triggerpostun -- poldek < 0.30-0.20080225.00.1 |
453 | if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then | |
454 | %{__sed} -i -e '/^%%include source.conf/{ | |
455 | a | |
456 | a# /etc/poldek/repos.d/*.conf | |
457 | a%%includedir repos.d | |
458 | }' %{_sysconfdir}/%{name}/poldek.conf | |
459 | fi | |
460 | ||
461 | %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf | |
462 | %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf | |
463 | ||
464 | if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then | |
465 | cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew} | |
478b6a69 | 466 | cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf |
b43abde7 ER |
467 | fi |
468 | ||
469 | %ifarch %{x8664} | |
470 | if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then | |
471 | cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew} | |
478b6a69 | 472 | cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf |
b43abde7 ER |
473 | fi |
474 | %endif | |
475 | ||
767366b0 | 476 | %files -f %{name}.lang |
b44549bf | 477 | %defattr(644,root,root,755) |
a9c9446a | 478 | %doc ChangeLog README* NEWS TODO configs |
b25cb9a7 | 479 | %dir %{_sysconfdir}/%{name} |
08335479 | 480 | %dir %{_sysconfdir}/%{name}/repos.d |
168acc54 | 481 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf |
b43abde7 | 482 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf |
5e2c5cc3 JB |
483 | %attr(755,root,root) %{_bindir}/ipoldek |
484 | %attr(755,root,root) %{_bindir}/poldek | |
485 | %attr(755,root,root) %{_bindir}/rpmvercmp | |
dcdcebb7 ER |
486 | %dir %{_libexecdir} |
487 | %attr(755,root,root) %{_libexecdir}/* | |
5e2c5cc3 | 488 | %{_mandir}/man1/%{name}*.1* |
d8826405 | 489 | %lang(pl) %{_mandir}/pl/man1/%{name}* |
b25cb9a7 | 490 | %{_infodir}/poldek.info* |
9e6ff4ef | 491 | %if %{with imode} |
492 | %{_desktopdir}/%{name}.desktop | |
493 | %{_pixmapsdir}/%{name}.png | |
494 | %endif | |
27edf30a | 495 | %dir /var/cache/%{name} |
b25cb9a7 | 496 | |
b43abde7 | 497 | %if %{without static} |
b25cb9a7 JB |
498 | %files libs |
499 | %defattr(644,root,root,755) | |
d8aeff9a MB |
500 | %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.* |
501 | %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.* | |
502 | %attr(755,root,root) %{_libdir}/libtndb.so.*.*.* | |
503 | %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.* | |
504 | %attr(755,root,root) %{_libdir}/libvfile.so.*.*.* | |
505 | %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0 | |
506 | %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2 | |
507 | %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0 | |
508 | %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0 | |
509 | %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0 | |
b25cb9a7 JB |
510 | %endif |
511 | ||
512 | %files devel | |
513 | %defattr(644,root,root,755) | |
5e2c5cc3 JB |
514 | %if %{without static} |
515 | %attr(755,root,root) %{_libdir}/libpoclidek.so | |
516 | %attr(755,root,root) %{_libdir}/libpoldek.so | |
517 | %attr(755,root,root) %{_libdir}/libtndb.so | |
518 | %attr(755,root,root) %{_libdir}/libtrurl.so | |
519 | %attr(755,root,root) %{_libdir}/libvfile.so | |
520 | %endif | |
521 | %{_libdir}/libpoclidek.la | |
522 | %{_libdir}/libpoldek.la | |
523 | %{_libdir}/libtndb.la | |
524 | %{_libdir}/libtrurl.la | |
525 | %{_libdir}/libvfile.la | |
526 | %{_includedir}/poldek | |
527 | %{_includedir}/tndb | |
528 | %{_includedir}/trurl | |
529 | %{_includedir}/vfile | |
530 | %{_pkgconfigdir}/tndb.pc | |
c9a1a81d | 531 | %{_pkgconfigdir}/trurlib.pc |
b25cb9a7 JB |
532 | |
533 | %files static | |
534 | %defattr(644,root,root,755) | |
5e2c5cc3 JB |
535 | %{_libdir}/libtndb.a |
536 | %{_libdir}/libtrurl.a | |
58c31de0 JB |
537 | |
538 | %if %{with python} | |
539 | %files -n python-poldek | |
540 | %defattr(644,root,root,755) | |
541 | %attr(755,root,root) %{py_sitedir}/_poldekmod.so | |
542 | %{py_sitescriptdir}/poldek.py[co] | |
543 | %{py_sitescriptdir}/poldekmod.py[co] | |
544 | %endif |