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