]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm.macros
- no tsc in i486
[packages/rpm.git] / rpm.macros
index 3f024f525b8d3dcc31eaaeb46728a1946b6d2502..db8f36fdc015aa9a9abff9cf0eddc9e3a1fe5a22 100644 (file)
@@ -15,7 +15,6 @@
 %__autopoint           autopoint --force
 
 %__gettextize { \
-if ! gettextize --version | grep -q '0\.10\.' ; then \
        if grep -qs 'AM_GNU_GETTEXT.*external' configure.{ac,in} ; then \
                gettextize --copy --force --no-changelog; \
        else \
@@ -24,9 +23,6 @@ if ! gettextize --version | grep -q '0\.10\.' ; then \
        if [ ! -f po/Makevars ]; then \
                cp -f po/Makevars{.template,}; \
        fi; \
-else \
-       gettextize --copy --force; \
-fi; \
 }
 
 %__glib_gettextize     glib-gettextize --copy --force
@@ -51,6 +47,9 @@ fi; \
 #      and that both p and q are package names (i.e. no version/release).
 %_dependency_whiteout  %{nil}
 
+%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
+       && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
+       [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
 
 #-----------------------------------------------------------------
 #
@@ -113,6 +112,7 @@ fi; \
  CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
  CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" ; export CXXFLAGS ; \
  FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
+ FCFLAGS="${FCFLAGS:-%rpmcflags}" ; export FCFLAGS ; \
  CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
  %{?__cc:CC="%{__cc}" ; export CC ; } \
  %{?__cxx:CXX="%{__cxx}" ; export CXX ; } \
@@ -146,10 +146,18 @@ CXXFLAGS="%{rpmcxxflags}" \
 }
 
 # override __scons to add -j4 in your ~/.rpmmacros for parallel make
-# TODO: find way to pass CC/CXX and CC/CXXFLAGS
 %__scons       /usr/bin/scons
 %scons { \
 %{__scons} \
+       LDFLAGS="${LDFLAGS:-%rpmldflags}" \
+       CFLAGS="${CFLAGS:-%rpmcflags}" \
+       CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" \
+       FFLAGS="${FFLAGS:-%rpmcflags}" \
+       CPPFLAGS="${CPPFLAGS:-}" \
+       %{?__cc:CC="%{__cc}"} \
+       %{?__cxx:CXX="%{__cxx}"} \
+       libsuffix=%{_lib} \
+       prefix=%{_prefix} \
 }
 
 # waf. see waf.spec
@@ -173,6 +181,7 @@ CXXFLAGS="%{rpmcxxflags}" \
        CFLAGS="${CFLAGS:-%rpmcflags}" \
        CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" \
        FFLAGS="${FFLAGS:-%rpmcflags}" \
+       FCFLAGS="${FCFLAGS:-%rpmcflags}" \
        CPPFLAGS="${CPPFLAGS:-}" \
        %{?__cc:CC="%{__cc}"} \
        %{?__cxx:CXX="%{__cxx}"} \
@@ -333,14 +342,20 @@ unset DISPLAY ||:\
 #%no_install_post_compress_docs        1
 %__spec_install_post_compress_docs { \
 %{!?no_install_post_compress_docs:__spec_install_post_compress_docs() { \
-       for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
+       for i in /usr/share/man /usr/X11R6/man; do \
                if [ -d "$RPM_BUILD_ROOT$i" ]; then \
-                       echo "Compress $(basename $i) pages: $i"; \
+                       echo "Compress man pages: $i"; \
                        find "$RPM_BUILD_ROOT$i" -name '*.bz2' -print | xargs -r %{__bzip2} -df; \
                        find "$RPM_BUILD_ROOT$i" -name '*.gz' -print | xargs -r %{__gzip} -dnf; \
                        find "$RPM_BUILD_ROOT$i" -type f -size +%{_min_compress_bytes}c -print | xargs -r %{__gzip} -9nf; \
                fi; \
        done; \
+       if [ -d "$RPM_BUILD_ROOT%{_infodir}" ]; then \
+               echo "Compress info pages: %{_infodir}"; \
+               find "$RPM_BUILD_ROOT%{_infodir}" -name '*.bz2' -print | xargs -r %{__bzip2} -df; \
+               find "$RPM_BUILD_ROOT%{_infodir}" -name '*.gz' -print | xargs -r %{__gzip} -dnf; \
+               find "$RPM_BUILD_ROOT%{_infodir}" -name '*.info*' -type f -size +%{_min_compress_bytes}c -print | xargs -r %{__gzip} -9nf; \
+       fi; \
 }; __spec_install_post_compress_docs } }
 
 #-----------------------------------------------------------------
@@ -354,10 +369,13 @@ unset DISPLAY ||:\
 if [ -d "$RPM_BUILD_ROOT" ]; then \
        if [ -d $RPM_BUILD_ROOT/lib/modules ]; then \
                modulelist=$(find $RPM_BUILD_ROOT/lib/modules -name '*o' -type f -print); \
-               printf "Stripping %d kernel modules..." $(echo "$modulelist" | wc -l); \
-               echo "$modulelist" | xargs -l512 chmod u+w; \
-               echo "$modulelist" | xargs -l512 %{__strip} --strip-unneeded --remove-section=.comment --remove-section=.note.GNU-stack; \
-               echo "DONE"; \
+               modulecount=$(echo -n "$modulelist" | wc -l); \
+               if [ "$modulecount" -gt 0 ]; then \
+                       printf "Stripping %d kernel modules..."; \
+                       echo "$modulelist" | xargs -l512 chmod u+w; \
+                       echo "$modulelist" | xargs -l512 %{__strip} --strip-unneeded --remove-section=.comment --remove-section=.note.GNU-stack; \
+                       echo "DONE"; \
+               fi; \
        fi; \
        filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*\.debug" ! -regex ".*%{_docdir}/.*" ! -regex ".*%{_includedir}/.*" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
        # vim - " \
@@ -474,14 +492,16 @@ fi \
 %update_desktop_database_post() {{ \
        umask 022; \
        /usr/bin/update-desktop-database -q; \
-}}
+}} \
+%{nil}
 
 %update_desktop_database_postun() {{ \
 if [ $1 = 0 ]; then \
        umask 022; \
        /usr/bin/update-desktop-database -q; \
 fi \
-}}
+}} \
+%{nil}
 
 #-----------------------------------------------------------------
 # Update shared MIME info database
