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