]> git.pld-linux.org Git - packages/rpm.git/blob - rpm.macros
- pear macros moved from macros.php, this is where they belong
[packages/rpm.git] / rpm.macros
1 # $Revision$, $Date$
2 # PLD rpm macros
3
4 %epoch          0
5 %x8664          x86_64 amd64 ia32e
6
7 # kernel compiler
8 %kgcc           %{__cc}
9 %kgcc_package   gcc
10
11 %_source_payload        w9.gzdio
12 %_binary_payload        w9.bzdio
13
14 # Build system path macros.
15 #
16 %__autoconf             autoconf %{?debug:-Wall}
17 %__automake             automake -a -c -f --foreign
18 %__autopoint            autopoint --force
19
20 %__gettextize { \
21 if ! gettextize --version | grep -q '0\.10\.' ; then \
22         if grep -qs 'AM_GNU_GETTEXT.*external' configure.{ac,in} ; then \
23                 gettextize --copy --force --no-changelog; \
24         else \
25                 gettextize --copy --force --no-changelog --intl; \
26         fi; \
27         if [ ! -f po/Makevars ]; then \
28                 cp -f po/Makevars{.template,}; \
29         fi; \
30 else \
31         gettextize --copy --force; \
32 fi; \
33 }
34
35 %__glib_gettextize      glib-gettextize --copy --force
36 %__gnome_doc_common     gnome-doc-common --copy
37 %__gtkdocize            gtkdocize --copy
38 %__intltoolize          intltoolize --copy --force
39 %__libtoolize           libtoolize --copy --force
40
41 #       The number of cvs changelog entries kept when building package.
42 %_buildchangelogtruncate 20
43
44 %dependencytracking     %{nil}
45
46 #       Relations between package names that cause dependency loops
47 #       with legacy packages that cannot be fixed. Relations are
48 #       specified as
49 #               p>q
50 #       where package p has a Requires: on something that package q Provides:
51 #
52 # XXX   Note: that there cannot be any whitespace within the string "p>q",
53 #       and that both p and q are package names (i.e. no version/release).
54 %_dependency_whiteout   %{nil}
55
56 #-----------------------------------------------------------------
57 %configure2_13 { \
58  if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
59  LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \
60  CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
61  CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" ; export CXXFLAGS ; \
62  FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
63  CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
64  %{?__cc:CC="%{__cc}" ; export CC ; } \
65  %{?__cxx:CXX="%{__cxx}" ; export CXX ; } \
66  %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \
67         --host=%{_target_platform} \
68         --prefix=%{_prefix} \
69         --exec-prefix=%{_exec_prefix} \
70         --bindir=%{_bindir} \
71         --sbindir=%{_sbindir} \
72         --sysconfdir=%{_sysconfdir} \
73         --datadir=%{_datadir} \
74         --includedir=%{_includedir} \
75         --libdir=%{_libdir} \
76         --libexecdir=%{_libexecdir} \
77         --localstatedir=%{_localstatedir} \
78         --sharedstatedir=%{_sharedstatedir} \
79         --mandir=%{_mandir} \
80         --infodir=%{_infodir} \
81         --x-libraries=%{?_x_libraries}%{!?_x_libraries:%{_libdir}} \
82         %{dependencytracking} \
83 }
84
85 %cmake { \
86 CC="%{__cc}" \
87 CXX="%{__cxx}" \
88 CFLAGS="%{rpmcflags}" \
89 CXXFLAGS="%{rpmcxxflags}" \
90 cmake \
91 }
92
93 #----------------------------------------------------------------
94 %global configure_cache 0
95 %configure_cache_file   %{buildroot}.configure.cache
96
97 %configure {./configure \
98         LDFLAGS="${LDFLAGS:-%rpmldflags}" \
99         CFLAGS="${CFLAGS:-%rpmcflags}" \
100         CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" \
101         FFLAGS="${FFLAGS:-%rpmcflags}" \
102         CPPFLAGS="${CPPFLAGS:-}" \
103         %{?__cc:CC="%{__cc}"} \
104         %{?__cxx:CXX="%{__cxx}"} \
105         --host=%{_target_platform} \
106         --build=%{_target_platform} \
107         --prefix=%{_prefix} \
108         --exec-prefix=%{_exec_prefix} \
109         --bindir=%{_bindir} \
110         --sbindir=%{_sbindir} \
111         --sysconfdir=%{_sysconfdir} \
112         --datadir=%{_datadir} \
113         --includedir=%{_includedir} \
114         --libdir=%{_libdir} \
115         --libexecdir=%{_libexecdir} \
116         --localstatedir=%{_localstatedir} \
117         --sharedstatedir=%{_sharedstatedir} \
118         --mandir=%{_mandir} \
119         --infodir=%{_infodir} \
120         --x-libraries=%{?_x_libraries}%{!?_x_libraries:%{_libdir}} \
121         %{dependencytracking} \
122         %{?configure_cache:--cache-file=%{configure_cache_file:-%{buildroot}.configure.cache}} \
123 }
124
125 # ------------------------------------------------------------------------
126 # Overloading of some basic macros
127 %prep \
128 %%prep\
129 LANG=C\
130 export LANG\
131 unset DISPLAY ||:\
132 unset LINGUAS ||:\
133 %{nil}
134
135 %build %%build\
136 LANG=C\
137 export LANG\
138 unset DISPLAY ||:\
139 unset LINGUAS ||:\
140 %{nil}
141
142 %install \
143 %if 0%{?_enable_debug_packages}\
144 %{?buildsubdir:%{debug_package}}\
145 %endif\
146 %%install\
147 LANG=C\
148 export LANG\
149 unset DISPLAY ||:\
150 unset LINGUAS ||:\
151 %{nil}
152
153 # Location of autoconf macros
154 %_aclocaldir    %(aclocal --print-ac-dir)
155
156 # Location of omf files
157 %_omf_dest_dir  %(scrollkeeper-config --omfdir)
158
159 # Location of pkgconfig files
160 %_pkgconfigdir  /usr/%{_lib}/pkgconfig
161
162 # Location of desktop files
163 %_desktopdir    /usr/share/applications
164 %_applnkdir     ERROR:_applnkdir_is_obsolete_use_desktopdir_instead
165
166 # Location of pixmaps for applnk/desktop files
167 %_pixmapsdir    /usr/share/pixmaps
168
169 # Location of themable icons for applnk/desktop files
170 %_iconsdir      /usr/share/icons
171
172 # Location of fonts directories
173 %_fontsdir      /usr/share/fonts
174
175 # Location of Gtk and associated libraries documentation
176 %_gtkdocdir     %{_defaultdocdir}/gtk-doc/html
177
178 # Location of KDE documentation
179 %_kdedocdir     %{_defaultdocdir}/kde/HTML
180
181 # unsermake script
182 %__unsermake /usr/share/unsermake/unsermake
183
184 # Current date
185 %date           %(LC_ALL="C" date +"%a %b %d %Y")
186
187 # tmp directory
188 %tmpdir         %(echo "${TMPDIR:-/tmp}")
189
190 # Example files, programs, scripts...
191 %_examplesdir   /usr/src/examples
192
193 # Alternative kernel type/version
194 %alt_kernel     %{nil}%{?_alt_kernel:-%{?_alt_kernel}}
195
196 # The directory holding Linux kernel sources
197 %_kernelsrcdir  /usr/src/linux%{alt_kernel}
198
199 # If non-empty "debug" macro defined, add "dbg" suffix to release number
200 %_rpmfilename           %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
201
202 # Requires name = version-release
203 %requires_releq()               %(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}-%%{release}\\n' | sed -e 's/ (none):/ /' | grep -v "is not")
204
205 %releq_kernel_up()              %((LC_ALL="C" rpm -qf --qf '%%{name}-up = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h 2>/dev/null || echo ERROR) | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
206 %releq_kernel_smp()             %((LC_ALL="C" rpm -qf --qf '%%{name}-smp = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h 2>/dev/null || echo ERROR) | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
207 %requires_releq_kernel_up(s:)   Requires%{-s:(%{-s*})}: %releq_kernel_up
208 %requires_releq_kernel_smp(s:)  Requires%{-s:(%{-s*})}: %releq_kernel_smp
209
210 %requires_eq()          %(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
211 %requires_eq_to() %(LC_ALL="C" rpm -q --qf 'Requires: %1 = %%{epoch}:%%{version}\\n' %2 | sed -e 's/ (none):/ /' | grep -v "is not")
212
213 %apache_modules_api %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache/ap_mmn.h 2>/dev/null || echo ERROR)
214
215 # kernel version-release handling
216 %__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))
217 %__kernel_rel   %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h 2>/dev/null --qf "%{RELEASE}" | grep -v "is not")
218 %__kernel_rpmvr %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h 2>/dev/null --qf "%{VERSION}-%{RELEASE}" | grep -v "is not")
219 %_kernel_ver    %{__kernel_ver}%{?with_dist_kernel:%(echo %{__kernel_ver} | grep -q -e - || echo -%{__kernel_rel})}
220 %_kernel_ver_str %(echo %{!?_without_dist_kernel:%{__kernel_rpmvr}}%{?_without_dist_kernel:%{__kernel_ver}} | sed -e 's/-/_/g')
221
222 # sgml macros
223 %xmlcat_add()           /usr/bin/xmlcatalog --noout --add nextCatalog \"\" %1 /etc/xml/catalog ;
224 %xmlcat_del()           /usr/bin/xmlcatalog --noout --del %1 /etc/xml/catalog ;
225 %xmlcat_add_rewrite     /usr/bin/xmlcatalog --noout --add rewriteSystem
226 %xmlcat_create()        /usr/bin/xmlcatalog --noout --create %1 ;
227 %sgmlcat_add()          /usr/bin/install-catalog --add %1 %2 > /dev/null ;
228 %sgmlcat_del()          /usr/bin/install-catalog --remove %1 %2 > /dev/null ;
229 %docbook_sgmlcat_fix() { for l in \
230 '' \
231 '  -- default decl --' \
232 'DTDDECL "-//OASIS//DTD DocBook XML V%2//EN" "../../xml.dcl"' \
233 '  -- hacks for opensp --' \
234 'SYSTEM "file://%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \
235 'SYSTEM "http://www.oasis-open.org/docbook/xml/%2/docbookx.dtd"                  "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \
236 '' \
237 ; do echo $l; done >> %1 \
238 }
239
240 #-----------------------------------------------------------------
241 # find and gzip all files in %{_mandir} and %{infodir}
242 #
243 # Requires: xargs, find
244 #
245 #%no_install_post_compress_docs 1
246 %__spec_install_post_compress_docs { \
247 %{!?no_install_post_compress_docs:__spec_install_post_compress_docs() { \
248         echo "Compress man and info pages."; \
249         for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
250                 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
251                         find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
252                         find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
253                         find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
254                 fi; \
255         done; \
256 }; __spec_install_post_compress_docs } }
257
258 #-----------------------------------------------------------------
259 # Strip executable binaries and shared object files
260 #
261 # Requires: find, awk, strip, cut, xargs
262 #
263 #%no_install_post_strip 1
264 %__spec_install_post_strip {%{!?debug: \
265 %{!?no_install_post_strip:__spec_install_post_strip() { \
266         if [ -d "$RPM_BUILD_ROOT" ]; then \
267         echo "Strip executable binaries, archives and shared object files."; \
268         filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*\.debug" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
269         elfexelist=`echo $filelist | xargs -r file | \
270                 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
271         elfsharedlist=`echo $filelist | xargs -r file | \
272                 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
273         elfarchiveslist=`echo $filelist | xargs -r file | \
274                 awk '/current ar archive/ {print $1}' | cut -d: -f1`; \
275         if [ -n "$elfexelist" ]; then \
276                 %{__strip} --remove-section=.note --remove-section=.comment $elfexelist; \
277         fi; \
278         if [ -n "$elfsharedlist" ]; then \
279                 %{__strip} --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
280         fi; \
281         if [ -n "$elfarchiveslist" ]; then \
282                 %{__strip} --strip-debug --remove-section=.note --remove-section=.comment $elfarchiveslist; \
283         fi; \
284 fi; }; __spec_install_post_strip } } }
285
286 #-----------------------------------------------------------------
287 # remove all RPATH from executable binaries and shared object files
288 #
289 # Requires: find, awk, cut, xargs, chrpath, uname
290 #
291 #%no_install_post_chrpath       1
292 %__spec_install_post_chrpath {%{!?debug: \
293 %{!?no_install_post_chrpath: __spec_install_post_chrpath() { \
294 if [ -d "$RPM_BUILD_ROOT" ]; then \
295 echo "Remove RPATH from executable binaries and shared object files."; \
296 find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*" %{?_noautochrpath:! -regex "%{_noautochrpath}"} | xargs -r file | \
297         awk '/ELF.*(executable.*dynamically linked|shared object)/ {print $1}' | cut -d: -f1 | \
298 while read file ; do \
299         rpath= ; \
300         chmod u+w "$file"; \
301         for dir in `chrpath -l "$file" | \
302                         awk '/RPATH=/ { gsub(/.*RPATH=/,""); gsub(/:/," "); print $0 }'` ; do \
303                         case $dir in \
304                         /home/* | /tmp/* | /usr/lib | /usr/lib64 | /lib | /lib64 | /usr/local/lib | /usr/local/lib64 | /usr/X11R6/lib | /usr/X11R6/lib64 ) \
305                                 echo "remove-rpath: $dir in $file"; \
306                                 ;; \
307                         * ) \
308                                 if [ "$rpath" = "" ] ; then rpath="$dir" ; \
309                                 else rpath="$rpath:$dir" ; fi ; \
310                                 ;; \
311                         esac ; \
312         done ; \
313         if [ "$rpath" = "" ] ; then chrpath -d "$file" > /dev/null ; \
314         else chrpath -r "$rpath" "$file" > /dev/null ; fi ; \
315 done; \
316 fi; }; __spec_install_post_chrpath } } }
317
318 #-----------------------------------------------------------------
319 # Find and gzip all kernel modules
320 #
321 # Requires: find
322 #
323 #%no_install_post_compress_modules      1
324 %__spec_install_post_compress_modules { \
325 %{!?no_install_post_compress_modules: __spec_install_post_compress_modules() { \
326         if [ -d "$RPM_BUILD_ROOT" ]; then \
327                 echo "Compress kernel modules if any."; \
328                 if test -d $RPM_BUILD_ROOT/lib/modules ; then \
329                         find $RPM_BUILD_ROOT/lib/modules -name \*o -type f -print | \
330                         xargs -r %{__gzip} -9nf; \
331                         find $RPM_BUILD_ROOT/lib/modules -name \*o -type l -printf "%p %l\n" | \
332                         while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
333                 fi; \
334         fi; \
335 }; __spec_install_post_compress_modules } }
336
337 # Remove common Perl files we don't package
338 %__spec_install_post_perl_clean {\
339 %{!?no_install_post_perl_clean: \
340 %{?pdir:rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/%{pdir}%{?pnam:/%(echo %{pnam} | tr - /)}/.packlist}} \
341 } }
342
343 #-----------------------------------------------------------------
344 # Update GConf2 schemas
345 #
346 # Requires: GConf2
347 #
348 %gconf_schema_install() \
349         umask 022; \
350         GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" /usr/bin/gconftool-2 --makefile-install-rule /etc/gconf/schemas/%{?1}%{!?1:*.schemas} > /dev/null \
351         %{nil}
352
353 %gconf_schema_uninstall() \
354 if [ $1 = 0 ]; then \
355         umask 022; \
356         GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" /usr/bin/gconftool-2 --makefile-uninstall-rule /etc/gconf/schemas/%{?1} > /dev/null \
357 fi \
358 %{nil}
359
360 #-----------------------------------------------------------------
361 # Update desktop MIME database
362 # requires: desktop-file-utils
363 #
364 %update_desktop_database_post() {{ \
365         umask 022; \
366         /usr/bin/update-desktop-database; \
367 }}
368
369 %update_desktop_database_postun() {{ \
370 if [ $1 = 0 ]; then \
371         umask 022; \
372         /usr/bin/update-desktop-database; \
373 fi \
374 }}
375
376 #-----------------------------------------------------------------
377 # Update scrollkeeper database
378 # requires: scrollkeeper
379 #
380 %scrollkeeper_update_post() \
381         /usr/bin/scrollkeeper-update -q; \
382         %{nil}
383
384 %scrollkeeper_update_postun() \
385 if [ $1 = 0 ]; then \
386         /usr/bin/scrollkeeper-update -q; \
387 fi \
388 %{nil}
389
390 #-----------------------------------------------------------------
391 # post %install sequence:
392 # - autodeps exceptions
393 # - compress all man and info pages,
394 # - strip all ELF executables and ELF shared objects if not %debug.
395 # - compress kernel modules if any
396
397 ###################################################################
398 # Requires/Provides automation
399 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
400 #
401 %__noautoreqfiles       %(sed -e s'/#.*//' /etc/rpm/noautoreqfiles)%{?_noautoreqfiles: %{_noautoreqfiles}}
402 %__noautoprovfiles      %(sed -e s'/#.*//' /etc/rpm/noautoprovfiles)%{?_noautoprovfiles: %{_noautoprovfiles}}
403 %__noautoreq            %(sed -e s'/#.*//' /etc/rpm/noautoreq)%{?_noautoreq: %{_noautoreq}}
404 %__noautoreqdep         %(sed -e s'/#.*//' /etc/rpm/noautoreqdep)%{?_noautoreqdep: %{_noautoreqdep}}
405 %__noautoprov           %(sed -e s'/#.*//' /etc/rpm/noautoprov)%{?_noautoprov: %{_noautoprov}}
406 #%_noautocompressdoc    %{nil}
407 #
408 %_missing_doc_files_terminate_build     1%{nil}
409 %_unpackaged_files_terminate_build      %{nil}
410 # (X)emacs support
411 %___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;}'
412 %_emacs_lispdir %(emacs %___emacs_lispdir_helper)
413 %_xemacs_lispdir %(xemacs %___emacs_lispdir_helper)
414
415 %__php_provides %{nil}
416 %__php_requires %{nil}
417 %__perl_provides %{nil}
418 %__perl_requires %{nil}
419 %__mono_provides %{nil}
420 %__mono_requires %{nil}
421
422 # Perl specific macro definitions.
423 %perl_privlib           %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
424 %perl_archlib           %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
425 %perl_vendorlib         %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
426 %perl_vendorarch        %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
427 %perl_sitelib           %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
428 %perl_sitearch          %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
429
430 # Ruby
431 %ruby_archdir           %(ruby -r rbconfig -e 'print Config::CONFIG["archdir"]' 2>/dev/null || echo ERROR)
432 %ruby_ridir             %(ruby -r rbconfig -e 'include Config; print File.join(CONFIG["datadir"], "ri", CONFIG["ruby_version"], "system")' 2>/dev/null || echo ERROR)
433 %ruby_rubylibdir        %(ruby -r rbconfig -e 'print Config::CONFIG["rubylibdir"]' 2>/dev/null || echo ERROR)
434 %ruby_sitearchdir       %(ruby -r rbconfig -e 'print Config::CONFIG["sitearchdir"]' 2>/dev/null || echo ERROR)
435 %ruby_sitelibdir        %(ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]' 2>/dev/null || echo ERROR)
436 %ruby_version           %(ruby -r rbconfig -e 'print Config::CONFIG["ruby_version"]' 2>/dev/null || echo ERROR)
437 %ruby_ver_requires_eq   Requires:       ruby(ver) = %ruby_version
438 %ruby_mod_ver_requires_eq       Requires:       ruby-modules(ver) = %ruby_version
439
440 %php_pear_dir   %{_datadir}/pear
441
442 # directory where php includes are installed on system.
443 %__php_includedir               /usr/include/php
444 # extract php/zend api versions
445 %php_major_version              %(awk '/#define PHP_MAJOR_VERSION/{print $3}' %{__php_includedir}/main/php_version.h 2>/dev/null || echo ERROR)
446 %php_api_version                %(awk '/#define PHP_API_VERSION/{print $3}' %{__php_includedir}/main/php.h 2>/dev/null || echo ERROR)
447 %php_pdo_api_version    %(awk '/#define PDO_DRIVER_API/{print $3}' %{__php_includedir}/ext/pdo/php_pdo_driver.h 2>/dev/null || echo ERROR)
448 %php_debug                              %(awk '/#define ZEND_DEBUG/{print $3}' %{__php_includedir}/main/php_config.h 2>/dev/null || echo ERROR)
449 %zend_module_api                %(awk '/#define ZEND_MODULE_API_NO/{print $3}' %{__php_includedir}/Zend/zend_modules.h 2>/dev/null || echo ERROR)
450 %zend_extension_api             %(awk '/#define ZEND_EXTENSION_API_NO/{print $3}' %{__php_includedir}/Zend/zend_extensions.h 2>/dev/null || echo ERROR)
451 %zend_zts                               %(Z=$(grep -sc '^#define ZTS 1' %{__php_includedir}/main/php_config.h); echo ${Z:-ERROR})
452
453 # helper macro
454 %__php_api_requires(v:) Requires: php%{-v*}(%{expand:%1}) = %{expand:%{%{!?2:%{1}}%{?2}}}
455
456 # macros for public use
457 # for php extensions (php-pecl)
458 %requires_php_extension %{__php_api_requires modules_api php_api_version} \
459 %{__php_api_requires -v %php_major_version debug php_debug} \
460 %{__php_api_requires -v %php_major_version thread-safety zend_zts}
461
462 # for zend extensions
463 %requires_zend_extension %{__php_api_requires zend_module_api} \
464 %{__php_api_requires zend_extension_api} \
465 %{__php_api_requires -v %php_major_version debug php_debug} \
466 %{__php_api_requires -v %php_major_version thread-safety zend_zts}
467
468 # for php pdo modules (php-pecl-PDO_*)
469 %requires_php_pdo_module %{__php_api_requires PDO_API php_pdo_api_version}
470
471 # Python specific macro definitions.
472 # python main version
473 %py_ver         %(python -c "import sys; print sys.version[:3]")
474
475 # directories
476 %py_prefix              %(python -c "import sys; print sys.prefix")
477 %py_libdir              %{py_prefix}/%{_lib}/python%{py_ver}
478 %py_scriptdir   %{py_prefix}/share/python%{py_ver}
479 %py_incdir              /usr/include/python%{py_ver}
480 %py_sitedir     %{py_libdir}/site-packages
481 %py_sitescriptdir %{py_scriptdir}/site-packages
482 %py_dyndir              %{py_libdir}/lib-dynload
483
484 # pure python modules compilation
485 %py_comp                python -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
486
487 %py_ocomp               python -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
488
489 # Software written in Python language require Python with main version
490 %pyrequires_eq() Requires:      %1
491
492 # Hardlink binary identical .pyc and .pyo files
493 # (idea by glen <at> pld-linux <dot> org)
494 %__spec_install_post_py_hardlink {\
495 %{!?no_install_post_py_hardlink: __spec_install_post_py_hardlink() { \
496 [ ! -d "$RPM_BUILD_ROOT" ] || find "$RPM_BUILD_ROOT" -name '*.pyc' | while read a; do \
497         b="$(echo $a|sed -e 's/.pyc$/.pyo/')"; \
498         if cmp -s "$a" "$b"; then \
499                 ln -f "$a" "$b"; \
500         fi; \
501 done \
502 }; __spec_install_post_py_hardlink } }
503
504 # remove python sources, so that check-files won't complain
505 # (idea by glen <at> pld-linux <dot> org)
506 %py_postclean() \
507 for d in %{py_sitescriptdir} %{py_sitedir} %*; do \
508  [ ! -d "$RPM_BUILD_ROOT$d" ] || find "$RPM_BUILD_ROOT$d" -name '*.py' -print0 | xargs -0r -l512 rm;\
509 done \
510 %{nil}
511
512 # depmod macro
513 %depmod() { \
514 umask 022; \
515 if [ -e /boot/System.map-%1 ]; then \
516         /sbin/depmod -a -F /boot/System.map-%1 %1; \
517 else \
518         if [ -e /boot/System.map ]; then \
519                 /sbin/depmod -a -F /boot/System.map %1; \
520         else \
521                 /sbin/depmod -a %1; \
522         fi \
523 fi; \
524 }
525
526 # XMMS specific macros
527 %xmms_prefix                    %(xmms-config --prefix 2>/dev/null)
528 %xmms_exec_prefix               %(xmms-config --exec-prefix 2>/dev/null)
529 %xmms_version                   %(xmms-config --version 2>/dev/null)
530 %xmms_datadir                   %(xmms-config --data-dir 2>/dev/null)
531 %xmms_plugindir                 %(xmms-config --plugin-dir 2>/dev/null)
532 %xmms_visualization_plugindir   %(xmms-config --visualization-plugin-dir 2>/dev/null)
533 %xmms_input_plugindir           %(xmms-config --input-plugin-dir 2>/dev/null)
534 %xmms_output_plugindir          %(xmms-config --output-plugin-dir 2>/dev/null)
535 %xmms_effect_plugindir          %(xmms-config --effect-plugin-dir 2>/dev/null)
536 %xmms_general_plugindir         %(xmms-config --general-plugin-dir 2>/dev/null)
537
538 %_target_base_arch      %(echo %{_target_cpu} | sed 's/i.86/i386/;s/athlon/i386/;s/pentium./i386/;s/amd64/x86_64/;s/ia32e/x86_64/')
539
540 # user/group checking macros
541 #
542 # Usage:
543 #       %userremove myuser
544 #
545 %userremove     /usr/lib/rpm/user_group.sh user del
546 %groupremove    /usr/lib/rpm/user_group.sh group del
547 #
548 # Usage:
549 #       if %usertestrm myuser; then
550 #               /usr/sbin/userdel -r myuser
551 # Note:
552 #       use these macros only if you need to call userdel/groupdel with
553 #       a non-standard option or take an extra action; otherwise use the
554 #       %userremove/%groupremove macros
555 #
556 %usertestrm     /usr/lib/rpm/user_group.sh user testrm
557 %grouptestrm    /usr/lib/rpm/user_group.sh group testrm
558 # user group membership management macros
559 #
560 # Usage:
561 #       %addusertogroup myuser agroup
562 #
563 %addusertogroup /usr/lib/rpm/user_group.sh user addtogroup
564
565 # banner support (useful in {pre,post}{,un} and triggers)
566 #
567 # Usage:
568 #       %banner name [-a] [-e] [-n] [-tn] <<EOF
569 # the banner text, the banner text
570 # the banner text, and following line
571 #EOF
572 # You can use any form of here-document, <<'EOF' <<-EOT will do.
573 # NOTE: if your use "<<-EOF", then You can actually indent inside here-document.
574 #
575 # -a   - append to the banner
576 # -e   - send to stderr instead of stdout
577 # -n   - no show banner (overrides -t)
578 # -t   - show only, if RPM_SCRIPTVERBOSITY >= n; default n=5
579 %banner(aent:)  \
580 RPM_SCRIPTVERBOSITY=5 \
581 [ -r /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm \
582 if [ -x /usr/bin/banner.sh ]; then \
583         CMD="/usr/bin/banner.sh %{-e:--stderr} %{!-n:$([ $RPM_SCRIPTVERBOSITY -ge %{-t:%{-t*}}%{!-t:5} ] && echo -s)} %{!-a:-m}%{-a:-M} %1" \
584 else \
585         CMD="cat%{-e: >&2}" \
586 fi \
587 eval $CMD %2%{?3: %3} \
588 %nil
589
590 # useradd/groupadd macros written by glen@pld-linux.org.
591 # All rights reserved. Permission to copy is hereby granted.. yada, yada, yada
592 #
593 # Usage:
594 #   %useradd [-P package] [-u uid] [-d home_dir] [-s shell] [-c comment]
595 #   [-g initial_group] [-G group[,...]] login
596 #
597 #  -u uid. REQUIRED
598 #  -g gid/group. REQUIRED
599 #  -s defaults to /bin/false
600 #  -d defaults to /usr/share/empty
601 #  -c No default
602 #  -r is accepted but ignored (it's always set)
603 #  -k skeleton dir. defaults to /usr/share/empty
604 # rpm specific flags
605 #  -P package name. defaults to %{name}
606 #
607 %useradd(c:d:e:f:g:G:Mmk:op:s:u:rP:) \
608 %{!-u:%{error:useradd: Required argument -u missing}} \
609 %{!-g:%{error:useradd: Required argument -g missing}} \
610 %{!?1:%{error:useradd: Required parameter login missing}} \
611 if [ -n "`/bin/id -u %{expand:%{%{#}}} 2>/dev/null`" ]; then \
612         if [ "`/bin/id -u %{expand:%{%{#}}}`" != "%{-u*}" ]; then \
613                 echo "Error: user %{expand:%{%{#}}} doesn't have uid=%{-u*}. Correct this before installing %{-P*}%{!?-P:%{name}}." 1>&2 \
614                 exit 1 \
615         fi \
616 else \
617         echo "Adding user %{expand:%{%{#}}} UID=%{-u*}." \
618         /usr/sbin/useradd \\\
619                 %{-m:-m -k %{-k*}%{!-k:/usr/share/empty}} \\\
620                 -u %{-u*} \\\
621                 -r \\\
622                 -d %{-d*}%{!-d:/usr/share/empty} \\\
623                 -s %{-s*}%{!-s:/bin/false} \\\
624                 %{-c:-c "%(set -- %{-c*} %{*}; echo $1)"}\\\
625                 -g %{-g*} \\\
626                 %{-M} \\\
627                 %{-G:-G %{-G*}} \\\
628                 %{expand:%{%{#}}} 1>&2 || exit $? \
629         [ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd \
630 fi;
631
632 # Usage:
633 #   %groupadd [-P package] [-g gid] group
634 #
635 # -g gid. REQUIRED
636 #
637 # Sample:
638 #   %groupadd -P %{name}-base -g %{gid} %{name}
639
640 %groupadd(g:P:rfo)      \
641 %{!-g:%{error:groupadd: Required argument -g missing}} \
642 %{!?1:%{error:groupadd: Required parameter group missing}} \
643 if [ -n "`/usr/bin/getgid %{1}`" ]; then \
644         if [ "`/usr/bin/getgid %{1}`" != "%{-g*}" ]; then \
645                 echo "Error: group %{1} doesn't have gid=%{-g*}. Correct this before installing %{-P*}%{!?-P:%{name}}." 1>&2 \
646                 exit 1 \
647         fi \
648 else \
649         echo "Adding group %{1} GID=%{-g*}." \
650         /usr/sbin/groupadd -g %{-g*} -r %{1} 1>&2 || exit $? \
651         [ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group \
652 fi;
653
654 # apache_config_{install/uninstall} macros written by glen@pld-linux.org.
655 # All rights reserved. Permission to copy is hereby granted.. yada, yada, yada
656 #
657 # You should use webapp macros instead. these are here until single piece of them is gone from specs ;)
658 #
659 # The config is installed/removed inside trigger, this means that you can any
660 # time install apache1 or apache package and the configuration file is updated.
661 # if you don't need the config for various reason for specific apache, just
662 # remove the symlink from apache config directory. the trigger will not put the
663 # config again to that version of apache. In other words the config is linked
664 # to apache config directory on first install of PACKAGE or apache.
665 #
666 # should be called in trigger body:
667 #  %triggerin -- apache1 >= 1.3.33-2
668 #  %apache_config_install -v 1
669 #
670 # Add package's apache config to apache config.
671 #
672 # Usage:
673 #   %apache_config_install -v {1|2} -c %{_sysconfdir}/apache-%{name}.conf -n 99
674 #
675 #  -v REQUIRED: specify apache version. can be 1 or 2.
676 #  -c OPTIONAL: specify full path to PACKAGE's config. Defaults to %{_sysconfdir}/apache-%{name}.conf.
677 #  -n OPTIONAL: specify config "slot". defaults to 99
678 #  -f OPTIONAL: force symlink creation regardless if package was upraded. useful in triggers
679 #
680 # Internal macros. don't use ;).
681 # expands apache config dir by apache version at build time.
682 %__apache_confdir() %(if [ %{1} = 1 ]; then echo /etc/apache/conf.d; elif [ %{1} = 2 ]; then echo /etc/httpd/httpd.conf; else echo >&2 Unknown apache version specified; fi)
683 # expands apache service name by apache version at build time.
684 %__apache_svcname() %(if [ %{1} = 1 ]; then echo apache; elif [ %{1} = 2 ]; then echo httpd; else echo >&2 Unknown apache version specified; fi)
685
686 %apache_config_install(fv:c:n:) \
687 %{!-v:%{error:apache_config_install: Required argument -v missing}} \
688 %{?debug:set -x; echo "apache_config_install:%{-v*} %{name}-%{version}-%{release} 1:[$1]; 2:[$2]"} \
689 if [ -n "%{-f:1}" ] || ([ "$1" = "1" ] && [ "$2" = "1" ]) && [ -d %{__apache_confdir %{-v*}} ]; then\
690         ln -sf %{-c*}%{!-c:%{_sysconfdir}/apache-%{name}.conf} %{__apache_confdir %{-v*}}/%{-n*}%{!-n:99}_%{name}.conf\
691 fi\
692 # reload apache if the config symlink is there\
693 if [ -L %{__apache_confdir %{-v*}}/%{-n*}%{!-n:99}_%{name}.conf ]; then\
694         # additionally don't reload if target package (the webserver) is upgraded, as webserver is restarted anyway in %post \
695         if [ "$2" != "2" ] && [ -f /var/lock/subsys/%{__apache_svcname %{-v*}} ]; then\
696                 /etc/rc.d/init.d/%{__apache_svcname %{-v*}} reload 1>&2\
697         fi\
698 fi\
699 %{nil}
700
701 # Remove package's apache config from apache config.
702 #
703 # Usage:
704 #   %apache_config_uninstall -v {1|2} -n 99
705 #
706 #  -v REQUIRED: specify apache version. can be 1 or 2.
707 #  -n OPTIONAL: specify config "slot". defaults to 99
708 %apache_config_uninstall(v:n:) \
709 %{!-v:%{error:apache_config_uninstall: Required argument -v missing}} \
710 %{?debug:set -x; echo "apache_config_uninstall:%{-v*} %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"} \
711 # remove link if either of the packages are gone \
712 if [ "$1" = "0" ] || [ "$2" = "0" ]; then \
713         if [ -L %{__apache_confdir %{-v*}}/%{-n*}%{!-n:99}_%{name}.conf ]; then \
714                 rm -f %{__apache_confdir %{-v*}}/%{-n*}%{!-n:99}_%{name}.conf \
715                 if [ -f /var/lock/subsys/%{__apache_svcname %{-v*}} ]; then \
716                         /etc/rc.d/init.d/%{__apache_svcname %{-v*}} reload 1>&2 \
717                 fi \
718         fi \
719 fi \
720 %{nil}
721
722 # webapp macros
723 #
724 # The config is installed/removed inside trigger, this means that you can any
725 # time install apache1/apache/lighttpd package and the configuration file is
726 # updated. if you don't need the config for various reason for specific
727 # webserver, just remove the symlink from config directory using webapp
728 # program. the trigger will not recreate the symlink on upgrades. In other
729 # words the config is linked to webserver config directory on first install of
730 # PACKAGE or WEBSERVER.
731 #
732 # Add package's webserver config to webserver webapps dir.
733 # Usage:
734 #   %webapp_register WEBSERVER WEBAPP
735 #
736 %webapp_register() \
737 %{?debug:set -x; echo "webapp_register: %{name}-%{version}-%{release} 1:[$1]; 2:[$2]"} \
738 if [ "$1" = "1" ] && [ "$2" = "1" ]; then\
739         /usr/sbin/webapp register %1 %2\
740 fi\
741 # reload webserver if the config symlink is there and skip reload if webserver is upgraded\
742 if [ -L /etc/%1/webapps.d/%2.conf ] && [ "$2" -lt "2" ]; then\
743         %{expand:%service -q %%1 reload}\
744 fi\
745 %{nil}
746
747 # Remove package's config from webserver webapps dir.
748 # Usage:
749 #   %webapp_register [-f] WEBSERVER WEBAPP
750 %webapp_unregister(f) \
751 %{?debug:set -x; echo "webapp_unregister: %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"} \
752 # remove link if either of the packages are gone \
753 if [ -n "%{-f:1}" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/%1/webapps.d/%2.conf ]; then \
754         /usr/sbin/webapp unregister %1 %2\
755         %{expand:%service -q %%1 reload}\
756 fi \
757 %{nil}
758
759 # see browser-plugins.spec / template-browser-plugin.spec
760 # written by glen@pld-linux.org.
761 %nsplugin_install(d:f) { \
762 # create link if it's first install of either of the packages \
763 if [ -n "%{-f:1}" ] || ([ "$1" = "1" ] && [ "$2" = "1" ] && [ -d %{-d*} ]); then \
764 ( \
765 %( \
766         for file in %{*}; do \
767                 echo echo Installing $file to %{-d*}; \
768                 echo "ln -sf %{_libdir}/browser-plugins/$file %{-d*};"; \
769         done ) \
770 ) | ( %banner -t 5 -e %{name}-in ); fi; \
771 }
772
773 %nsplugin_uninstall(d:) { \
774 # remove link if either of the packages are gone \
775 if [ "$1" = "0" ] || [ "$2" = "0" ]; then \
776 ( \
777 %( \
778         for file in %{*}; do \
779                 echo echo Removing $file from %{-d*}; \
780                 echo "rm -f %{-d*}/$file;"; \
781         done ) \
782 ) | ( %banner -t 5 -e %{name}-un ); fi; \
783 }
784
785 # service macro.
786 #
787 # calls usual service restart on package %post, but skips the restart if
788 # administrator has disabled automatic service restarts in either global
789 # /etc/sysconfig/rpm or per service /etc/sysconfig/SERVICE file.
790 #
791 # written by glen@pld-linux.org.
792 # All rights reserved. Permission to copy is hereby granted.. yada, yada, yada
793 #
794 # Usage:
795 #   %service [-q] SERVICE ACTION ["SERVICE NICE DESCRIPTION"]
796 #
797 #  -q be silent when service isn't started (for scriplets restaring other package's services)
798 #
799 %service(q) {{%(export quiet=%{-q:1}; /usr/lib/rpm/service_generator.sh %{*}) };}
800
801
802 # java macros. based on jpackage macros.java
803 %_jvmdir                %{_libdir}/jvm
804 %_jvmjardir             %{_libdir}/jvm-exports
805 %_jvmprivdir            %{_libdir}/jvm-private
806 %_jvmlibdir             %{_libdir}/jvm
807 %_jvmdatadir            %{_datadir}/jvm
808 %_jvmsysconfdir         %{_sysconfdir}/jvm
809 # FIXME: are these used?
810 %_jvmcommonlibdir       %{_libdir}/jvm-common
811 %_jvmcommondatadir      %{_datadir}/jvm-common
812 %_jvmcommonsysconfdir   %{_sysconfdir}/jvm-common
813 %_javadir               %{_datadir}/java
814 %_jnidir                %{_libdir}/java
815 %_javadocdir            %{_datadir}/javadoc
816 %java_home              %(unset JAVA_HOME; . %{_javadir}-utils/java-functions; set_jvm; echo $JAVA_HOME)
817
818 %ant                    JAVA_HOME=%{java_home} ant
819 %jar                    %{java_home}/bin/jar
820 %java                   %(unset JAVACMD; . %{_javadir}-utils/java-functions; set_javacmd; echo $JAVACMD)
821 %javac                  %{java_home}/bin/javac
822 %javadoc                %{java_home}/bin/javadoc
823
824 %add_jvm_extension      JAVA_LIBDIR=%{buildroot}/%{_javadir}    %{_bindir}/jvmjar -l
825
826 %jpackage_script() \
827 install -d $RPM_BUILD_ROOT%{_bindir}\
828 cat > $RPM_BUILD_ROOT%{_bindir}/%5 << 'EOF' \
829 #!/bin/sh\
830 #\
831 # %{name} script\
832 # JPackage Project <http://www.jpackage.org/>\
833 \
834 # Source functions library\
835 . %{_javadir}-utils/java-functions\
836 \
837 # Source system prefs\
838 if [ -f %{_sysconfdir}/java/%{name}.conf ]; then\
839     . %{_sysconfdir}/java/%{name}.conf\
840 fi\
841 \
842 # Source user prefs\
843 if [ -f $HOME/.%{name}rc ]; then\
844     . $HOME/.%{name}rc\
845 fi\
846 \
847 # Configuration\
848 MAIN_CLASS=%1\
849 BASE_FLAGS=%2\
850 BASE_OPTIONS=%3\
851 BASE_JARS="%(echo %4 | tr ':' ' ')"\
852 \
853 # Set parameters\
854 set_jvm\
855 set_classpath $BASE_JARS\
856 set_flags $BASE_FLAGS\
857 set_options $BASE_OPTIONS\
858 \
859 # Let's start\
860 run "$@"\
861 EOF
862
863 # pear install macros written by glen@pld-linux.org.
864 # All rights reserved. Permission to copy is hereby granted.. yada, yada, yada
865 #
866 # Usage:
867 #       %%pear_package_setup [-a #] [-n FMT]
868 #
869 # -a #   - unpack SOURCE# instead of SOURCE0
870 # -n FMT - create builddir with FMT, instead of default %%{_pearname}-%%{version}
871 # -z     - unpack pear package and let pear use package.xml (not tarball) for install. use this for buggy packages.
872 # -f     - force pear install. use with care.
873 #
874 # unpack PEAR package to %%{_builddir}/FMT. package is extracted with already
875 # destination hierarchy. you should copy the tree to buildroot after
876 # patching/reorganizing with %%pear_package_install.
877 #
878 # additionally BUILDROOT is stripped from files and files are converted to UNIX
879 # line endings.
880 #
881 # the pear install process output is recorded to install.log, you should put it
882 # to %%doc for latter debug or just information.
883 #
884 # additionally additional-packages.txt is produced if it was detected that the
885 # package has optional dependencies. the file format is suitable of displaying
886 # in %%post of a package. you should put this file to %%doc. noautocompressdoc is
887 # automatically added for this file.
888 #
889 %pear_package_setup(a:n:zf) \
890 %setup -q -c -T -n %{-n*}%{!-n:%{_pearname}-%{version}}\
891 D=%{_builddir}/%{-n*}%{!-n:%{_pearname}-%{version}} \
892 %{-z:tar zxf %{S:%{-a*}%{!-a:0}}; P=%{_pearname}-%{version}/package.xml; [ -f $P ] || P=package.xml} \
893 pear \\\
894         -d doc_dir=/docs \\\
895         -d php_dir=%{php_pear_dir} \\\
896         -d bin_dir=%{_bindir} \\\
897         -d data_dir=%{php_pear_dir}/data \\\
898         -d test_dir=%{php_pear_dir}/tests \\\
899         install \\\
900         --installroot=${D} \\\
901         --offline \\\
902         --nodeps \\\
903         %{-f:--force} \\\
904         %{!-z:%{S:%{-a*}%{!-a:0}}}%{-z:$P} | tee install.log \
905 # make post message of optional packages \
906 grep 'can optionally use' install.log | sed -e 's,package "pear/,package "php-pear-,g;s,^pear/,php-pear-,' > optional-packages.txt \
907 if [ -s optional-packages.txt ]; then \
908         awk -F'"' '/use package/{print $2}' optional-packages.txt | sed -e "s,_,/,g;s,php-pear-, 'pear(,;s,$,.*)'," | tr -d '\\\n' > _noautoreq \
909 else \
910         rm -f optional-packages.txt \
911 fi \
912 rm ./%{php_pear_dir}/.{lock,filemap} \
913 # undos sources \
914 find . -type f -print0 | xargs -0 sed -i -e 's,\\r$,,' \
915 # bug in PEAR --installroot. \
916 # http://pear.php.net/bugs/bug.php?id=5448 \
917 grep -rl "${D}" ./{%{_bindir},%{php_pear_dir}}/* | xargs -r sed -i -e "s,${D},," \
918 %{!?_noautocompressdoc:%global _noautocompressdoc %{nil}}%{expand:%%global _noautocompressdoc %{_noautocompressdoc} optional-packages.txt} \
919 %{!?_noautoprov:%global _noautoprov %{nil}}%{expand:%%global _noautoprov %{_noautoprov} 'pear(tests/.*)'} \
920 %{nil}
921
922 # copies exctracted PEAR package structure to buildroot.
923 # also copies PEAR registry file.
924 # please use this macro, for future extensions being possible.
925 %pear_package_install() \
926 cp -a ./%{php_pear_dir}/{.registry,*} $RPM_BUILD_ROOT%{php_pear_dir} \
927 find $RPM_BUILD_ROOT%{php_pear_dir} '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v \
928 # help the developer out a little: \
929 if [ -f _noautoreq ]; then \
930         echo "AutoReqdep detected:" \
931         echo "_noautoreq $(cat _noautoreq)" \
932 fi \
933 %{nil}
934
935 # vim:ts=8 sw=8 noet
This page took 0.143547 seconds and 4 git commands to generate.