]>
Commit | Line | Data |
---|---|---|
a8bf9720 AF |
1 | # PLD rpm macros |
2 | ||
5b0f0ac9 MM |
3 | %__id @__ID@ |
4 | %__id_u %{__id} -u | |
5 | %__chown_Rhf @__CHOWN_RHF@ | |
6 | %__chgrp_Rhf @__CHGRP_RHF@ | |
7 | ||
9fc84bee | 8 | %_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root:@ROOT_GROUP@ |
a8bf9720 | 9 | %_fixgroup true |
5b0f0ac9 | 10 | %_fixperms %{__chmod} -Rf @FIXPERMS@ |
a8bf9720 | 11 | %_topdir %(echo $HOME)/rpm |
cd33aab7 AM |
12 | #----------------------------------------------------------------- |
13 | # CFLAGS and LDFLAGS used to build | |
14 | ||
5b0f0ac9 | 15 | %debugcflags -O0 -g -Wall |
cd33aab7 | 16 | %rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags} |
a0f77724 | 17 | # %rpmldflags %{!?debug:-s} |
7c2eac51 | 18 | %rpmldflags %{nil} |
cd33aab7 | 19 | |
a544555d | 20 | # kernel compiler |
cabacfeb | 21 | %kgcc gcc |
22 | %kgcc_package gcc | |
a544555d | 23 | |
5f9f9bd7 | 24 | # Build system path macros. |
25 | # | |
26 | %__libtoolize libtoolize --copy --force | |
aad1c8e4 | 27 | %__gettextize { \ |
4da2b97a | 28 | if ! gettextize --version | grep -q '0\.10\.' ; then \ |
4cd84746 JB |
29 | if grep -qs 'AM_GNU_GETTEXT.*external' configure.{ac,in} ; then \ |
30 | gettextize --copy --force --no-changelog; \ | |
93bce43f | 31 | else \ |
4cd84746 JB |
32 | gettextize --copy --force --no-changelog --intl; \ |
33 | fi; \ | |
34 | if [ ! -f po/Makevars ]; then \ | |
35 | cp -f po/Makevars{.template,}; \ | |
36 | fi; \ | |
37 | else \ | |
38 | gettextize --copy --force; \ | |
aad1c8e4 | 39 | fi; \ |
4cd84746 JB |
40 | } |
41 | %__autopoint autopoint --force | |
fa4547da | 42 | %__automake automake -a -c -f --foreign |
4413e4a3 | 43 | %__autoconf autoconf %{?debug:-Wall} |
5f9f9bd7 | 44 | |
cd33aab7 | 45 | #----------------------------------------------------------------- |
9f0287b5 | 46 | %configure2_13 { \ |
cd33aab7 AM |
47 | if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \ |
48 | LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \ | |
49 | CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \ | |
50 | CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \ | |
51 | FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \ | |
c55f2219 | 52 | CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \ |
700ee83b AM |
53 | %{?__cc:CC=%{__cc} ; export CC ; } \ |
54 | %{?__cxx:CXX=%{__cxx} ; export CXX ; } \ | |
5b0f0ac9 | 55 | %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \ |
fa74a11c | 56 | --host=%{_target_platform} \ |
cd33aab7 AM |
57 | --prefix=%{_prefix} \ |
58 | --exec-prefix=%{_exec_prefix} \ | |
59 | --bindir=%{_bindir} \ | |
60 | --sbindir=%{_sbindir} \ | |
61 | --sysconfdir=%{_sysconfdir} \ | |
62 | --datadir=%{_datadir} \ | |
63 | --includedir=%{_includedir} \ | |
64 | --libdir=%{_libdir} \ | |
65 | --libexecdir=%{_libexecdir} \ | |
66 | --localstatedir=%{_localstatedir} \ | |
67 | --sharedstatedir=%{_sharedstatedir} \ | |
68 | --mandir=%{_mandir} \ | |
69 | --infodir=%{_infodir} \ | |
72d080a8 | 70 | --x-libraries=/usr/X11R6/%{_lib} \ |
cd33aab7 AM |
71 | } |
72 | ||
85f82bec | 73 | #---------------------------------------------------------------- |
b8cf6778 | 74 | %configure {./configure \ |
85f82bec AF |
75 | LDFLAGS="${LDFLAGS:-%rpmldflags}" \ |
76 | CFLAGS="${CFLAGS:-%rpmcflags}" \ | |
77 | CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \ | |
78 | FFLAGS="${FFLAGS:-%rpmcflags}" \ | |
418d9760 | 79 | CPPFLAGS="${CPPFLAGS:-}" \ |
9f0287b5 AF |
80 | %{?__cc:CC=%{__cc}} \ |
81 | %{?__cxx:CXX=%{__cxx}} \ | |
85f82bec AF |
82 | --build=%{_target_platform} \ |
83 | --prefix=%{_prefix} \ | |
84 | --exec-prefix=%{_exec_prefix} \ | |
85 | --bindir=%{_bindir} \ | |
86 | --sbindir=%{_sbindir} \ | |
87 | --sysconfdir=%{_sysconfdir} \ | |
88 | --datadir=%{_datadir} \ | |
89 | --includedir=%{_includedir} \ | |
90 | --libdir=%{_libdir} \ | |
91 | --libexecdir=%{_libexecdir} \ | |
92 | --localstatedir=%{_localstatedir} \ | |
93 | --sharedstatedir=%{_sharedstatedir} \ | |
94 | --mandir=%{_mandir} \ | |
95 | --infodir=%{_infodir} \ | |
72d080a8 | 96 | --x-libraries=/usr/X11R6/%{_lib} \ |
85f82bec AF |
97 | } |
98 | ||
617b7266 MM |
99 | # ------------------------------------------------------------------------ |
100 | # Conditional build stuff. | |
101 | ||
102 | # Check if symbol is defined. | |
103 | # Example usage: %if %{defined with_foo} && %{undefined with_bar} ... | |
104 | %defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}} | |
105 | %undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}} | |
106 | ||
ed4f631a MM |
107 | # Shorthand for %{defined with_...} |
108 | %with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}} | |
109 | %without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}} | |
110 | ||
617b7266 MM |
111 | # Handle conditional builds. %bcond_with is for case when feature is |
112 | # default off and needs to be activated with --with ... command line | |
113 | # switch. %bcond_without is for the dual case. | |
114 | # | |
115 | # %bcond_with foo defines symbol with_foo if --with foo was specified on | |
116 | # command line. | |
117 | # %bcond_without foo defines symbol with_foo if --without foo was *not* | |
118 | # specified on command line. | |
119 | # | |
120 | # For example: | |
121 | # | |
122 | # %bcond_with extra_fonts | |
123 | # %bcond_without static | |
d823b3fb | 124 | # %if %{with extra_fonts} |
617b7266 MM |
125 | # ... |
126 | # %endif | |
d823b3fb | 127 | # %ifdef %{with static} |
617b7266 MM |
128 | # ... |
129 | # %endif | |
130 | # %{?with_static: ... } | |
131 | # %{!?with_static: ... } | |
132 | # %{?with_extra_fonts: ... } | |
133 | # %{!?with_extra_fonts: ... } | |
134 | # | |
135 | # The bottom line: never use without_foo, _with_foo nor _without_foo, only | |
136 | # with_foo. This way changing default set of bconds for given spec is just | |
137 | # a matter of changing single line in it and syntax is more readable. | |
138 | %bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}} | |
139 | %bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}} | |
140 | # ------------------------------------------------------------------------ | |
141 | ||
cd33aab7 AM |
142 | # Location of autoconf macros |
143 | %_aclocaldir %(aclocal --print-ac-dir) | |
144 | ||
32720a50 AM |
145 | # Location of omf files |
146 | %_omf_dest_dir %(scrollkeeper-config --omfdir) | |
147 | ||
c5eece2c | 148 | # Location of pkgconfig files |
a46897a7 | 149 | %_pkgconfigdir /usr/%{_lib}/pkgconfig |
c5eece2c | 150 | |
cd33aab7 | 151 | # Location of top applink dir |
de0caa47 | 152 | %_applnkdir /usr/X11R6/share/applnk |
cd33aab7 | 153 | |
c917274d | 154 | # Location of desktop files |
155 | %_desktopdir /usr/share/applications | |
156 | ||
fb08fb4a | 157 | # Location of pixmaps for applnk/desktop files |
3a9bb008 | 158 | %_pixmapsdir /usr/share/pixmaps |
cd33aab7 | 159 | |
fb08fb4a | 160 | # Location of themable icons for applnk/desktop files |
986c3bcd | 161 | %_iconsdir /usr/share/icons |
162 | ||
c5eece2c JB |
163 | # Location of fonts directories |
164 | %_fontsdir /usr/share/fonts | |
165 | ||
5cfcbc9e | 166 | # Location of Gtk and associated libraries documentation |
e9f33a26 | 167 | %_gtkdocdir %{_defaultdocdir}/gtk-doc/html |
5cfcbc9e | 168 | |
eee08b2d | 169 | # Location of KDE documentation |
170 | %_kdedocdir %{_defaultdocdir}/kde/HTML | |
171 | ||
cd33aab7 AM |
172 | # Current date |
173 | %date %(LC_ALL="C" date +"%a %b %d %Y") | |
174 | ||
175 | # tmp directory | |
176 | %tmpdir %(echo "${TMPDIR:-/tmp}") | |
177 | ||
178 | # Example files, programs, scripts... | |
179 | %_examplesdir /usr/src/examples | |
180 | ||
bd63739a | 181 | # The directory holding Linux kernel sources |
182 | %_kernelsrcdir /usr/src/linux | |
183 | ||
cd33aab7 | 184 | # If non-empty "debug" macro defined, add "dbg" suffix to release number |
5b0f0ac9 | 185 | %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm |
cd33aab7 | 186 | |
5b0f0ac9 MM |
187 | # Requires name = version-release |
188 | %requires_releq() %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}-%%{release}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not") | |
189 | %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):/ /' -e 's/ 0:/ /' | grep -vE "(is not|no such)") | |
190 | %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):/ /' -e 's/ 0:/ /' | grep -vE "(is not|no such)") | |
e21c1bea | 191 | %requires_eq_to() %(LC_ALL="C" rpm -q --qf 'Requires: %1 = %%{epoch}:%%{version}\\n' %2 | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not") |
e478b9e7 | 192 | |
6f3d2288 | 193 | %apache_modules_api %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache/ap_mmn.h 2>/dev/null || echo ERROR) |
8dea1306 | 194 | |
195 | # kernel version-release handling | |
1d969cf0 AM |
196 | %__kernel_ver %([ -f %{_kernelsrcdir}/include/linux/version.h ] && (grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | 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); } END { printf("%d.%d.%d", ver, plev, slev); }' %{_kernelsrcdir}/Makefile 2> /dev/null)) |
197 | %__kernel_rel %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h --queryformat "%{RELEASE}" | grep -v "is not") | |
8dea1306 | 198 | %_kernel_ver %(echo %{__kernel_ver}%{!?_without_dist_kernel:-%{__kernel_rel}}) |
199 | %_kernel_ver_str %(echo %{_kernel_ver} | sed s/-/_/g) | |
fd4d8ee0 | 200 | |
c2c27a5a | 201 | # sgml macros |
202 | %xmlcat_add() /usr/bin/xmlcatalog --noout --add nextCatalog \"\" %1 /etc/xml/catalog | |
203 | %xmlcat_del() /usr/bin/xmlcatalog --noout --del %1 /etc/xml/catalog | |
204 | %xmlcat_add_rewrite /usr/bin/xmlcatalog --noout --add rewriteSystem | |
205 | %xmlcat_create() /usr/bin/xmlcatalog --noout --create %1 | |
206 | %sgmlcat_add() /usr/bin/install-catalog --add %1 %2 > /dev/null | |
207 | %sgmlcat_del() /usr/bin/install-catalog --remove %1 %2 > /dev/null | |
208 | %docbook_sgmlcat_fix() { for l in \ | |
209 | '' \ | |
210 | ' -- default decl --' \ | |
211 | 'DTDDECL "-//OASIS//DTD DocBook XML V%2//EN" "../../xml.dcl"' \ | |
212 | ' -- hacks for opensp --' \ | |
213 | 'SYSTEM "file://%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \ | |
214 | 'SYSTEM "http://www.oasis-open.org/docbook/xml/%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \ | |
215 | '' \ | |
216 | ; do echo $l; done >> %1 \ | |
217 | } | |
218 | ||
cd33aab7 AM |
219 | #----------------------------------------------------------------- |
220 | # find and gzip all files in %{_mandir} and %{infodir} | |
221 | # | |
222 | # Requires: xargs, find | |
223 | # | |
224 | #%no_install_post_compress_docs 1 | |
225 | %__spec_install_post_compress_docs { \ | |
226 | echo "Compress man and info pages."; \ | |
227 | %{!?no_install_post_compress_docs: \ | |
228 | %{?verbose:set -x;} \ | |
229 | for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \ | |
230 | if [ -d "$RPM_BUILD_ROOT$i" ]; then \ | |
231 | find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \ | |
232 | find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \ | |
233 | find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \ | |
234 | fi; \ | |
235 | done; \ | |
236 | } } | |
237 | ||
238 | #----------------------------------------------------------------- | |
239 | # Strip executable binaries and shared object files | |
240 | # | |
241 | # Requires: find, awk, strip, cut, xargs | |
242 | # | |
243 | #%no_install_post_strip 1 | |
244 | %__spec_install_post_strip {%{!?debug: \ | |
245 | %{!?no_install_post_strip: \ | |
f80cefa3 JB |
246 | %{?verbose:set -x;} \ |
247 | if [ -d "$RPM_BUILD_ROOT" ]; then \ | |
5b0f0ac9 | 248 | echo "Strip executable binaries, archives and shared object files."; \ |
aaa1486f | 249 | filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \ |
cd33aab7 AM |
250 | elfexelist=`echo $filelist | xargs -r file | \ |
251 | awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \ | |
252 | elfsharedlist=`echo $filelist | xargs -r file | \ | |
253 | awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \ | |
5b0f0ac9 MM |
254 | elfarchiveslist=`echo $filelist | xargs -r file | \ |
255 | awk '/current ar archive/ {print $1}' | cut -d: -f1`; \ | |
cd33aab7 | 256 | if [ -n "$elfexelist" ]; then \ |
aaa1486f | 257 | %{__strip} --remove-section=.note --remove-section=.comment $elfexelist; \ |
cd33aab7 AM |
258 | fi; \ |
259 | if [ -n "$elfsharedlist" ]; then \ | |
aaa1486f | 260 | %{__strip} --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \ |
5b0f0ac9 MM |
261 | fi; \ |
262 | if [ -n "$elfarchiveslist" ]; then \ | |
aaa1486f | 263 | %{__strip} --strip-debug --remove-section=.note --remove-section=.comment $elfarchiveslist; \ |
f80cefa3 JB |
264 | fi; \ |
265 | fi; } \ | |
cd33aab7 | 266 | } } |
cc545e1a | 267 | #----------------------------------------------------------------- |
268 | # remove all RPATH from executable binaries and shared object files | |
269 | # | |
270 | # Requires: find, awk, cut, xargs, chrpath, uname | |
271 | # | |
272 | #%no_install_post_chrpath 1 | |
273 | %__spec_install_post_chrpath {%{!?debug: \ | |
274 | %{!?no_install_post_chrpath: \ | |
275 | %{?verbose:set -x;} \ | |
f80cefa3 | 276 | if [ -d "$RPM_BUILD_ROOT" ]; then \ |
cc545e1a | 277 | echo "Remove RPATH from executable binaries and shared object files."; \ |
aaa1486f | 278 | find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" %{?_noautochrpath:! -regex "%{_noautochrpath}"} | xargs -r file | \ |
cc545e1a | 279 | awk '/ELF.*(executable|shared object)/ {print $1}' | cut -d: -f1 | \ |
280 | while read file ; do \ | |
281 | rpath= ; \ | |
282 | chmod u+w "$file"; \ | |
283 | for dir in `chrpath -l "$file" | \ | |
284 | awk '/RPATH=/ { gsub(/.*RPATH=/,""); gsub(/:/," "); print $0 }'` ; do \ | |
285 | case $dir in \ | |
570a0c29 | 286 | /home/* | /tmp/* | /usr/lib | /usr/lib64 | /lib | /lib64 | /usr/local/lib | /usr/local/lib64 | /usr/X11R6/lib | /usr/X11R6/lib64 ) \ |
cc545e1a | 287 | echo "remove-rpath: $dir in $file"; \ |
288 | ;; \ | |
289 | * ) \ | |
290 | if [ "$rpath" = "" ] ; then rpath="$dir" ; \ | |
291 | else rpath="$rpath:$dir" ; fi ; \ | |
292 | ;; \ | |
293 | esac ; \ | |
294 | done ; \ | |
295 | if [ "$rpath" = "" ] ; then chrpath -d "$file" > /dev/null ; \ | |
296 | else chrpath -r "$rpath" "$file" > /dev/null ; fi ; \ | |
f80cefa3 JB |
297 | done; \ |
298 | fi; } \ | |
cc545e1a | 299 | } } |
22a54b3e | 300 | #----------------------------------------------------------------- |
93b46c00 | 301 | # Find and gzip all kernel modules |
302 | # | |
303 | # Requires: find | |
304 | # | |
305 | #%no_install_post_compress_modules 1 | |
306 | %__spec_install_post_compress_modules { \ | |
93b46c00 | 307 | %{!?no_install_post_compress_modules: \ |
308 | %{?verbose:set -x;} \ | |
f80cefa3 JB |
309 | if [ -d "$RPM_BUILD_ROOT" ]; then \ |
310 | echo "Compress kernel modules if any."; \ | |
390bdd1d | 311 | if test -d $RPM_BUILD_ROOT/lib/modules ; then \ |
fe70546d | 312 | find $RPM_BUILD_ROOT/lib/modules -name \*o -type f -print | \ |
390bdd1d | 313 | xargs -r %{__gzip} -9nf; \ |
fe70546d | 314 | find $RPM_BUILD_ROOT/lib/modules -name \*o -type l -printf "%p %l\n" | \ |
92ebeb8d | 315 | while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \ |
390bdd1d | 316 | fi; \ |
f80cefa3 | 317 | fi; \ |
93b46c00 | 318 | } } |
cd33aab7 AM |
319 | |
320 | %_source_payload w9.gzdio | |
321 | %_binary_payload w9.bzdio | |
322 | ||
aad1c8e4 | 323 | #----------------------------------------------------------------- |
324 | # Update all GConf2 schemas | |
325 | # | |
326 | # Requires: GConf2 | |
327 | # | |
03ff3333 | 328 | %gconf_schema_install { umask 022; \ |
329 | GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" \ | |
330 | /usr/bin/gconftool-2 --makefile-install-rule \ | |
331 | /etc/gconf/schemas/*.schemas > /dev/null \ | |
82b097b9 | 332 | } |
aad1c8e4 | 333 | |
cd33aab7 AM |
334 | #----------------------------------------------------------------- |
335 | # post %install sequence: | |
336 | # - autodeps exceptions | |
337 | # - compress all man and info pages, | |
338 | # - strip all ELF executables and ELF shared objects if not %debug. | |
5b0f0ac9 | 339 | # - compress kernel modules if any |
cd33aab7 AM |
340 | |
341 | ################################################################### | |
342 | # Requires/Provides automation | |
343 | # exceptions system by Jacek Konieczny <jajcus@pld.org.pl> | |
a4852742 | 344 | # |
9123f215 JK |
345 | %_noautoreqfiles %(sed -e s'/#.*//' /etc/rpm/noautoreqfiles) |
346 | %_noautoprovfiles %(sed -e s'/#.*//' /etc/rpm/noautoprovfiles) | |
984f6de6 | 347 | %_noautoreq %(sed -e s'/#.*//' /etc/rpm/noautoreq) |
23183011 | 348 | %_noautoreqdep %(sed -e s'/#.*//' /etc/rpm/noautoreqdep) |
984f6de6 | 349 | %_noautoprov %(sed -e s'/#.*//' /etc/rpm/noautoprov) |
a4852742 JB |
350 | #%_noautocompressdoc %{nil} |
351 | # | |
5b0f0ac9 MM |
352 | %_missing_doc_files_terminate_build 1%{nil} |
353 | %_unpackaged_files_terminate_build %{nil} | |
4c7d3ba4 | 354 | # (X)emacs support |
42b7e5ac | 355 | %___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;}' |
4c7d3ba4 AF |
356 | %_emacs_lispdir %(emacs %___emacs_lispdir_helper) |
357 | %_xemacs_lispdir %(xemacs %___emacs_lispdir_helper) | |
41a62699 | 358 | |
984f6de6 JK |
359 | %__php_provides %{nil} |
360 | %__php_requires %{nil} | |
361 | %__perl_provides %{nil} | |
362 | %__perl_requires %{nil} | |
41a62699 AF |
363 | |
364 | # Perl specific macro definitions. | |
942c693c AF |
365 | %perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib) |
366 | %perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib) | |
367 | %perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib) | |
368 | %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch) | |
369 | %perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib) | |
370 | %perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch) | |
41a62699 | 371 | |
942c693c | 372 | %php_pear_dir %{_datadir}/pear |
41a62699 AF |
373 | |
374 | # Python specific macro definitions. | |
375 | # python main version | |
942c693c | 376 | %py_ver %(echo `python -c "import sys; print sys.version[:3]"`) |
41a62699 AF |
377 | |
378 | # directories | |
942c693c | 379 | %py_prefix %(echo `python -c "import sys; print sys.prefix"`) |
4ef692e4 | 380 | %py_libdir %{py_prefix}/%{_lib}/python%{py_ver} |
a4f0b5e0 | 381 | %py_scriptdir %{py_prefix}/share/python%{py_ver} |
942c693c | 382 | %py_incdir /usr/include/python%{py_ver} |
a4f0b5e0 JK |
383 | %py_sitedir %{py_libdir}/site-packages |
384 | %py_sitescriptdir %{py_scriptdir}/site-packages | |
942c693c | 385 | %py_dyndir %{py_libdir}/lib-dynload |
41a62699 AF |
386 | |
387 | # pure python modules compilation | |
942c693c | 388 | %py_comp python -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])" |
41a62699 | 389 | |
942c693c | 390 | %py_ocomp python -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])" |
41a62699 AF |
391 | |
392 | # Software written in Python language require Python with main version | |
393 | # unchanged | |
7986b123 | 394 | %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, '.')"`) |
41a62699 | 395 | |
67ed5b97 | 396 | # depmod macro |
397 | %depmod() { \ | |
398 | if [ -e /boot/System.map-%1 ]; then \ | |
399 | /sbin/depmod -a -F /boot/System.map-%1 %1; \ | |
400 | else \ | |
401 | if [ -e /boot/System.map ]; then \ | |
402 | /sbin/depmod -a -F /boot/System.map %1; \ | |
403 | else \ | |
404 | /sbin/depmod -a %1; \ | |
405 | fi \ | |
406 | fi; \ | |
407 | } | |
408 | ||
495892af | 409 | # XMMS specific macros |
2f163afd JB |
410 | %xmms_prefix %(xmms-config --prefix) |
411 | %xmms_exec_prefix %(xmms-config --exec-prefix) | |
412 | %xmms_version %(xmms-config --version) | |
413 | %xmms_datadir %(xmms-config --data-dir) | |
414 | %xmms_plugindir %(xmms-config --plugin-dir) | |
415 | %xmms_visualization_plugindir %(xmms-config --visualization-plugin-dir) | |
416 | %xmms_input_plugindir %(xmms-config --input-plugin-dir) | |
417 | %xmms_output_plugindir %(xmms-config --output-plugin-dir) | |
418 | %xmms_effect_plugindir %(xmms-config --effect-plugin-dir) | |
419 | %xmms_general_plugindir %(xmms-config --general-plugin-dir) | |
495892af | 420 |