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