]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm.macros
- popt 1.10.1, setup passes
[packages/rpm.git] / rpm.macros
index cb082f394c35ada0297153cb084e626b4659dde3..2a876ebcaeb9dab11c2f8b44e927e879f3596c80 100644 (file)
@@ -312,7 +312,7 @@ unset DISPLAY ||:\
        %{?verbose:set -x;} \
 if [ -d "$RPM_BUILD_ROOT" ]; then \
 echo "Remove RPATH from executable binaries and shared object files."; \
-find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*%{_libdir}/debug/.*" %{?_noautochrpath:! -regex "%{_noautochrpath}"} | xargs -r file | \
+find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*" %{?_noautochrpath:! -regex "%{_noautochrpath}"} | xargs -r file | \
        awk '/ELF.*(executable.*dynamically linked|shared object)/ {print $1}' | cut -d: -f1 | \
 while read file ; do \
        rpath= ; \
@@ -429,6 +429,27 @@ echo "Compress kernel modules if any."; \
 # Software written in Python language require Python with main version
 %pyrequires_eq() Requires:     python(bytecode) = %py_ver %1
 
+
+# Hardlink binary identical .pyc and .pyo files
+# (idea by glen <at> pld-linux <dot> org)
+%__spec_install_post_py_hardlink {\
+%{!?no_install_post_py_hardlink:
+[ ! -d "$RPM_BUILD_ROOT" ] || find "$RPM_BUILD_ROOT" -name '*.pyc' | while read a; do \
+       b="$(echo $a|sed -e 's/.pyc$/.pyo/')"; \
+       if cmp -s "$a" "$b"; then \
+               ln -f "$a" "$b"; \
+       fi; \
+done \
+} }
+
+# remove python sources, so that check-files won't complain                                                                
+# (idea by glen <at> pld-linux <dot> org)
+%py_postclean() \
+for d in %{py_sitescriptdir} %{py_sitedir}; do \
+ [ ! -d "$RPM_BUILD_ROOT$d" ] || find "$RPM_BUILD_ROOT$d" -name '*.py' -exec rm {} \; ;\
+done \
+%{nil}
+
 # depmod macro
 %depmod() { \
 umask 022; \
This page took 0.027083 seconds and 4 git commands to generate.