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