From 6454da068ba2904fb522c89de46c5e61b15a3994 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 9 Apr 2013 22:18:11 +0300 Subject: [PATCH] 1.658: %py_postclean -x FILE1,FILE2 support --- rpm-build-macros.spec | 4 ++-- rpm.macros | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/rpm-build-macros.spec b/rpm-build-macros.spec index 2ccd3ac..ac8d27a 100644 --- a/rpm-build-macros.spec +++ b/rpm-build-macros.spec @@ -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 diff --git a/rpm.macros b/rpm.macros index 61da454..7b005d6 100644 --- a/rpm.macros +++ b/rpm.macros @@ -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 +# +# 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} -- 2.44.0