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