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