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