From cd9a3fd59bcb42464b929a2bcd1538f353c4eb64 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Tue, 28 Feb 2017 07:26:54 -0600 Subject: [PATCH] fix %autosetup support --- utils/packpack/fixautosetup.patch | 22 ++++++++++++++++++++++ utils/packpack/startpackpack.sh | 8 ++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 utils/packpack/fixautosetup.patch diff --git a/utils/packpack/fixautosetup.patch b/utils/packpack/fixautosetup.patch new file mode 100644 index 000000000..9e2f05d4e --- /dev/null +++ b/utils/packpack/fixautosetup.patch @@ -0,0 +1,22 @@ +From fed25ab3e7609478d80b4d49916c6b22def1588c Mon Sep 17 00:00:00 2001 +From: Andy Bauer +Date: Mon, 27 Feb 2017 20:31:21 -0600 +Subject: [PATCH] config sed to replace only the first occurance of %autosetup + +--- + pack/rpm.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pack/rpm.mk b/pack/rpm.mk +index 7ead710..a17a9b9 100644 +--- a/pack/rpm.mk ++++ b/pack/rpm.mk +@@ -24,7 +24,7 @@ $(BUILDDIR)/$(RPMSPEC): $(RPMSPECIN) + -e 's/Release:\([ ]*\).*/Release: $(RELEASE)%{dist}/' \ + -e 's/Source0:\([ ]*\).*/Source0: $(TARBALL)/' \ + -e 's/%setup.*/%setup -q -n $(PRODUCT)-$(VERSION)/' \ +- -e 's/%autosetup.*/%autosetup -n $(PRODUCT)-$(VERSION)/' \ ++ -e '0,/%autosetup.*/ s/%autosetup.*/%autosetup -n $(PRODUCT)-$(VERSION)/' \ + -i $@.tmp + grep -F "Version: $(VERSION)" $@.tmp && \ + grep -F "Release: $(RELEASE)" $@.tmp && \ diff --git a/utils/packpack/startpackpack.sh b/utils/packpack/startpackpack.sh index 117f1c1a9..fa8967067 100755 --- a/utils/packpack/startpackpack.sh +++ b/utils/packpack/startpackpack.sh @@ -48,8 +48,12 @@ fi if [ "${OS}" == "el" ] || [ "${OS}" == "fedora" ]; then echo "Begin Redhat build..." - # %autosetup support has been merged upstream. No need to patch - #patch -p1 < utils/packpack/autosetup.patch + # fix %autosetup support + patch --dry-run --silent -f -p1 < utils/packpack/fixautosetup.patch 2>/dev/null + if [ $? -eq 0 ]; then + patch -p1 < utils/packpack/fixautosetup.patch + fi + ln -sf distros/redhat rpm # The rpm specfile requires the Crud submodule folder to be empty