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