]> git.pld-linux.org Git - packages/rpm-build-macros.git/blobdiff - rpm.macros
- 1.583
[packages/rpm-build-macros.git] / rpm.macros
index 3deceadba7566dbb82324149322c36544e3a2839..047c9f6ebfcb4c3f75389ef610de031ca0d858bf 100644 (file)
        %{dependencytracking} \
 }
 
-%cmake { \
-CC="%{__cc}" \
-CXX="%{__cxx}" \
-CFLAGS="%{rpmcflags}" \
-CXXFLAGS="%{rpmcxxflags}" \
-LDFLAGS="%{rpmldflags}" \
-%{__cmake} \
-}
+%cmake \
+CC="%{__cc}" \\\
+CXX="%{__cxx}" \\\
+CFLAGS="%{rpmcflags}" \\\
+CXXFLAGS="%{rpmcxxflags}" \\\
+LDFLAGS="%{rpmldflags}" \\\
+%{__cmake} \\\
+       -DCMAKE_INSTALL_PREFIX=%{_prefix} \\\
+       -DCMAKE_BUILD_TYPE=%{!?debug:Release}%{?debug:Debug} \\\
+%if "%{_lib}" == "lib64" \
+       -DLIB_SUFFIX=64 \\\
+%endif \
+%{nil}
 
 %scons { \
 %{__scons} \
@@ -634,15 +639,17 @@ fi; }; __spec_install_post_chrpath } } }
 # Find all shared object files with unresolved symbols. Warn
 # and terminate if any found (termination can be turned off by define).
 #%no_install_post_check_so 1
+#%skip_post_check_so libwithunresolvedok.so.*
 %__spec_install_post_check_so { \
  __spec_install_post_check_so() { \
     fail=0; \
     printf "Searching for shared objects with unresolved symbols..."; \
     for f in $(find $RPM_BUILD_ROOT -type f -name '*.so.*' -print); do \
+           %{?skip_post_check_so:echo %{skip_post_check_so} | LC_ALL=C awk '{ gsub(/[ \t]+/,"\n"); print }' | LC_ALL=C awk -v "file=$f" 'file ~ "(^|/)" $0 "$" { exit(1) }' || continue ;} \
         LC_ALL=C objdump -T $f 2> /dev/null | LC_ALL=C awk -v "file=$f" 'BEGIN { found=0; skip["program_name"]=1; symbols = "" } /^[0-9a-z]+ +D +\*UND\*/ { if ($NF in skip) { next; }; found = 1; symbols = symbols "\n\t" $NF } END { if (found) { print "\nUnresolved symbols found in: " file symbols; exit(1); } } ' || fail=1 ; \
     done ; \
     echo " DONE"; \
-    %{!?no_install_post_check_so:[ $fail -eq 1 ] && : || :;} \
+    %{!?no_install_post_check_so:return $fail;} \
 }; __spec_install_post_check_so }}
 
 #-----------------------------------------------------------------
@@ -811,7 +818,9 @@ fi; \
 %php_debug                             %{expand:%%global php_debug %(awk '/#define ZEND_DEBUG/{print $3}' %{php_includedir}/main/php_config.h 2>/dev/null || echo ERROR)}%php_debug
 %zend_module_api               %{expand:%%global zend_module_api %(awk '/#define ZEND_MODULE_API_NO/{print $3}' %{php_includedir}/Zend/zend_modules.h 2>/dev/null || echo ERROR)}%zend_module_api
 %zend_extension_api            %{expand:%%global zend_extension_api %(awk '/#define ZEND_EXTENSION_API_NO/{print $3}' %{php_includedir}/Zend/zend_extensions.h 2>/dev/null || echo ERROR)}%zend_extension_api
-%zend_zts                              %{expand:%%global zend_zts %(Z=$(grep -sc '^#define ZTS 1' %{php_includedir}/main/php_config.h); echo ${Z:-ERROR})}%zend_zts
+%_zend_zts                             %{expand:%%global _zend_zts %(Z=$(grep -sc '^#define ZTS 1' %{php_includedir}/main/php_config.h); echo ${Z:-ERROR})}%_zend_zts
+# "_ts" if ZTS enabled, empty otherwise
+%zend_zts                              %{expand:%%global _zend_zts_%{?_zend_zts} 1}%{?_zend_zts_1:_ts}
 
 # helper macro
 %__php_api_requires(v:) Requires: php%{-v*}(%{expand:%1}) = %{expand:%{%{!?2:%{1}}%{?2}}}
