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