]> git.pld-linux.org Git - packages/rpm-build-macros.git/blobdiff - rpm.macros
- it's time, for /etc/httpd/conf.d
[packages/rpm-build-macros.git] / rpm.macros
index 3dfbcc14043d5fd876fa7c1f80984036567db8a6..94847f7b2537c879ec0e00ea5ff7a91fe9503d60 100644 (file)
@@ -134,16 +134,24 @@ fi; \
        %{dependencytracking} \
 }
 
+# override __cmake to add -j4 in your ~/.rpmmacros for parallel make
+%__cmake       /usr/bin/cmake
 %cmake { \
 CC="%{__cc}" \
 CXX="%{__cxx}" \
 CFLAGS="%{rpmcflags}" \
 CXXFLAGS="%{rpmcxxflags}" \
-cmake \
+%{__cmake} \
+}
+
+# override __scons to add -j4 in your ~/.rpmmacros for parallel make
+%__scons       /usr/bin/scons
+%scons { \
+%{__scons} \
 }
 
 # waf. see waf.spec
-# override __waf to add -j1 in your ~/.rpmmacros
+# override __waf to add -j4 in your ~/.rpmmacros for parallel make
 %__waf /usr/bin/waf
 %waf { \
 CC="%{__cc}" \
@@ -190,17 +198,21 @@ CXXFLAGS="%{rpmcxxflags}" \
 # Overloading of some basic macros
 %prep \
 %%prep\
-LANG=C\
-export LANG\
-unset DISPLAY ||:\
+export LC_ALL=C\
+export LANG=C\
 unset LINGUAS ||:\
+unset LANGUAGE ||:\
+unset LC_MESSAGES ||:\
+unset DISPLAY ||:\
 %{nil}
 
 %build %%build\
-LANG=C\
-export LANG\
-unset DISPLAY ||:\
+export LC_ALL=C\
+export LANG=C\
 unset LINGUAS ||:\
+unset LANGUAGE ||:\
+unset LC_MESSAGES ||:\
+unset DISPLAY ||:\
 %{nil}
 
 %install \
@@ -208,10 +220,12 @@ unset LINGUAS ||:\
 %{?buildsubdir:%{debug_package}}\
 %endif\
 %%install\
-LANG=C\
-export LANG\
-unset DISPLAY ||:\
+export LC_ALL=C\
+export LANG=C\
 unset LINGUAS ||:\
+unset LANGUAGE ||:\
+unset LC_MESSAGES ||:\
+unset DISPLAY ||:\
 %{nil}
 
 # Location of autoconf macros
@@ -398,14 +412,13 @@ fi; }; __spec_install_post_chrpath } } }
 #%no_install_post_compress_modules     1
 %__spec_install_post_compress_modules { \
 %{!?no_install_post_compress_modules: __spec_install_post_compress_modules() { \
-       if [ -d "$RPM_BUILD_ROOT" ]; then \
-               echo "Compress kernel modules if any."; \
-               if test -d $RPM_BUILD_ROOT/lib/modules ; then \
-                       find $RPM_BUILD_ROOT/lib/modules -name \*o -type f -print | \
-                       xargs -r %{__gzip} -9nf; \
-                       find $RPM_BUILD_ROOT/lib/modules -name \*o -type l -printf "%p %l\n" | \
-                       while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
-               fi; \
+       if [ -d $RPM_BUILD_ROOT/lib/modules ]; then \
+               echo "Compress kernel modules"; \
+               q=$(find $RPM_BUILD_ROOT/lib/modules -name '*o' -type f -print); \
+               echo "$q" | xargs -r %{__gzip} -9nf; \
+               printf "%d modules compressed\n" $(echo "$q" | wc -l); \
+               find $RPM_BUILD_ROOT/lib/modules -name '*o' -type l -printf "%p %l\n" | \
+               while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
        fi; \
 }; __spec_install_post_compress_modules } }
 
@@ -531,6 +544,8 @@ fi \
 %ruby_mod_ver_requires_eq      Requires:       ruby-modules(ver) = %ruby_version
 
 %php_pear_dir          /usr/share/pear
+%php_extensiondir      %(php-config --extension-dir 2>/dev/null || echo ERROR)
+%php_sysconfdir                %(php-config --sysconfdir 2>/dev/null || echo ERROR)
 
 # directory where php includes are installed on system.
 %__php_includedir              /usr/include/php
@@ -562,6 +577,30 @@ fi \
 # for php pdo modules (php-pecl-PDO_*)
 %requires_php_pdo_module %{__php_api_requires PDO_API php_pdo_api_version}
 
+# for using PHP post scripts. for PHP >= 5.0
+%php_webserver_restart \
+[ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart \
+[ ! -f /etc/httpd/conf.d/??_mod_php.conf ] || %service -q httpd restart \
+if [ -f /etc/rc.d/init.d/php-fcgi ]; then \
+       PHP_FCGI_BINARY=; . /etc/sysconfig/php-fcgi 2>/dev/null \
+       if [[ ${PHP_FCGI_BINARY:-php.fcgi} = *php.fcgi* ]]; then \
+               %service -q php-fcgi restart \
+       fi \
+fi \
+%{nil}
+
+# for using php post scripts. for PHP >= 4.0 && PHP < 5.0
+%php4_webserver_restart \
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service -q apache restart \
+[ ! -f /etc/httpd/conf.d/??_mod_php4.conf ] || %service -q httpd restart \
+if [ -f /etc/rc.d/init.d/php-fcgi ]; then \
+       PHP_FCGI_BINARY=; . /etc/sysconfig/php-fcgi 2>/dev/null \
+       if [[ ${PHP_FCGI_BINARY:-php.fcgi} = *php4.fcgi* ]]; then \
+               %service -q php-fcgi restart \
+       fi \
+fi \
+%{nil}
+
 # Python specific macro definitions.
 # python main version
 %py_ver                        %(python -c "import sys; print sys.version[:3]")
This page took 0.036411 seconds and 4 git commands to generate.