@@ -490,7 +510,8 @@ fi \
 %update_mime_database() {{ \
        umask 022; \
        /usr/bin/update-mime-database %{_datadir}/mime; \
-}}
+}} \
+%{nil}
 
 #-----------------------------------------------------------------
 # Update icon cache
@@ -499,7 +520,8 @@ fi \
 %update_icon_cache() {{ \
        umask 022; \
        /usr/bin/gtk-update-icon-cache -qf %{_datadir}/icons/%1; \
-}}
+}} \
+%{nil}
 
 #-----------------------------------------------------------------
 # Update scrollkeeper database
@@ -568,17 +590,16 @@ fi \
 %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)
+%php_includedir                %(php-config --include-dir 2>/dev/null || echo ERROR)
 
-# directory where php includes are installed on system.
-%__php_includedir              /usr/include/php
 # extract php/zend api versions
-%php_major_version             %(awk '/#define PHP_MAJOR_VERSION/{print $3}' %{__php_includedir}/main/php_version.h 2>/dev/null || echo ERROR)
-%php_api_version               %(awk '/#define PHP_API_VERSION/{print $3}' %{__php_includedir}/main/php.h 2>/dev/null || echo ERROR)
-%php_pdo_api_version   %(awk '/#define PDO_DRIVER_API/{print $3}' %{__php_includedir}/ext/pdo/php_pdo_driver.h 2>/dev/null || echo ERROR)
-%php_debug                             %(awk '/#define ZEND_DEBUG/{print $3}' %{__php_includedir}/main/php_config.h 2>/dev/null || echo ERROR)
-%zend_module_api               %(awk '/#define ZEND_MODULE_API_NO/{print $3}' %{__php_includedir}/Zend/zend_modules.h 2>/dev/null || echo ERROR)
-%zend_extension_api            %(awk '/#define ZEND_EXTENSION_API_NO/{print $3}' %{__php_includedir}/Zend/zend_extensions.h 2>/dev/null || echo ERROR)
-%zend_zts                              %(Z=$(grep -sc '^#define ZTS 1' %{__php_includedir}/main/php_config.h); echo ${Z:-ERROR})
+%php_major_version             %(awk '/#define PHP_MAJOR_VERSION/{print $3}' %{php_includedir}/main/php_version.h 2>/dev/null || echo ERROR)
+%php_api_version               %(awk '/#define PHP_API_VERSION/{print $3}' %{php_includedir}/main/php.h 2>/dev/null || echo ERROR)
+%php_pdo_api_version   %(awk '/#define PDO_DRIVER_API/{print $3}' %{php_includedir}/ext/pdo/php_pdo_driver.h 2>/dev/null || echo ERROR)
+%php_debug                             %(awk '/#define ZEND_DEBUG/{print $3}' %{php_includedir}/main/php_config.h 2>/dev/null || echo ERROR)
+%zend_module_api               %(awk '/#define ZEND_MODULE_API_NO/{print $3}' %{php_includedir}/Zend/zend_modules.h 2>/dev/null || echo ERROR)
+%zend_extension_api            %(awk '/#define ZEND_EXTENSION_API_NO/{print $3}' %{php_includedir}/Zend/zend_extensions.h 2>/dev/null || echo ERROR)
+%zend_zts                              %(Z=$(grep -sc '^#define ZTS 1' %{php_includedir}/main/php_config.h); echo ${Z:-ERROR})
 
 # helper macro
 %__php_api_requires(v:) Requires: php%{-v*}(%{expand:%1}) = %{expand:%{%{!?2:%{1}}%{?2}}}