@@ -821,13 +830,13 @@ fi; \
 %requires_php_extension %{__php_api_requires modules_api php_api_version} \
 %{__php_api_requires zend_module_api} \
 %{__php_api_requires -v %php_major_version debug php_debug} \
-%{__php_api_requires -v %php_major_version thread-safety zend_zts}
+%{__php_api_requires -v %php_major_version thread-safety _zend_zts}
 
 # for zend extensions
 %requires_zend_extension %{__php_api_requires zend_module_api} \
 %{__php_api_requires zend_extension_api} \
 %{__php_api_requires -v %php_major_version debug php_debug} \
-%{__php_api_requires -v %php_major_version thread-safety zend_zts}
+%{__php_api_requires -v %php_major_version thread-safety _zend_zts}
 
 # for php pdo modules (php-pecl-PDO_*)
 %requires_php_pdo_module %{__php_api_requires PDO_API php_pdo_api_version}
@@ -1353,7 +1362,7 @@ echo -e "</dependencies>\\n" >> %{_mavendepmapdir}/maven2-depmap.xml
 #      %%pear_package_setup ...
 #
 # -a #   - also unpack SOURCE#. for PEAR bootstrapping
-# -n FMT - create builddir with FMT, instead of default %%{_pearname}-%%{version}
+# -n FMT - create builddir with FMT, instead of default %%{pearname}-%%{version}
 # -z     - unpack pear package and let pear use package.xml (not tarball) for install. for PEAR bootstrapping
 # -D     - pass -D to %setup (so the build dir is not removed)
 # -c     - register channel from local channel.xml file
@@ -1387,8 +1396,9 @@ else \
 fi \
 %{nil}
 
-# command invoking pear cli
-%__pear /usr/bin/pear
+# Command invoking PEAR CLI
+# Same as /usr/bin/pear, except we force GMT timezone
+%__pear        %__php -doutput_buffering=1 -dopen_basedir="" -dmemory_limit=-1 -ddate.timezone=GMT %{php_pear_dir}/pearcmd.php
 
 %pear_install(a:d:n:zD) \
 %__pear \\\
@@ -1414,18 +1424,17 @@ fi \
 # as it's displayed to user after package install. and adding additional gzip
 # dep is just waste ;)
 %pear_package_setup(a:d:n:zDc:) \
-%define srcdir %{-n*}%{!-n:%{_pearname}-%{version}} \
+%define srcdir %{-n*}%{!-n:%{?_pearname}%{!?_pearname:%{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:%{__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} \
 %{-c:%{__pear} -c pearrc config-set php_dir %{builddir}/%{php_pear_dir}; %__pear -c %{builddir}/pearrc channel-add %{-c*}} \
 %pear_install \
 %{-z:cd ..} \
+%{__tar} --wildcards -zvxf %{S:0} package*.xml \
 cat %{-z:$_N/}.install.log | %__pear_install_log \
-\
-# undos sources \
-find -type f -print0 | xargs -0 sed -i -e 's,\\r$,,' \
+%undos -f php,html,js,xml \
 %{!?_noautocompressdoc:%global _noautocompressdoc %{nil}}%{expand:%%global _noautocompressdoc %{_noautocompressdoc} optional-packages.txt} \
 %{!?_noautoprov:%global _noautoprov %{nil}}%{expand:%%global _noautoprov %{_noautoprov} 'pear(tests/.*)'} \
 %{nil}
@@ -1442,6 +1451,21 @@ if [ -f _noautoreq ]; then \
 fi \
 %{nil}
 
+# Print optional package info for pear packages
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+# Usage:
+#   %post -p <lua>
+#      %%pear_package_print_optionalpackages
+#
+# Requirements:
+# BuildRequires:       rpmbuild(macros) >= 1.571
+%pear_package_print_optionalpackages \
+f = io.open("%{_docdir}/%{name}-%{version}/optional-packages.txt", "r") \
+if f then \
+       for l in f:lines() do print(l); end \
+end \
+%{nil}
+
 
 # Register OpenLDAP schema.
 # Author: Elan Ruusamäe <glen@pld-linux.org>
This page took 0.064533 seconds and 4 git commands to generate.