]> git.pld-linux.org Git - packages/rpm.git/blame - rpm.macros
- typos, s/__kernel_rel/__kernel_ver/.
[packages/rpm.git] / rpm.macros
CommitLineData
a8bf9720
AF
1# PLD rpm macros
2
b5b20129 3# other macros
90c0eaed 4%epoch 0
b5b20129
AM
5%_enable_debug_packages 1
6
5b0f0ac9
MM
7%__id @__ID@
8%__id_u %{__id} -u
9%__chown_Rhf @__CHOWN_RHF@
10%__chgrp_Rhf @__CHGRP_RHF@
11
9fc84bee 12%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root:@ROOT_GROUP@
a8bf9720 13%_fixgroup true
d0bdd45a 14%_fixperms %{__chmod} -Rf @FIXPERMS@
a8bf9720 15%_topdir %(echo $HOME)/rpm
cd33aab7
AM
16#-----------------------------------------------------------------
17# CFLAGS and LDFLAGS used to build
18
d3e82dd7 19%debuginfocflags %{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1: -ggdb}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
b5b20129 20
5b0f0ac9 21%debugcflags -O0 -g -Wall
29e6df30 22%rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}
af18d245 23%rpmcxxflags %{rpmcflags} -fvisibility-inlines-hidden
7c2eac51 24%rpmldflags %{nil}
cd33aab7 25
a544555d 26# kernel compiler
cabacfeb 27%kgcc gcc
28%kgcc_package gcc
a544555d 29
5f9f9bd7 30# Build system path macros.
31#
32%__libtoolize libtoolize --copy --force
aad1c8e4 33%__gettextize { \
4da2b97a 34 if ! gettextize --version | grep -q '0\.10\.' ; then \
4cd84746
JB
35 if grep -qs 'AM_GNU_GETTEXT.*external' configure.{ac,in} ; then \
36 gettextize --copy --force --no-changelog; \
93bce43f 37 else \
4cd84746
JB
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; \
aad1c8e4 45 fi; \
4cd84746
JB
46}
47%__autopoint autopoint --force
fa4547da 48%__automake automake -a -c -f --foreign
4413e4a3 49%__autoconf autoconf %{?debug:-Wall}
5f9f9bd7 50
bd1cd543 51%dependencytracking %{nil}
cd33aab7 52#-----------------------------------------------------------------
9f0287b5 53%configure2_13 { \
cd33aab7
AM
54 if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
55 LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \
56 CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
af18d245 57 CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" ; export CXXFLAGS ; \
cd33aab7 58 FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
c55f2219 59 CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
4eac2e49
AM
60 %{?__cc:CC="%{__cc}" ; export CC ; } \
61 %{?__cxx:CXX="%{__cxx}" ; export CXX ; } \
5b0f0ac9 62 %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \
fa74a11c 63 --host=%{_target_platform} \
cd33aab7
AM
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} \
72d080a8 77 --x-libraries=/usr/X11R6/%{_lib} \
8b4be1e1 78 %{dependencytracking} \
cd33aab7
AM
79}
80
85f82bec 81#----------------------------------------------------------------
b8cf6778 82%configure {./configure \
85f82bec
AF
83 LDFLAGS="${LDFLAGS:-%rpmldflags}" \
84 CFLAGS="${CFLAGS:-%rpmcflags}" \
af18d245 85 CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" \
85f82bec 86 FFLAGS="${FFLAGS:-%rpmcflags}" \
418d9760 87 CPPFLAGS="${CPPFLAGS:-}" \
4eac2e49
AM
88 %{?__cc:CC="%{__cc}"} \
89 %{?__cxx:CXX="%{__cxx}"} \
85f82bec
AF
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} \
72d080a8 104 --x-libraries=/usr/X11R6/%{_lib} \
8b4be1e1 105 %{dependencytracking} \
85f82bec
AF
106}
107
617b7266 108# ------------------------------------------------------------------------
a0bade1c
AM
109# Overloading of some basic macros
110%prep \
111%%prep\
112LANG=C\
113export LANG\
7febf367 114unset DISPLAY ||:\
a0bade1c
AM
115%{nil}
116
117%build %%build\
118LANG=C\
119export LANG\
7febf367 120unset DISPLAY ||:\
a0bade1c
AM
121%{nil}
122
123%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
124%%install\
125LANG=C\
126export LANG\
7febf367 127unset DISPLAY ||:\
a0bade1c
AM
128%{nil}
129
130# ------------------------------------------------------------------------
617b7266
MM
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
ed4f631a
MM
138# Shorthand for %{defined with_...}
139%with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
140%without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
141
617b7266
MM
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
d823b3fb 155# %if %{with extra_fonts}
617b7266
MM
156# ...
157# %endif
d823b3fb 158# %ifdef %{with static}
617b7266
MM
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
cd33aab7
AM
173# Location of autoconf macros
174%_aclocaldir %(aclocal --print-ac-dir)
175
32720a50
AM
176# Location of omf files
177%_omf_dest_dir %(scrollkeeper-config --omfdir)
178
c5eece2c 179# Location of pkgconfig files
a46897a7 180%_pkgconfigdir /usr/%{_lib}/pkgconfig
c5eece2c 181
c917274d 182# Location of desktop files
183%_desktopdir /usr/share/applications
510f694c 184%_applnkdir ERROR:_applnkdir_is_obsolete_use_desktopdir_instead
c917274d 185
fb08fb4a 186# Location of pixmaps for applnk/desktop files
3a9bb008 187%_pixmapsdir /usr/share/pixmaps
cd33aab7 188
fb08fb4a 189# Location of themable icons for applnk/desktop files
986c3bcd 190%_iconsdir /usr/share/icons
191
c5eece2c
JB
192# Location of fonts directories
193%_fontsdir /usr/share/fonts
194
5cfcbc9e 195# Location of Gtk and associated libraries documentation
e9f33a26 196%_gtkdocdir %{_defaultdocdir}/gtk-doc/html
5cfcbc9e 197
eee08b2d 198# Location of KDE documentation
199%_kdedocdir %{_defaultdocdir}/kde/HTML
200
a7cad6ae 201# unsermake script
202%__unsermake /usr/share/unsermake/unsermake
203
cd33aab7
AM
204# Current date
205%date %(LC_ALL="C" date +"%a %b %d %Y")
206
207# tmp directory
208%tmpdir %(echo "${TMPDIR:-/tmp}")
209
210# Example files, programs, scripts...
211%_examplesdir /usr/src/examples
212
bd63739a 213# The directory holding Linux kernel sources
214%_kernelsrcdir /usr/src/linux
215
cd33aab7 216# If non-empty "debug" macro defined, add "dbg" suffix to release number
5b0f0ac9 217%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
cd33aab7 218
5b0f0ac9 219# Requires name = version-release
d0bdd45a 220%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")
511ee4c6 221
d0bdd45a
JB
222%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)")
223%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)")
224%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)")
225%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)")
511ee4c6 226
d0bdd45a 227%requires_eq_to() %(LC_ALL="C" rpm -q --qf 'Requires: %1 = %%{epoch}:%%{version}\\n' %2 | sed -e 's/ (none):/ /' | grep -v "is not")
e478b9e7 228
6f3d2288 229%apache_modules_api %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache/ap_mmn.h 2>/dev/null || echo ERROR)
8dea1306 230
231# kernel version-release handling
d7262267 232%__kernel_ver %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h --queryformat "%{VERSION}" | grep -v "is not")
33f07ba9 233#__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))
1d969cf0 234%__kernel_rel %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h --queryformat "%{RELEASE}" | grep -v "is not")
d0bdd45a
JB
235%__kernel_rpmvr %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h --queryformat "%{VERSION}-%{RELEASE}" | grep -v "is not")
236%_kernel_ver %{__kernel_ver}%{?with_dist_kernel:%(echo %{__kernel_ver} | grep -q -e - || echo -%{__kernel_rel})}
066309eb 237%_kernel_ver_str %(echo %{!?_without_dist_kernel:%{__kernel_rpmvr}}%{?_without_dist_kernel:%{__kernel_ver}} | sed -e 's/-/_/g')
fd4d8ee0 238
c2c27a5a 239# sgml macros
a0850a21 240%xmlcat_add() /usr/bin/xmlcatalog --noout --add nextCatalog \"\" %1 /etc/xml/catalog ;
241%xmlcat_del() /usr/bin/xmlcatalog --noout --del %1 /etc/xml/catalog ;
da745cb1 242%xmlcat_add_rewrite /usr/bin/xmlcatalog --noout --add rewriteSystem
a0850a21 243%xmlcat_create() /usr/bin/xmlcatalog --noout --create %1 ;
244%sgmlcat_add() /usr/bin/install-catalog --add %1 %2 > /dev/null ;
245%sgmlcat_del() /usr/bin/install-catalog --remove %1 %2 > /dev/null ;
c2c27a5a 246%docbook_sgmlcat_fix() { for l in \
247'' \
248' -- default decl --' \
249'DTDDECL "-//OASIS//DTD DocBook XML V%2//EN" "../../xml.dcl"' \
250' -- hacks for opensp --' \
251'SYSTEM "file://%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \
252'SYSTEM "http://www.oasis-open.org/docbook/xml/%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \
253'' \
254; do echo $l; done >> %1 \
255}
256
cd33aab7
AM
257#-----------------------------------------------------------------
258# find and gzip all files in %{_mandir} and %{infodir}
259#
260# Requires: xargs, find
261#
262#%no_install_post_compress_docs 1
263%__spec_install_post_compress_docs { \
cd33aab7 264%{!?no_install_post_compress_docs: \
89f18684 265 echo "Compress man and info pages."; \
cd33aab7
AM
266 %{?verbose:set -x;} \
267 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
268 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
269 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
270 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
271 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
272 fi; \
273 done; \
274} }
275
276#-----------------------------------------------------------------
277# Strip executable binaries and shared object files
278#
279# Requires: find, awk, strip, cut, xargs
280#
281#%no_install_post_strip 1
282%__spec_install_post_strip {%{!?debug: \
283%{!?no_install_post_strip: \
f80cefa3
JB
284 %{?verbose:set -x;} \
285 if [ -d "$RPM_BUILD_ROOT" ]; then \
5b0f0ac9 286 echo "Strip executable binaries, archives and shared object files."; \
aaa1486f 287 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
cd33aab7
AM
288 elfexelist=`echo $filelist | xargs -r file | \
289 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
290 elfsharedlist=`echo $filelist | xargs -r file | \
291 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
5b0f0ac9
MM
292 elfarchiveslist=`echo $filelist | xargs -r file | \
293 awk '/current ar archive/ {print $1}' | cut -d: -f1`; \
cd33aab7 294 if [ -n "$elfexelist" ]; then \
aaa1486f 295 %{__strip} --remove-section=.note --remove-section=.comment $elfexelist; \
cd33aab7
AM
296 fi; \
297 if [ -n "$elfsharedlist" ]; then \
aaa1486f 298 %{__strip} --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
5b0f0ac9
MM
299 fi; \
300 if [ -n "$elfarchiveslist" ]; then \
aaa1486f 301 %{__strip} --strip-debug --remove-section=.note --remove-section=.comment $elfarchiveslist; \
f80cefa3
JB
302 fi; \
303 fi; } \
cd33aab7 304} }
cc545e1a 305#-----------------------------------------------------------------
306# remove all RPATH from executable binaries and shared object files
307#
308# Requires: find, awk, cut, xargs, chrpath, uname
309#
310#%no_install_post_chrpath 1
311%__spec_install_post_chrpath {%{!?debug: \
312%{!?no_install_post_chrpath: \
313 %{?verbose:set -x;} \
f80cefa3 314if [ -d "$RPM_BUILD_ROOT" ]; then \
cc545e1a 315echo "Remove RPATH from executable binaries and shared object files."; \
aaa1486f 316find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" %{?_noautochrpath:! -regex "%{_noautochrpath}"} | xargs -r file | \
3d66db15 317 awk '/ELF.*(executable.*dynamically linked|shared object)/ {print $1}' | cut -d: -f1 | \
cc545e1a 318while read file ; do \
319 rpath= ; \
320 chmod u+w "$file"; \
321 for dir in `chrpath -l "$file" | \
322 awk '/RPATH=/ { gsub(/.*RPATH=/,""); gsub(/:/," "); print $0 }'` ; do \
323 case $dir in \
570a0c29 324 /home/* | /tmp/* | /usr/lib | /usr/lib64 | /lib | /lib64 | /usr/local/lib | /usr/local/lib64 | /usr/X11R6/lib | /usr/X11R6/lib64 ) \
cc545e1a 325 echo "remove-rpath: $dir in $file"; \
326 ;; \
327 * ) \
328 if [ "$rpath" = "" ] ; then rpath="$dir" ; \
329 else rpath="$rpath:$dir" ; fi ; \
330 ;; \
331 esac ; \
332 done ; \
333 if [ "$rpath" = "" ] ; then chrpath -d "$file" > /dev/null ; \
334 else chrpath -r "$rpath" "$file" > /dev/null ; fi ; \
f80cefa3
JB
335done; \
336fi; } \
cc545e1a 337} }
22a54b3e 338#-----------------------------------------------------------------
93b46c00 339# Find and gzip all kernel modules
340#
341# Requires: find
342#
343#%no_install_post_compress_modules 1
344%__spec_install_post_compress_modules { \
93b46c00 345%{!?no_install_post_compress_modules: \
346 %{?verbose:set -x;} \
f80cefa3
JB
347 if [ -d "$RPM_BUILD_ROOT" ]; then \
348echo "Compress kernel modules if any."; \
390bdd1d 349 if test -d $RPM_BUILD_ROOT/lib/modules ; then \
d0bdd45a
JB
350 find $RPM_BUILD_ROOT/lib/modules -name \*o -type f -print | \
351 xargs -r %{__gzip} -9nf; \
fe70546d 352 find $RPM_BUILD_ROOT/lib/modules -name \*o -type l -printf "%p %l\n" | \
92ebeb8d 353 while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
390bdd1d 354 fi; \
f80cefa3 355 fi; \
93b46c00 356} }
cd33aab7
AM
357
358%_source_payload w9.gzdio
359%_binary_payload w9.bzdio
360
aad1c8e4 361#-----------------------------------------------------------------
362# Update all GConf2 schemas
363#
364# Requires: GConf2
365#
03ff3333 366%gconf_schema_install { umask 022; \
367 GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" \
368 /usr/bin/gconftool-2 --makefile-install-rule \
369 /etc/gconf/schemas/*.schemas > /dev/null \
82b097b9 370}
aad1c8e4 371
cd33aab7
AM
372#-----------------------------------------------------------------
373# post %install sequence:
374# - autodeps exceptions
375# - compress all man and info pages,
376# - strip all ELF executables and ELF shared objects if not %debug.
5b0f0ac9 377# - compress kernel modules if any
cd33aab7
AM
378
379###################################################################
380# Requires/Provides automation
381# exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
a4852742 382#
fbbdca08
JB
383%__noautoreqfiles %(sed -e s'/#.*//' /etc/rpm/noautoreqfiles)%{?_noautoreqfiles: %{_noautoreqfiles}}
384%__noautoprovfiles %(sed -e s'/#.*//' /etc/rpm/noautoprovfiles)%{?_noautoprovfiles: %{_noautoprovfiles}}
385%__noautoreq %(sed -e s'/#.*//' /etc/rpm/noautoreq)%{?_noautoreq: %{_noautoreq}}
386%__noautoreqdep %(sed -e s'/#.*//' /etc/rpm/noautoreqdep)%{?_noautoreqdep: %{_noautoreqdep}}
387%__noautoprov %(sed -e s'/#.*//' /etc/rpm/noautoprov)%{?_noautoprov: %{_noautoprov}}
a4852742
JB
388#%_noautocompressdoc %{nil}
389#
5b0f0ac9
MM
390%_missing_doc_files_terminate_build 1%{nil}
391%_unpackaged_files_terminate_build %{nil}
4c7d3ba4 392# (X)emacs support
42b7e5ac 393%___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
394%_emacs_lispdir %(emacs %___emacs_lispdir_helper)
395%_xemacs_lispdir %(xemacs %___emacs_lispdir_helper)
41a62699 396
984f6de6
JK
397%__php_provides %{nil}
398%__php_requires %{nil}
399%__perl_provides %{nil}
400%__perl_requires %{nil}
41a62699
AF
401
402# Perl specific macro definitions.
942c693c
AF
403%perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
404%perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
405%perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
406%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
407%perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
408%perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
41a62699 409
942c693c 410%php_pear_dir %{_datadir}/pear
41a62699
AF
411
412# Python specific macro definitions.
413# python main version
942c693c 414%py_ver %(echo `python -c "import sys; print sys.version[:3]"`)
41a62699
AF
415
416# directories
942c693c 417%py_prefix %(echo `python -c "import sys; print sys.prefix"`)
4ef692e4 418%py_libdir %{py_prefix}/%{_lib}/python%{py_ver}
a4f0b5e0 419%py_scriptdir %{py_prefix}/share/python%{py_ver}
942c693c 420%py_incdir /usr/include/python%{py_ver}
a4f0b5e0
JK
421%py_sitedir %{py_libdir}/site-packages
422%py_sitescriptdir %{py_scriptdir}/site-packages
942c693c 423%py_dyndir %{py_libdir}/lib-dynload
41a62699
AF
424
425# pure python modules compilation
942c693c 426%py_comp python -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
41a62699 427
942c693c 428%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
429
430# Software written in Python language require Python with main version
9140af5d 431%pyrequires_eq() Requires: python(bytecode) = %py_ver %1
41a62699 432
67ed5b97 433# depmod macro
434%depmod() { \
fe30b3ea 435umask 022; \
67ed5b97 436if [ -e /boot/System.map-%1 ]; then \
437 /sbin/depmod -a -F /boot/System.map-%1 %1; \
438else \
439 if [ -e /boot/System.map ]; then \
440 /sbin/depmod -a -F /boot/System.map %1; \
441 else \
442 /sbin/depmod -a %1; \
443 fi \
444fi; \
445}
446
495892af 447# XMMS specific macros
2f163afd
JB
448%xmms_prefix %(xmms-config --prefix)
449%xmms_exec_prefix %(xmms-config --exec-prefix)
450%xmms_version %(xmms-config --version)
451%xmms_datadir %(xmms-config --data-dir)
452%xmms_plugindir %(xmms-config --plugin-dir)
453%xmms_visualization_plugindir %(xmms-config --visualization-plugin-dir)
454%xmms_input_plugindir %(xmms-config --input-plugin-dir)
455%xmms_output_plugindir %(xmms-config --output-plugin-dir)
456%xmms_effect_plugindir %(xmms-config --effect-plugin-dir)
457%xmms_general_plugindir %(xmms-config --general-plugin-dir)
495892af 458
59d9979d 459%_target_base_arch %(echo %{_target_cpu} | sed 's/i.86/i386/;s/athlon/i386/;s/pentium./i386/;s/amd64/x86_64/')
e3618ee9 460
461# user/group checking macros
462#
463# Usage:
464# %userremove myuser
465#
466%userremove /usr/lib/rpm/user_group.sh user del
467%groupremove /usr/lib/rpm/user_group.sh group del
468#
469# Usage:
470# if %usertestrm myuser; then
471# /usr/sbin/userdel -r myuser
472# Note:
473# use these macros only if you need to call userdel/groupdel with
474# a non-standard option or take an extra action; otherwise use the
475# %userremove/%groupremove macros
476#
477%usertestrm /usr/lib/rpm/user_group.sh user testrm
478%grouptestrm /usr/lib/rpm/user_group.sh group testrm
13f70a2c
JK
479# user group membership management macros
480#
481# Usage:
482# %addusertogroup myuser agroup
483#
484%addusertogroup /usr/lib/rpm/user_group.sh user addtogroup
bfd9689c 485
486# banner support (useful in {pre,post}{,un} and triggers)
487#
488# Usage:
fb033326 489# %banner name [-a] [-e] [-n] [-tn]
bfd9689c 490# the banner text, the banner text
491# the banner text, and following line HAVE TO BE:
492# EOF
493# -a - append to the banner
fb033326 494# -e - send to stderr instead of stdout
1257c400 495# -n - no show banner (overrides -t)
496# -t - show only, if RPM_SCRIPTVERBOSITY >= n; default n=5
fb033326 497%banner(a:e:n:t:) \
f1bbc6ff 498RPM_SCRIPTVERBOSITY=5 \
499[ -r /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm \
500if [ -x /usr/bin/banner.sh ]; then \
1257c400 501 CMD="/usr/bin/banner.sh %{-e:--stderr} %{!-n:\`[ $RPM_SCRIPTVERBOSITY -ge %{-t:%{-t*}}%{!-t:5} ] && echo '-s'\`} %{!-a:-m}%{-a:-M} %1" \
f1bbc6ff 502else \
fb033326 503 CMD="cat%{-e: >&2}" \
f1bbc6ff 504fi \
505$CMD << EOF \
bfd9689c 506%nil
1257c400 507
This page took 0.168046 seconds and 4 git commands to generate.