@@ -623,6 +644,25 @@ if [ -f /etc/rc.d/init.d/php-fcgi ]; then \
 fi \
 %{nil}
 
+
+# X.org helper macros
+%__xorg_abi_requires() Requires: xorg-xserver-server(%{expand:%1}-abi) = %{expand:%{%{!?2:%{1}}%{?2}}}
+#
+%xorg_xserver_ansic_abi                %(awk '/#define ABI_ANSIC_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)
+%xorg_xserver_extension_abi    %(awk '/#define ABI_EXTENSION_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)
+%xorg_xserver_font_abi         %(awk '/#define ABI_FONT_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null | echo ERROR)
+%xorg_xserver_videodrv_abi     %(awk '/#define ABI_VIDEODRV_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)
+%xorg_xserver_xinput_abi       %(awk '/#define ABI_XINPUT_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)
+
+%requires_xorg_xserver_extension %{__xorg_abi_requires ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires extension xorg_xserver_extension_abi}
+%requires_xorg_xserver_xinput %{__xorg_abi_requires ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires xinput xorg_xserver_xinput_abi}
+%requires_xorg_xserver_font %{__xorg_abi_requires ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires font xorg_xserver_font_abi}
+%requires_xorg_xserver_videodrv %{__xorg_abi_requires ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires videodrv xorg_xserver_videodrv_abi}
+
 # Python specific macro definitions.
 # python main version
 %py_ver                        %(python -c "import sys; print sys.version[:3]")
@@ -1075,16 +1115,7 @@ fi \
 # command invoking pear cli
 %__pear /usr/bin/pear
 
-# The main macro.
-# using this macro will append optional-packages.txt to the nocompressdoc list
-# as it's displayed to user after package install. and adding additional gzip
-# dep is just waste ;)
-%pear_package_setup(a:n:zD) \
-%define srcdir %{-n*}%{!-n:%{_pearname}-%{version}} \
-%define builddir %{_builddir}/%{srcdir} \
-%setup -q -c -T %{-D:-D} -n %{srcdir} \
-%{-z:tar zxf %{S:0}; %{-a:tar zxf %{S:%{-a*}}}} \
-%{-z:_P=package2.xml; [ -f $_P ] || _P=package.xml; _N=%{srcdir}; mv $_P $_N; cd $_N} \
+%pear_install(a:n:zD) \
 %__pear \\\
        -c pearrc \\\
        -d doc_dir=/docs \\\
@@ -1097,7 +1128,20 @@ fi \
        --offline \\\
        --nodeps \\\
        %{-f:--force} \\\
-       %{!-z:%{S:%{-a*}%{!-a:0}}}%{-z:$_P} > .install.log || { c=$?; cat .install.log; exit $c; } \
+       %{!-z:%{S:%{-a*}%{!-a:0}}}%{-z:$_P} > .install.log || { c=$?; cat .install.log; exit $c; }; \
+%{nil}
+
+# The main macro.
+# using this macro will append optional-packages.txt to the nocompressdoc list
+# as it's displayed to user after package install. and adding additional gzip
+# dep is just waste ;)
+%pear_package_setup(a:n:zD) \
+%define srcdir %{-n*}%{!-n:%{_pearname}-%{version}} \
+%define builddir %{_builddir}/%{srcdir} \
+%setup -q -c -T %{-D:-D} -n %{srcdir} \
+%{-z:tar zxf %{S:0}; %{-a:tar zxf %{S:%{-a*}}}} \
+%{-z:_P=package2.xml; [ -f $_P ] || _P=package.xml; _N=%{srcdir}; mv $_P $_N; cd $_N} \
+%pear_install \
 %{-z:cd ..} \
 cat %{-z:$_N/}.install.log | %__pear_install_log \
 \
This page took 0.24661 seconds and 4 git commands to generate.