]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
1.658: %py_postclean -x FILE1,FILE2 support auto/th/rpm-build-macros-1.658-1
authorElan Ruusamäe <glen@delfi.ee>
Tue, 9 Apr 2013 19:18:11 +0000 (22:18 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 9 Apr 2013 19:18:11 +0000 (22:18 +0300)
rpm-build-macros.spec
rpm.macros

index 2ccd3ac23111489f30a7311adae4d183af489c47..ac8d27a3a4d0a68f0d82d2eac030cc0c790a843e 100644 (file)
@@ -1,10 +1,10 @@
-%define                rpm_macros_rev  1.657
+%define                rpm_macros_rev  1.658
 %define                find_lang_rev   1.36
 Summary:       PLD Linux RPM build macros
 Summary(pl.UTF-8):     Makra do budowania pakietów RPM dla Linuksa PLD
 Name:          rpm-build-macros
 Version:       %{rpm_macros_rev}
-Release:       2
+Release:       1
 License:       GPL
 Group:         Development/Building
 Source0:       rpm.macros
index 61da454de3e65552aade7bb90b90dca3585fd503..7b005d6f325f47f4bea40486609ba1f6dd86d3a4 100644 (file)
@@ -1093,10 +1093,19 @@ if [ -d "$RPM_BUILD_ROOT" ]; then \
 fi; \
 }; __spec_install_post_py_hardlink } }
 
-# remove python sources, so that check-files won't complain
-%py_postclean() \
+# Remove Python 2.x sources,
+# PLD Linux policy is to package only compiled .py[co] for Python 2.x libraries.
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+#
+# Usage:
+# %py_postclean /usr/share/extra -x keepme.py,keeptoo.py
+# Options:
+# -x - comma separated of file basenames to preserve
+# ARGS - extra directories to clean for .py sources
+#
+%py_postclean(x:) \
 for d in %{py_sitescriptdir} %{py_sitedir} %*; do \
[ ! -d "$RPM_BUILD_ROOT$d" ] || find "$RPM_BUILD_ROOT$d" -name '*.py' -print0 | xargs -0r -l512 rm;\
      [ ! -d "$RPM_BUILD_ROOT$d" ] || find "$RPM_BUILD_ROOT$d" -name '*.py' -print0 %{-x:| grep -ZzvE '/(%(echo '%{-x*}' | tr ',' '|'))$'} | xargs -0r -l512 rm;\
 done \
 %{nil}
 
This page took 0.045567 seconds and 4 git commands to generate.