]>
Commit | Line | Data |
---|---|---|
1 | # PLD rpm macros | |
2 | ||
3 | # other macros | |
4 | %epoch 0 | |
5 | %_enable_debug_packages 1 | |
6 | ||
7 | %__id @__ID@ | |
8 | %__id_u %{__id} -u | |
9 | %__chown_Rhf @__CHOWN_RHF@ | |
10 | %__chgrp_Rhf @__CHGRP_RHF@ | |
11 | ||
12 | %_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root:@ROOT_GROUP@ | |
13 | %_fixgroup true | |
14 | %_fixperms %{__chmod} -Rf @FIXPERMS@ | |
15 | %_topdir %(echo $HOME)/rpm | |
16 | #----------------------------------------------------------------- | |
17 | # CFLAGS and LDFLAGS used to build | |
18 | ||
19 | %debuginfocflags %{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1: -ggdb}%{expand:%%undefine __dic_%{?_enable_debug_packages}} | |
20 | ||
21 | %debugcflags -O0 -g -Wall | |
22 | %rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags} | |
23 | %rpmcxxflags %{rpmcflags} -fvisibility-inlines-hidden | |
24 | %rpmldflags %{nil} | |
25 | ||
26 | # kernel compiler | |
27 | %kgcc gcc | |
28 | %kgcc_package gcc | |
29 | ||
30 | # Build system path macros. | |
31 | # | |
32 | %__libtoolize libtoolize --copy --force | |
33 | %__gettextize { \ | |
34 | if ! gettextize --version | grep -q '0\.10\.' ; then \ | |
35 | if grep -qs 'AM_GNU_GETTEXT.*external' configure.{ac,in} ; then \ | |
36 | gettextize --copy --force --no-changelog; \ | |
37 | else \ | |
38 | gettextize --copy --force --no-changelog --intl; \ | |
39 | fi; \ | |
40 | if [ ! -f po/Makevars ]; then \ | |
41 | cp -f po/Makevars{.template,}; \ | |
42 | fi; \ | |
43 | else \ | |
44 | gettextize --copy --force; \ | |
45 | fi; \ | |
46 | } | |
47 | %__autopoint autopoint --force | |
48 | %__automake automake -a -c -f --foreign | |
49 | %__autoconf autoconf %{?debug:-Wall} | |
50 | ||
51 | %dependencytracking %{nil} | |
52 | #----------------------------------------------------------------- | |
53 | %configure2_13 { \ | |
54 | if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \ | |
55 | LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \ | |
56 | CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \ | |
57 | CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" ; export CXXFLAGS ; \ | |
58 | FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \ | |
59 | CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \ | |
60 | %{?__cc:CC="%{__cc}" ; export CC ; } \ | |
61 | %{?__cxx:CXX="%{__cxx}" ; export CXX ; } \ | |
62 | %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \ | |
63 | --host=%{_target_platform} \ | |
64 | --prefix=%{_prefix} \ | |
65 | --exec-prefix=%{_exec_prefix} \ | |
66 | --bindir=%{_bindir} \ | |
67 | --sbindir=%{_sbindir} \ | |
68 | --sysconfdir=%{_sysconfdir} \ | |
69 | --datadir=%{_datadir} \ | |
70 | --includedir=%{_includedir} \ | |
71 | --libdir=%{_libdir} \ | |
72 | --libexecdir=%{_libexecdir} \ | |
73 | --localstatedir=%{_localstatedir} \ | |
74 | --sharedstatedir=%{_sharedstatedir} \ | |
75 | --mandir=%{_mandir} \ | |
76 | --infodir=%{_infodir} \ | |
77 | --x-libraries=/usr/X11R6/%{_lib} \ | |
78 | %{dependencytracking} \ | |
79 | } | |
80 | ||
81 | #---------------------------------------------------------------- | |
82 | %configure {./configure \ | |
83 | LDFLAGS="${LDFLAGS:-%rpmldflags}" \ | |
84 | CFLAGS="${CFLAGS:-%rpmcflags}" \ | |
85 | CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" \ | |
86 | FFLAGS="${FFLAGS:-%rpmcflags}" \ | |
87 | CPPFLAGS="${CPPFLAGS:-}" \ | |
88 | %{?__cc:CC="%{__cc}"} \ | |
89 | %{?__cxx:CXX="%{__cxx}"} \ | |
90 | --build=%{_target_platform} \ | |
91 | --prefix=%{_prefix} \ | |
92 | --exec-prefix=%{_exec_prefix} \ | |
93 | --bindir=%{_bindir} \ | |
94 | --sbindir=%{_sbindir} \ | |
95 | --sysconfdir=%{_sysconfdir} \ | |
96 | --datadir=%{_datadir} \ | |
97 | --includedir=%{_includedir} \ | |
98 | --libdir=%{_libdir} \ | |
99 | --libexecdir=%{_libexecdir} \ | |
100 | --localstatedir=%{_localstatedir} \ | |
101 | --sharedstatedir=%{_sharedstatedir} \ | |
102 | --mandir=%{_mandir} \ | |
103 | --infodir=%{_infodir} \ | |
104 | --x-libraries=/usr/X11R6/%{_lib} \ | |
105 | %{dependencytracking} \ | |
106 | } | |
107 | ||
108 | # ------------------------------------------------------------------------ | |
109 | # Overloading of some basic macros | |
110 | %prep \ | |
111 | %%prep\ | |
112 | LANG=C\ | |
113 | export LANG\ | |
114 | unset DISPLAY ||:\ | |
115 | %{nil} | |
116 | ||
117 | %build %%build\ | |
118 | LANG=C\ | |
119 | export LANG\ | |
120 | unset DISPLAY ||:\ | |
121 | %{nil} | |
122 | ||
123 | %install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\ | |
124 | %%install\ | |
125 | LANG=C\ | |
126 | export LANG\ | |
127 | unset DISPLAY ||:\ | |
128 | %{nil} | |
129 | ||
130 | # ------------------------------------------------------------------------ | |
131 | # Conditional build stuff. | |
132 | ||
133 | # Check if symbol is defined. | |
134 | # Example usage: %if %{defined with_foo} && %{undefined with_bar} ... | |
135 | %defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}} | |
136 | %undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}} | |
137 | ||
138 | # Shorthand for %{defined with_...} | |
139 | %with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}} | |
140 | %without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}} | |
141 | ||
142 | # Handle conditional builds. %bcond_with is for case when feature is | |
143 | # default off and needs to be activated with --with ... command line | |
144 | # switch. %bcond_without is for the dual case. | |
145 | # | |
146 | # %bcond_with foo defines symbol with_foo if --with foo was specified on | |
147 | # command line. | |
148 | # %bcond_without foo defines symbol with_foo if --without foo was *not* | |
149 | # specified on command line. | |
150 | # | |
151 | # For example: | |
152 | # | |
153 | # %bcond_with extra_fonts | |
154 | # %bcond_without static | |
155 | # %if %{with extra_fonts} | |
156 | # ... | |
157 | # %endif | |
158 | # %ifdef %{with static} | |
159 | # ... | |
160 | # %endif | |
161 | # %{?with_static: ... } | |
162 | # %{!?with_static: ... } | |
163 | # %{?with_extra_fonts: ... } | |
164 | # %{!?with_extra_fonts: ... } | |
165 | # | |
166 | # The bottom line: never use without_foo, _with_foo nor _without_foo, only | |
167 | # with_foo. This way changing default set of bconds for given spec is just | |
168 | # a matter of changing single line in it and syntax is more readable. | |
169 | %bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}} | |
170 | %bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}} | |
171 | # ------------------------------------------------------------------------ | |
172 | ||
173 | # Location of autoconf macros | |
174 | %_aclocaldir %(aclocal --print-ac-dir) | |
175 | ||
176 | # Location of omf files | |
177 | %_omf_dest_dir %(scrollkeeper-config --omfdir) | |
178 | ||
179 | # Location of pkgconfig files | |
180 | %_pkgconfigdir /usr/%{_lib}/pkgconfig | |
181 | ||
182 | # Location of top applink dir | |
183 | %_applnkdir /usr/X11R6/share/applnk | |
184 | ||
185 | # Location of desktop files | |
186 | %_desktopdir /usr/share/applications | |
187 | ||
188 | # Location of pixmaps for applnk/desktop files | |
189 | %_pixmapsdir /usr/share/pixmaps | |
190 | ||
191 | # Location of themable icons for applnk/desktop files | |
192 | %_iconsdir /usr/share/icons | |
193 | ||
194 | # Location of fonts directories | |
195 | %_fontsdir /usr/share/fonts | |
196 | ||
197 | # Location of Gtk and associated libraries documentation | |
198 | %_gtkdocdir %{_defaultdocdir}/gtk-doc/html | |
199 | ||
200 | # Location of KDE documentation | |
201 | %_kdedocdir %{_defaultdocdir}/kde/HTML | |
202 | ||
203 | # unsermake script | |
204 | %__unsermake /usr/share/unsermake/unsermake | |
205 | ||
206 | # Current date | |
207 | %date %(LC_ALL="C" date +"%a %b %d %Y") | |
208 | ||
209 | # tmp directory | |
210 | %tmpdir %(echo "${TMPDIR:-/tmp}") | |
211 | ||
212 | # Example files, programs, scripts... | |
213 | %_examplesdir /usr/src/examples | |
214 | ||
215 | # The directory holding Linux kernel sources | |
216 | %_kernelsrcdir /usr/src/linux | |
217 | ||
218 | # If non-empty "debug" macro defined, add "dbg" suffix to release number | |
219 | %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm | |
220 | ||
221 | # Requires name = version-release | |
222 | %requires_releq() %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}-%%{release}\\n' | sed -e 's/ (none):/ /' | grep -v "is not") | |
223 | ||
224 | %releq_kernel_up() %(LC_ALL="C" rpm -qf --qf 'kernel-up = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | grep -vE "(is not|no such)") | |
225 | %releq_kernel_smp() %(LC_ALL="C" rpm -qf --qf 'kernel-smp = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | grep -vE "(is not|no such)") | |
226 | %requires_releq_kernel_up() %(LC_ALL="C" rpm -qf --qf 'PreReq: kernel-up = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | grep -vE "(is not|no such)") | |
227 | %requires_releq_kernel_smp() %(LC_ALL="C" rpm -qf --qf 'PreReq: kernel-smp = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | grep -vE "(is not|no such)") | |
228 | ||
229 | %requires_eq_to() %(LC_ALL="C" rpm -q --qf 'Requires: %1 = %%{epoch}:%%{version}\\n' %2 | sed -e 's/ (none):/ /' | grep -v "is not") | |
230 | ||
231 | %apache_modules_api %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache/ap_mmn.h 2>/dev/null || echo ERROR) | |
232 | ||
233 | # kernel version-release handling | |
234 | %__kernel_ver %([ -f %{_kernelsrcdir}/include/linux/version.h ] && (grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | head -n 1 | cut -d'"' -f2) || (awk '/^VERSION/ { ver = $0; gsub(/VERSION.*=/, NIL, ver); } /^PATCHLEVEL/ { plev = $0; gsub(/PATCHLEVEL.*=/, NIL, plev); } /^SUBLEVEL/ { slev = $0; gsub(/SUBLEVEL.*=/, NIL, slev); } /^EXTRAVERSION/ { ever = $0; gsub(/EXTRAVERSION.*=/, NIL, ever); gsub(/ /, NIL, ever); } END { printf("%d.%d.%d%s", ver, plev, slev, ever); }' %{_kernelsrcdir}/Makefile 2> /dev/null)) | |
235 | %__kernel_rel %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h --queryformat "%{RELEASE}" | grep -v "is not") | |
236 | %__kernel_rpmvr %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h --queryformat "%{VERSION}-%{RELEASE}" | grep -v "is not") | |
237 | %_kernel_ver %{__kernel_ver}%{?with_dist_kernel:%(echo %{__kernel_ver} | grep -q -e - || echo -%{__kernel_rel})} | |
238 | %_kernel_ver_str %(echo %{!?_without_dist_kernel:%{__kernel_rpmvr}}%{?_without_dist_kernel:%{__kernel_ver}} | sed -e 's/-/_/g') | |
239 | ||
240 | # sgml macros | |
241 | %xmlcat_add() /usr/bin/xmlcatalog --noout --add nextCatalog \"\" %1 /etc/xml/catalog ; | |
242 | %xmlcat_del() /usr/bin/xmlcatalog --noout --del %1 /etc/xml/catalog ; | |
243 | %xmlcat_add_rewrite /usr/bin/xmlcatalog --noout --add rewriteSystem | |
244 | %xmlcat_create() /usr/bin/xmlcatalog --noout --create %1 ; | |
245 | %sgmlcat_add() /usr/bin/install-catalog --add %1 %2 > /dev/null ; | |
246 | %sgmlcat_del() /usr/bin/install-catalog --remove %1 %2 > /dev/null ; | |
247 | %docbook_sgmlcat_fix() { for l in \ | |
248 | '' \ | |
249 | ' -- default decl --' \ | |
250 | 'DTDDECL "-//OASIS//DTD DocBook XML V%2//EN" "../../xml.dcl"' \ | |
251 | ' -- hacks for opensp --' \ | |
252 | 'SYSTEM "file://%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \ | |
253 | 'SYSTEM "http://www.oasis-open.org/docbook/xml/%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \ | |
254 | '' \ | |
255 | ; do echo $l; done >> %1 \ | |
256 | } | |
257 | ||
258 | #----------------------------------------------------------------- | |
259 | # find and gzip all files in %{_mandir} and %{infodir} | |
260 | # | |
261 | # Requires: xargs, find | |
262 | # | |
263 | #%no_install_post_compress_docs 1 | |
264 | %__spec_install_post_compress_docs { \ | |
265 | %{!?no_install_post_compress_docs: \ | |
266 | echo "Compress man and info pages."; \ | |
267 | %{?verbose:set -x;} \ | |
268 | for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \ | |
269 | if [ -d "$RPM_BUILD_ROOT$i" ]; then \ | |
270 | find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \ | |
271 | find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \ | |
272 | find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \ | |
273 | fi; \ | |
274 | done; \ | |
275 | } } | |
276 | ||
277 | #----------------------------------------------------------------- | |
278 | # Strip executable binaries and shared object files | |
279 | # | |
280 | # Requires: find, awk, strip, cut, xargs | |
281 | # | |
282 | #%no_install_post_strip 1 | |
283 | %__spec_install_post_strip {%{!?debug: \ | |
284 | %{!?no_install_post_strip: \ | |
285 | %{?verbose:set -x;} \ | |
286 | if [ -d "$RPM_BUILD_ROOT" ]; then \ | |
287 | echo "Strip executable binaries, archives and shared object files."; \ | |
288 | filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \ | |
289 | elfexelist=`echo $filelist | xargs -r file | \ | |
290 | awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \ | |
291 | elfsharedlist=`echo $filelist | xargs -r file | \ | |
292 | awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \ | |
293 | elfarchiveslist=`echo $filelist | xargs -r file | \ | |
294 | awk '/current ar archive/ {print $1}' | cut -d: -f1`; \ | |
295 | if [ -n "$elfexelist" ]; then \ | |
296 | %{__strip} --remove-section=.note --remove-section=.comment $elfexelist; \ | |
297 | fi; \ | |
298 | if [ -n "$elfsharedlist" ]; then \ | |
299 | %{__strip} --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \ | |
300 | fi; \ | |
301 | if [ -n "$elfarchiveslist" ]; then \ | |
302 | %{__strip} --strip-debug --remove-section=.note --remove-section=.comment $elfarchiveslist; \ | |
303 | fi; \ | |
304 | fi; } \ | |
305 | } } | |
306 | #----------------------------------------------------------------- | |
307 | # remove all RPATH from executable binaries and shared object files | |
308 | # | |
309 | # Requires: find, awk, cut, xargs, chrpath, uname | |
310 | # | |
311 | #%no_install_post_chrpath 1 | |
312 | %__spec_install_post_chrpath {%{!?debug: \ | |
313 | %{!?no_install_post_chrpath: \ | |
314 | %{?verbose:set -x;} \ | |
315 | if [ -d "$RPM_BUILD_ROOT" ]; then \ | |
316 | echo "Remove RPATH from executable binaries and shared object files."; \ | |
317 | find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" %{?_noautochrpath:! -regex "%{_noautochrpath}"} | xargs -r file | \ | |
318 | awk '/ELF.*(executable.*dynamically linked|shared object)/ {print $1}' | cut -d: -f1 | \ | |
319 | while read file ; do \ | |
320 | rpath= ; \ | |
321 | chmod u+w "$file"; \ | |
322 | for dir in `chrpath -l "$file" | \ | |
323 | awk '/RPATH=/ { gsub(/.*RPATH=/,""); gsub(/:/," "); print $0 }'` ; do \ | |
324 | case $dir in \ | |
325 | /home/* | /tmp/* | /usr/lib | /usr/lib64 | /lib | /lib64 | /usr/local/lib | /usr/local/lib64 | /usr/X11R6/lib | /usr/X11R6/lib64 ) \ | |
326 | echo "remove-rpath: $dir in $file"; \ | |
327 | ;; \ | |
328 | * ) \ | |
329 | if [ "$rpath" = "" ] ; then rpath="$dir" ; \ | |
330 | else rpath="$rpath:$dir" ; fi ; \ | |
331 | ;; \ | |
332 | esac ; \ | |
333 | done ; \ | |
334 | if [ "$rpath" = "" ] ; then chrpath -d "$file" > /dev/null ; \ | |
335 | else chrpath -r "$rpath" "$file" > /dev/null ; fi ; \ | |
336 | done; \ | |
337 | fi; } \ | |
338 | } } | |
339 | #----------------------------------------------------------------- | |
340 | # Find and gzip all kernel modules | |
341 | # | |
342 | # Requires: find | |
343 | # | |
344 | #%no_install_post_compress_modules 1 | |
345 | %__spec_install_post_compress_modules { \ | |
346 | %{!?no_install_post_compress_modules: \ | |
347 | %{?verbose:set -x;} \ | |
348 | if [ -d "$RPM_BUILD_ROOT" ]; then \ | |
349 | echo "Compress kernel modules if any."; \ | |
350 | if test -d $RPM_BUILD_ROOT/lib/modules ; then \ | |
351 | find $RPM_BUILD_ROOT/lib/modules -name \*o -type f -print | \ | |
352 | xargs -r %{__gzip} -9nf; \ | |
353 | find $RPM_BUILD_ROOT/lib/modules -name \*o -type l -printf "%p %l\n" | \ | |
354 | while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \ | |
355 | fi; \ | |
356 | fi; \ | |
357 | } } | |
358 | ||
359 | %_source_payload w9.gzdio | |
360 | %_binary_payload w9.bzdio | |
361 | ||
362 | #----------------------------------------------------------------- | |
363 | # Update all GConf2 schemas | |
364 | # | |
365 | # Requires: GConf2 | |
366 | # | |
367 | %gconf_schema_install { umask 022; \ | |
368 | GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" \ | |
369 | /usr/bin/gconftool-2 --makefile-install-rule \ | |
370 | /etc/gconf/schemas/*.schemas > /dev/null \ | |
371 | } | |
372 | ||
373 | #----------------------------------------------------------------- | |
374 | # post %install sequence: | |
375 | # - autodeps exceptions | |
376 | # - compress all man and info pages, | |
377 | # - strip all ELF executables and ELF shared objects if not %debug. | |
378 | # - compress kernel modules if any | |
379 | ||
380 | ################################################################### | |
381 | # Requires/Provides automation | |
382 | # exceptions system by Jacek Konieczny <jajcus@pld.org.pl> | |
383 | # | |
384 | %__noautoreqfiles %(sed -e s'/#.*//' /etc/rpm/noautoreqfiles)%{?_noautoreqfiles: %{_noautoreqfiles}} | |
385 | %__noautoprovfiles %(sed -e s'/#.*//' /etc/rpm/noautoprovfiles)%{?_noautoprovfiles: %{_noautoprovfiles}} | |
386 | %__noautoreq %(sed -e s'/#.*//' /etc/rpm/noautoreq)%{?_noautoreq: %{_noautoreq}} | |
387 | %__noautoreqdep %(sed -e s'/#.*//' /etc/rpm/noautoreqdep)%{?_noautoreqdep: %{_noautoreqdep}} | |
388 | %__noautoprov %(sed -e s'/#.*//' /etc/rpm/noautoprov)%{?_noautoprov: %{_noautoprov}} | |
389 | #%_noautocompressdoc %{nil} | |
390 | # | |
391 | %_missing_doc_files_terminate_build 1%{nil} | |
392 | %_unpackaged_files_terminate_build %{nil} | |
393 | # (X)emacs support | |
394 | %___emacs_lispdir_helper -batch -q -eval '(while load-path (princ (concat (car load-path) "\\n")) (setq load-path (cdr load-path)))' 2> /dev/null|sed -n '/\\(.*\\/x\\?emacs\\/site-lisp\\)\\/\\?$/{s,,\\1,p;q;}' | |
395 | %_emacs_lispdir %(emacs %___emacs_lispdir_helper) | |
396 | %_xemacs_lispdir %(xemacs %___emacs_lispdir_helper) | |
397 | ||
398 | %__php_provides %{nil} | |
399 | %__php_requires %{nil} | |
400 | %__perl_provides %{nil} | |
401 | %__perl_requires %{nil} | |
402 | ||
403 | # Perl specific macro definitions. | |
404 | %perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib) | |
405 | %perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib) | |
406 | %perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib) | |
407 | %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch) | |
408 | %perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib) | |
409 | %perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch) | |
410 | ||
411 | %php_pear_dir %{_datadir}/pear | |
412 | ||
413 | # Python specific macro definitions. | |
414 | # python main version | |
415 | %py_ver %(echo `python -c "import sys; print sys.version[:3]"`) | |
416 | ||
417 | # directories | |
418 | %py_prefix %(echo `python -c "import sys; print sys.prefix"`) | |
419 | %py_libdir %{py_prefix}/%{_lib}/python%{py_ver} | |
420 | %py_scriptdir %{py_prefix}/share/python%{py_ver} | |
421 | %py_incdir /usr/include/python%{py_ver} | |
422 | %py_sitedir %{py_libdir}/site-packages | |
423 | %py_sitescriptdir %{py_scriptdir}/site-packages | |
424 | %py_dyndir %{py_libdir}/lib-dynload | |
425 | ||
426 | # pure python modules compilation | |
427 | %py_comp python -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])" | |
428 | ||
429 | %py_ocomp python -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])" | |
430 | ||
431 | # Software written in Python language require Python with main version | |
432 | # unchanged | |
433 | %pyrequires_eq() Requires: %1 >= 1:%py_ver %1 < 1:%(echo `python -c "import sys; import string; ver=sys.version[:3].split('.'); ver[1]=str(int(ver[1])+1); print string.join(ver, '.')"`) | |
434 | ||
435 | # depmod macro | |
436 | %depmod() { \ | |
437 | if [ -e /boot/System.map-%1 ]; then \ | |
438 | /sbin/depmod -a -F /boot/System.map-%1 %1; \ | |
439 | else \ | |
440 | if [ -e /boot/System.map ]; then \ | |
441 | /sbin/depmod -a -F /boot/System.map %1; \ | |
442 | else \ | |
443 | /sbin/depmod -a %1; \ | |
444 | fi \ | |
445 | fi; \ | |
446 | } | |
447 | ||
448 | # XMMS specific macros | |
449 | %xmms_prefix %(xmms-config --prefix) | |
450 | %xmms_exec_prefix %(xmms-config --exec-prefix) | |
451 | %xmms_version %(xmms-config --version) | |
452 | %xmms_datadir %(xmms-config --data-dir) | |
453 | %xmms_plugindir %(xmms-config --plugin-dir) | |
454 | %xmms_visualization_plugindir %(xmms-config --visualization-plugin-dir) | |
455 | %xmms_input_plugindir %(xmms-config --input-plugin-dir) | |
456 | %xmms_output_plugindir %(xmms-config --output-plugin-dir) | |
457 | %xmms_effect_plugindir %(xmms-config --effect-plugin-dir) | |
458 | %xmms_general_plugindir %(xmms-config --general-plugin-dir) | |
459 | ||
460 | %_target_base_arch %(echo %{_target_cpu} | sed 's/i.86/i386/;s/athlon/i386/;s/pentium./i386/;s/amd64/x86_64/') | |
461 | ||
462 | # user/group checking macros | |
463 | # | |
464 | # Usage: | |
465 | # %userremove myuser | |
466 | # | |
467 | %userremove /usr/lib/rpm/user_group.sh user del | |
468 | %groupremove /usr/lib/rpm/user_group.sh group del | |
469 | # | |
470 | # Usage: | |
471 | # if %usertestrm myuser; then | |
472 | # /usr/sbin/userdel -r myuser | |
473 | # Note: | |
474 | # use these macros only if you need to call userdel/groupdel with | |
475 | # a non-standard option or take an extra action; otherwise use the | |
476 | # %userremove/%groupremove macros | |
477 | # | |
478 | %usertestrm /usr/lib/rpm/user_group.sh user testrm | |
479 | %grouptestrm /usr/lib/rpm/user_group.sh group testrm | |
480 | # user group membership management macros | |
481 | # | |
482 | # Usage: | |
483 | # %addusertogroup myuser agroup | |
484 | # | |
485 | %addusertogroup /usr/lib/rpm/user_group.sh user addtogroup | |
486 | ||
487 | # banner support (useful in {pre,post}{,un} and triggers) | |
488 | # | |
489 | # Usage: | |
490 | # %banner name [-a] [-e] [-n] [-tn] | |
491 | # the banner text, the banner text | |
492 | # the banner text, and following line HAVE TO BE: | |
493 | # EOF | |
494 | # -a - append to the banner | |
495 | # -e - send to stderr instead of stdout | |
496 | # -n - no show banner (overrides -t) | |
497 | # -t - show only, if RPM_SCRIPTVERBOSITY >= n; default n=5 | |
498 | %banner(a:e:n:t:) \ | |
499 | RPM_SCRIPTVERBOSITY=5 \ | |
500 | [ -r /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm \ | |
501 | if [ -x /usr/bin/banner.sh ]; then \ | |
502 | CMD="/usr/bin/banner.sh %{-e:--stderr} %{!-n:\`[ $RPM_SCRIPTVERBOSITY -ge %{-t:%{-t*}}%{!-t:5} ] && echo '-s'\`} %{!-a:-m}%{-a:-M} %1" \ | |
503 | else \ | |
504 | CMD="cat%{-e: >&2}" \ | |
505 | fi \ | |
506 | $CMD << EOF \ | |
507 | %nil | |
508 |