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