]>
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 |
0b18083b | 14 | %define SNAP 2019 |
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 | |
2ac70476 | 37 | %define rel 2 |
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 |
d7961a02 | 42 | Version: 0.40.0 |
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 |
d7961a02 | 47 | Source0: https://launchpad.net/poldek/master/head/+download/%{name}-%{version}.tar.xz |
48 | # Source0-md5: c88f3ada99799d0e1af78aeda428d041 | |
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 | |
d7961a02 | 63 | Patch0: %{name}-config.patch |
64 | Patch1: pm-hooks.patch | |
65 | Patch2: poldek-ext-down-enable.patch | |
66 | Patch3: multiple-options.patch | |
39ca2371 | 67 | URL: http://poldek.pld-linux.org/ |
340a1e21 | 68 | BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel} |
a4268952 | 69 | BuildRequires: autoconf |
4d0dcbcf | 70 | BuildRequires: automake >= 1:1.11 |
373c6f03 | 71 | BuildRequires: bzip2-devel |
065b86e0 | 72 | BuildRequires: check-devel |
1d67e563 | 73 | BuildRequires: docbook-dtd412-xml |
22329ccf | 74 | BuildRequires: gettext-tools |
0021c1c7 | 75 | BuildRequires: libgomp-devel |
b25cb9a7 JB |
76 | BuildRequires: libtool |
77 | BuildRequires: libxml2-devel | |
cbc6f56b | 78 | BuildRequires: openssl-devel >= 0.9.7d |
13fd950e | 79 | BuildRequires: pcre-devel |
b3ea4b51 | 80 | BuildRequires: pkgconfig |
13fd950e | 81 | BuildRequires: popt-devel |
58c31de0 | 82 | %{?with_python:BuildRequires: python-devel} |
b25cb9a7 | 83 | BuildRequires: readline-devel >= 5.0 |
373c6f03 | 84 | BuildRequires: rpm-devel >= %{ver_rpm} |
300927eb | 85 | %{?with_python:BuildRequires: rpm-pythonprov} |
340a1e21 | 86 | BuildRequires: tar >= 1:1.22 |
77cfda6e | 87 | BuildRequires: xmlto |
340a1e21 | 88 | BuildRequires: xz |
96475e5e | 89 | BuildRequires: zlib-devel |
d7961a02 | 90 | BuildRequires: zstd-devel |
373c6f03 | 91 | %if %{with static} |
ff4e68af | 92 | BuildRequires: %{db_pkg}-static >= %{ver_db}-%{ver_db_rel} |
340a1e21 | 93 | BuildRequires: bzip2-static |
2fac0b02 | 94 | BuildRequires: glibc-static |
b25cb9a7 | 95 | BuildRequires: libxml2-static |
373c6f03 JB |
96 | BuildRequires: ncurses-static |
97 | BuildRequires: openssl-static | |
98 | BuildRequires: pcre-static | |
99 | BuildRequires: popt-static | |
100 | BuildRequires: readline-static | |
101 | BuildRequires: rpm-static | |
102 | BuildRequires: zlib-static | |
d7961a02 | 103 | BuildRequires: zstd-static |
373c6f03 | 104 | %endif |
b25cb9a7 | 105 | Requires(triggerpostun): awk |
168acc54 | 106 | Requires(triggerpostun): sed >= 4.0 |
ff4e68af | 107 | Requires: %{db_pkg} >= %{ver_db}-%{ver_db_rel} |
340a1e21 | 108 | Requires: %{name}-libs = %{version}-%{release} |
67e6053c | 109 | Requires: /bin/run-parts |
373c6f03 | 110 | Requires: rpm >= %{ver_rpm} |
530c8c41 | 111 | Requires: rpm-db-ver = %{ver_db} |
5fda028a | 112 | Requires: rpm-lib >= %{ver_rpm} |
e202a52a | 113 | Requires: sed |
c5d1808a | 114 | Conflicts: etckeeper < 1.18-2 |
b44549bf | 115 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
116 | ||
dcdcebb7 ER |
117 | %define _libexecdir %{_prefix}/lib/%{name} |
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 |
b9e98057 | 232 | %patch3 -p1 |
8dcb75fc | 233 | |
5e2c5cc3 | 234 | %{__rm} m4/libtool.m4 m4/lt*.m4 |
b44549bf | 235 | |
0579f9b7 ER |
236 | # cleanup backups after patching |
237 | find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
4fa2b79c | 238 | chmod u+x ./configure ./doc/conf-xml2.sh |
0579f9b7 | 239 | |
b44549bf | 240 | %build |
5c81138a | 241 | %{__gettextize} |
bef9d2a3 | 242 | %{__libtoolize} |
21a83253 | 243 | %{__aclocal} -I m4 |
d878a63c | 244 | %{__autoheader} |
21a83253 MM |
245 | %{__autoconf} |
246 | %{__automake} | |
f8e81a61 | 247 | cd tndb |
313cd172 | 248 | %{__libtoolize} |
5e2c5cc3 JB |
249 | %{__aclocal} |
250 | %{__autoheader} | |
251 | %{__autoconf} | |
252 | %{__automake} | |
f8e81a61 | 253 | cd ../trurlib |
313cd172 | 254 | %{__libtoolize} |
5e2c5cc3 JB |
255 | %{__aclocal} |
256 | %{__autoheader} | |
257 | %{__autoconf} | |
258 | %{__automake} | |
f8e81a61 | 259 | cd .. |
b25cb9a7 | 260 | |
62cdc799 | 261 | CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline -D_GNU_SOURCE=1" |
1f84648f | 262 | %configure \ |
b25cb9a7 | 263 | %{?with_static:--enable-static --disable-shared} \ |
9fe14a3f | 264 | %{!?with_imode:--disable-imode} \ |
dcdcebb7 | 265 | --with-pkglibdir=%{_libexecdir} \ |
58c31de0 JB |
266 | --enable-nls \ |
267 | %{?with_python:--with-python} | |
9fb594dc | 268 | %{__make} -j1 |
a1f22296 | 269 | # --enable-trace |
8efee472 | 270 | |
9b77d5f3 JR |
271 | %if %{with python} |
272 | %{__make} -C python | |
273 | %endif | |
274 | ||
b44549bf | 275 | %install |
276 | rm -rf $RPM_BUILD_ROOT | |
c5d1808a | 277 | install -d $RPM_BUILD_ROOT/var/cache/%{name} |
8efee472 | 278 | |
9fb594dc | 279 | %{__make} install -j1 \ |
c8f7d829 | 280 | DESTDIR=$RPM_BUILD_ROOT |
de1099c4 | 281 | |
d9c7cedf ER |
282 | install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/poldek-config |
283 | ||
58c31de0 | 284 | %if %{with python} |
9fb594dc | 285 | %{__make} -C python -j1 install \ |
58c31de0 | 286 | DESTDIR=$RPM_BUILD_ROOT \ |
9b77d5f3 | 287 | py_sitedir=%{py_sitedir} |
58c31de0 JB |
288 | %endif |
289 | ||
5e2c5cc3 | 290 | %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp} |
a49836bb | 291 | |
9639596f | 292 | %ifarch i486 i686 ppc sparc alpha athlon |
bd621c72 | 293 | %define ftp_arch %{_target_cpu} |
36004ea3 | 294 | %endif |
9639596f | 295 | %ifarch %{x8664} |
bd621c72 ER |
296 | %define ftp_arch x86_64 |
297 | %define ftp_alt_arch i686 | |
298 | %define ftp_alt2_arch x32 | |
fabc4b40 JR |
299 | %endif |
300 | %ifarch x32 | |
bd621c72 ER |
301 | %define ftp_arch x32 |
302 | %define ftp_alt_arch x86_64 | |
303 | %define ftp_alt2_arch i686 | |
36004ea3 | 304 | %endif |
9639596f | 305 | %ifarch i586 |
bd621c72 | 306 | %define ftp_arch i486 |
58820d9b | 307 | %endif |
a49836bb | 308 | %ifarch pentium2 pentium3 pentium4 |
bd621c72 | 309 | %define ftp_arch i686 |
36004ea3 | 310 | %endif |
a49836bb | 311 | %ifarch sparcv9 sparc64 |
bd621c72 ER |
312 | %define ftp_arch sparc |
313 | %define ftp_arch %{_target_cpu} | |
b614e8f7 | 314 | %ifarch sparc64 |
bd621c72 | 315 | %define ftp_alt_arch sparcv9 |
23ead09a | 316 | %endif |
652b5bc5 | 317 | %endif |
32697bd0 | 318 | |
b614e8f7 JR |
319 | %define pld_conf %{SOURCE1} |
320 | %define pld_debuginfo_conf %{SOURCE8} | |
321 | %define pld_archive_conf %{SOURCE11} | |
7c0e4fc5 | 322 | |
fabc4b40 | 323 | %ifarch %{x8664} x32 |
b614e8f7 | 324 | %define pld_multilib_conf %{SOURCE2} |
fabc4b40 | 325 | %define pld_multilib2_conf %{SOURCE2} |
b614e8f7 | 326 | %endif |
7c0e4fc5 | 327 | |
b614e8f7 JR |
328 | # aidath |
329 | %ifarch sparcv9 sparc64 | |
330 | %define pld_conf %{SOURCE9} | |
331 | %undefine pld_archive_conf | |
332 | %endif | |
333 | %ifarch sparc64 | |
334 | %define pld_multilib_conf %{SOURCE10} | |
7c0e4fc5 | 335 | %endif |
23ead09a | 336 | |
bd621c72 | 337 | %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf |
23ead09a | 338 | |
7c0e4fc5 | 339 | %if 0%{?pld_multilib_conf:1} |
bd621c72 | 340 | %{__sed} 's|%%ARCH%%|%{ftp_alt_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf |
7c0e4fc5 ER |
341 | %endif |
342 | ||
fabc4b40 | 343 | %if 0%{?pld_multilib2_conf:1} |
bd621c72 | 344 | %{__sed} 's|%%ARCH%%|%{ftp_alt2_arch}|g' < %{pld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt2_arch}.conf |
fabc4b40 JR |
345 | %endif |
346 | ||
7c0e4fc5 | 347 | %if 0%{?pld_debuginfo_conf:1} |
bd621c72 | 348 | %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_debuginfo_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf |
652b5bc5 | 349 | %endif |
b25cb9a7 | 350 | |
8db66c11 | 351 | %if 0%{?pld_archive_conf:1} |
bd621c72 | 352 | %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' < %{pld_archive_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-archive.conf |
8db66c11 ER |
353 | %endif |
354 | ||
7e5296f4 | 355 | # Always install snapshot configs |
bd621c72 | 356 | %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' \ |
a584c5c5 | 357 | -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE100} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf |
bd621c72 | 358 | %{__sed} -e 's|%%ARCH%%|%{ftp_arch}|g' \ |
a584c5c5 | 359 | -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE102} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-debuginfo.conf |
fabc4b40 | 360 | %ifarch %{x8664} x32 |
bd621c72 ER |
361 | %{__sed} -e 's|%%ARCH%%|%{ftp_alt_arch}|g' \ |
362 | -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf | |
363 | %{__sed} -e 's|%%ARCH%%|%{ftp_alt2_arch}|g' \ | |
364 | -e 's|%%SNAP%%|%{SNAP}|g' < %{SOURCE101} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt2_arch}.conf | |
a584c5c5 | 365 | %endif |
7e5296f4 JR |
366 | |
367 | %if %{with snap} | |
c88cf671 | 368 | %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf |
7e5296f4 | 369 | %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf |
a584c5c5 | 370 | %else |
7e5296f4 | 371 | %{__sed} -i -e 's|@@SNAP@@||g' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf |
c88cf671 | 372 | %{__sed} -i '/@@SNAP@@.*/d' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf |
a584c5c5 JR |
373 | %endif |
374 | ||
600f8dbc ER |
375 | # create "all" meta repo |
376 | %if 0%{?ftp_alt_arch:1}%{?ftp_alt2_arch:1} | |
377 | cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-all.conf | |
378 | # group source for referring th+th-multiarch sources together, i.e poldek -n th-all | |
379 | [source] | |
380 | type = group | |
381 | name = th-all | |
382 | sources = th %{?ftp_alt_arch:th-%{ftp_alt_arch}} %{?ftp_alt2_arch:th-%{ftp_alt2_arch}} | |
383 | EOF | |
384 | %endif | |
385 | ||
8dbabc51 | 386 | # th-2014 snap does not exist for x32 yet |
bd621c72 | 387 | %if "%{ftp_arch}" == "x32" |
255ca68a ER |
388 | rm $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}.conf |
389 | %endif | |
bd621c72 | 390 | %if "%{ftp_alt2_arch}" == "x32" |
255ca68a ER |
391 | rm $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-x32.conf |
392 | %endif | |
8dbabc51 | 393 | |
27edf30a | 394 | cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf |
b25cb9a7 | 395 | |
9e6ff4ef | 396 | %if %{with imode} |
397 | # add desktop file and icon | |
398 | install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}} | |
27edf30a ER |
399 | cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop |
400 | cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png | |
9e6ff4ef | 401 | %endif |
402 | ||
b43abde7 | 403 | # sources we don't package |
5e2c5cc3 | 404 | %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf |
b25cb9a7 | 405 | # include them in %doc |
c88cf671 | 406 | %{__rm} -rf configs |
b25cb9a7 | 407 | cp -a conf configs |
c88cf671 | 408 | %{__rm} -f configs/Makefile* |
b25cb9a7 | 409 | |
62e80071 | 410 | %if %{with python} |
58c31de0 | 411 | %py_postclean |
9b77d5f3 | 412 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/_poldekmod.{la,so} |
62e80071 | 413 | %endif |
58c31de0 | 414 | |
b25cb9a7 | 415 | %find_lang %{name} |
f373d903 | 416 | |
b44549bf | 417 | %clean |
418 | rm -rf $RPM_BUILD_ROOT | |
419 | ||
daf0e7ce ER |
420 | %post |
421 | [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1 | |
422 | if [ "$1" = "1" ]; then | |
423 | # remove ignore = vserver-packages inside vserver on first install | |
424 | { | |
425 | while read f ctx; do | |
426 | [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break | |
427 | done </proc/self/status | |
428 | } 2>/dev/null | |
429 | if [ -z "$ctx" -o "$ctx" = "0" ]; then | |
430 | VSERVER=no | |
431 | else | |
432 | VSERVER=yes | |
433 | fi | |
434 | if [ "$VSERVER" = "yes" ]; then | |
435 | %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf | |
436 | fi | |
437 | fi | |
b25cb9a7 | 438 | |
3896c8b1 ER |
439 | %postun -p /sbin/postshell |
440 | -/usr/sbin/fix-info-dir -c %{_infodir} | |
b25cb9a7 JB |
441 | |
442 | %post libs -p /sbin/ldconfig | |
443 | %postun libs -p /sbin/ldconfig | |
444 | ||
b43abde7 ER |
445 | %triggerpostun -- poldek < 0.30-0.20080225.00.1 |
446 | if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then | |
447 | %{__sed} -i -e '/^%%include source.conf/{ | |
448 | a | |
449 | a# /etc/poldek/repos.d/*.conf | |
450 | a%%includedir repos.d | |
451 | }' %{_sysconfdir}/%{name}/poldek.conf | |
452 | fi | |
453 | ||
454 | %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf | |
455 | %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf | |
456 | ||
457 | if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then | |
505460c5 JR |
458 | %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew} |
459 | %{__mv} -v %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf | |
b43abde7 ER |
460 | fi |
461 | ||
462 | %ifarch %{x8664} | |
463 | if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then | |
505460c5 JR |
464 | %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew} |
465 | %{__mv} -v %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf | |
b43abde7 ER |
466 | fi |
467 | %endif | |
468 | ||
1bacc3e0 JR |
469 | %triggerpostun -- poldek < 0.30.1-3 |
470 | if [ -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf.rpmsave ]; then | |
bd621c72 ER |
471 | %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf{,.rpmnew} |
472 | %{__mv} -v %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-%{ftp_alt_arch}.conf | |
1bacc3e0 JR |
473 | fi |
474 | if [ -f %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf.rpmsave ]; then | |
bd621c72 ER |
475 | %{__mv} -f %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf{,.rpmnew} |
476 | %{__mv} -v %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-multilib.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-%{SNAP}-%{ftp_alt_arch}.conf | |
1bacc3e0 JR |
477 | fi |
478 | ||
c5d1808a ER |
479 | %triggerpostun -- %{name} < 0.30.1-8 |
480 | if [ $1 -le 1 ]; then | |
481 | # revert change on --downgrade | |
1e921240 | 482 | %{__sed} -i -re 's,^pm command = %{_libexecdir}/pm-command.sh,#&,' %{_sysconfdir}/%{name}/%{name}.conf |
c5d1808a ER |
483 | else |
484 | # setup pm command | |
1e921240 | 485 | %{__sed} -i -re 's,#?(pm command =).*,\1 %{_libexecdir}/pm-command.sh,' %{_sysconfdir}/%{name}/%{name}.conf |
c5d1808a ER |
486 | fi |
487 | ||
767366b0 | 488 | %files -f %{name}.lang |
b44549bf | 489 | %defattr(644,root,root,755) |
a9c9446a | 490 | %doc ChangeLog README* NEWS TODO configs |
b25cb9a7 | 491 | %dir %{_sysconfdir}/%{name} |
c5d1808a ER |
492 | %dir %{_sysconfdir}/%{name}/pre-install.d |
493 | %{_sysconfdir}/%{name}/pre-install.d/README | |
494 | %dir %{_sysconfdir}/%{name}/post-install.d | |
495 | %{_sysconfdir}/%{name}/post-install.d/README | |
08335479 | 496 | %dir %{_sysconfdir}/%{name}/repos.d |
168acc54 | 497 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf |
b43abde7 | 498 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf |
5e2c5cc3 JB |
499 | %attr(755,root,root) %{_bindir}/ipoldek |
500 | %attr(755,root,root) %{_bindir}/poldek | |
d9c7cedf | 501 | %attr(755,root,root) %{_bindir}/poldek-config |
5e2c5cc3 | 502 | %attr(755,root,root) %{_bindir}/rpmvercmp |
dcdcebb7 | 503 | %dir %{_libexecdir} |
c5d1808a | 504 | %attr(755,root,root) %{_libexecdir}/pm-command.sh |
36b5e8a1 ER |
505 | %attr(755,root,root) %{_libexecdir}/poldekuser-setup.sh |
506 | %attr(755,root,root) %{_libexecdir}/vfcompr | |
507 | %attr(755,root,root) %{_libexecdir}/vfjuggle | |
508 | %attr(755,root,root) %{_libexecdir}/vfsmb | |
509 | %attr(755,root,root) %{_libexecdir}/zlib-in-rpm.sh | |
5e2c5cc3 | 510 | %{_mandir}/man1/%{name}*.1* |
d8826405 | 511 | %lang(pl) %{_mandir}/pl/man1/%{name}* |
b25cb9a7 | 512 | %{_infodir}/poldek.info* |
9e6ff4ef | 513 | %if %{with imode} |
514 | %{_desktopdir}/%{name}.desktop | |
515 | %{_pixmapsdir}/%{name}.png | |
516 | %endif | |
27edf30a | 517 | %dir /var/cache/%{name} |
b25cb9a7 | 518 | |
b43abde7 | 519 | %if %{without static} |
b25cb9a7 JB |
520 | %files libs |
521 | %defattr(644,root,root,755) | |
d8aeff9a MB |
522 | %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.* |
523 | %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.* | |
524 | %attr(755,root,root) %{_libdir}/libtndb.so.*.*.* | |
525 | %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.* | |
526 | %attr(755,root,root) %{_libdir}/libvfile.so.*.*.* | |
527 | %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0 | |
528 | %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2 | |
529 | %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0 | |
530 | %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0 | |
531 | %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0 | |
b25cb9a7 JB |
532 | %endif |
533 | ||
534 | %files devel | |
535 | %defattr(644,root,root,755) | |
5e2c5cc3 JB |
536 | %if %{without static} |
537 | %attr(755,root,root) %{_libdir}/libpoclidek.so | |
538 | %attr(755,root,root) %{_libdir}/libpoldek.so | |
539 | %attr(755,root,root) %{_libdir}/libtndb.so | |
540 | %attr(755,root,root) %{_libdir}/libtrurl.so | |
541 | %attr(755,root,root) %{_libdir}/libvfile.so | |
542 | %endif | |
543 | %{_libdir}/libpoclidek.la | |
544 | %{_libdir}/libpoldek.la | |
545 | %{_libdir}/libtndb.la | |
546 | %{_libdir}/libtrurl.la | |
547 | %{_libdir}/libvfile.la | |
548 | %{_includedir}/poldek | |
549 | %{_includedir}/tndb | |
550 | %{_includedir}/trurl | |
551 | %{_includedir}/vfile | |
552 | %{_pkgconfigdir}/tndb.pc | |
c9a1a81d | 553 | %{_pkgconfigdir}/trurlib.pc |
b25cb9a7 JB |
554 | |
555 | %files static | |
556 | %defattr(644,root,root,755) | |
5e2c5cc3 JB |
557 | %{_libdir}/libtndb.a |
558 | %{_libdir}/libtrurl.a | |
58c31de0 JB |
559 | |
560 | %if %{with python} | |
561 | %files -n python-poldek | |
562 | %defattr(644,root,root,755) | |
563 | %attr(755,root,root) %{py_sitedir}/_poldekmod.so | |
564 | %{py_sitescriptdir}/poldek.py[co] | |
565 | %{py_sitescriptdir}/poldekmod.py[co] | |
566 | %endif |