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