Tuesday, August 23, 2016

[389-commits] rpm.mk

rpm.mk | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)

New commits:
commit f2ecfccf4e73d4399b34224cfd1e266e7d683293
Author: Viktor Ashirov <vashirov@redhat.com>
Date: Tue Aug 23 16:44:20 2016 +0200

Ticket 48965 - Fix building rpms using rpm.mk

Description: building rpms using rpm.mk was broken due to changes in
spec file.

Fix description: fix rpm.mk by introducing different variables for rpm
and tar files.

https://fedorahosted.org/389/ticket/48965

Reviewed by: mreynolds@redhat.com (Thanks!)

Signed-off-by: Mark Reynolds <mreynolds@redhat.com>

diff --git a/rpm.mk b/rpm.mk
index 19a85d7..8171c61 100644
--- a/rpm.mk
+++ b/rpm.mk
@@ -1,10 +1,13 @@
+PWD ?= $(shell pwd)
RPMBUILD ?= $(PWD)/rpmbuild
RPM_VERSION ?= $(shell $(PWD)/rpm/rpmverrel.sh version)
RPM_RELEASE ?= $(shell $(PWD)/rpm/rpmverrel.sh release)
VERSION_PREREL ?= $(shell $(PWD)/rpm/rpmverrel.sh prerel)
+RPM_VERSION_PREREL ?= $(shell $(PWD)/rpm/rpmverrel.sh prerel | sed -e 's/\./-/')
PACKAGE = 389-ds-base
-RPM_NAME_VERSION = $(PACKAGE)-$(RPM_VERSION)
-TARBALL = $(RPM_NAME_VERSION).tar.bz2
+RPM_NAME_VERSION = $(PACKAGE)-$(RPM_VERSION)$(RPM_VERSION_PREREL)
+NAME_VERSION = $(PACKAGE)-$(RPM_VERSION)$(VERSION_PREREL)
+TARBALL = $(NAME_VERSION).tar.bz2
NUNC_STANS_URL ?= $(shell rpmspec -P -D 'use_nunc_stans 1' $(RPMBUILD)/SPECS/389-ds-base.spec | awk '/^Source3:/ {print $$2}')
NUNC_STANS_TARBALL ?= $(shell basename "$(NUNC_STANS_URL)")
NUNC_STANS_ON = 1
@@ -15,13 +18,13 @@ clean:
rm -rf rpmbuild

local-archive:
- -mkdir -p dist/$(RPM_NAME_VERSION)
- rsync -a --exclude=dist --exclude=.git --exclude=rpmbuild . dist/$(RPM_NAME_VERSION)
+ -mkdir -p dist/$(NAME_VERSION)
+ rsync -a --exclude=dist --exclude=.git --exclude=rpmbuild . dist/$(NAME_VERSION)

tarballs: local-archive
-mkdir -p dist/sources
- cd dist; tar cfj sources/$(TARBALL) $(RPM_NAME_VERSION)
- rm -rf dist/$(RPM_NAME_VERSION)
+ cd dist; tar cfj sources/$(TARBALL) $(NAME_VERSION)
+ rm -rf dist/$(NAME_VERSION)
cd dist/sources ; \
if [ $(NUNC_STANS_ON) -eq 1 ]; then \
wget $(NUNC_STANS_URL) ; \
@@ -56,28 +59,28 @@ rpmbuildprep:

srpms: rpmroot srpmdistdir tarballs rpmbuildprep
rpmbuild --define "_topdir $(RPMBUILD)" -bs $(RPMBUILD)/SPECS/$(PACKAGE).spec
- cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)-*.src.rpm dist/srpms/
+ cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)*.src.rpm dist/srpms/
rm -rf $(RPMBUILD)

patch_srpms: rpmroot srpmdistdir tarballs rpmbuildprep
cp rpm/*.patch $(RPMBUILD)/SOURCES/
rpm/add_patches.sh rpm $(RPMBUILD)/SPECS/$(PACKAGE).spec
rpmbuild --define "_topdir $(RPMBUILD)" -bs $(RPMBUILD)/SPECS/$(PACKAGE).spec
- cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)-*.src.rpm dist/srpms/
+ cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)*.src.rpm dist/srpms/
rm -rf $(RPMBUILD)

rpms: rpmroot srpmdistdir rpmdistdir tarballs rpmbuildprep
rpmbuild --define "_topdir $(RPMBUILD)" -ba $(RPMBUILD)/SPECS/$(PACKAGE).spec
- cp $(RPMBUILD)/RPMS/*/$(RPM_NAME_VERSION)-*.rpm dist/rpms/
- cp $(RPMBUILD)/RPMS/*/$(PACKAGE)-*-$(RPM_VERSION)-*.rpm dist/rpms/
- cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)-*.src.rpm dist/srpms/
+ cp $(RPMBUILD)/RPMS/*/$(RPM_NAME_VERSION)*.rpm dist/rpms/
+ cp $(RPMBUILD)/RPMS/*/$(PACKAGE)-*-$(RPM_VERSION)*.rpm dist/rpms/
+ cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)*.src.rpm dist/srpms/
rm -rf $(RPMBUILD)

patch_rpms: rpmroot srpmdistdir rpmdistdir tarballs rpmbuildprep
cp rpm/*.patch $(RPMBUILD)/SOURCES/
rpm/add_patches.sh rpm $(RPMBUILD)/SPECS/$(PACKAGE).spec
rpmbuild --define "_topdir $(RPMBUILD)" -ba $(RPMBUILD)/SPECS/$(PACKAGE).spec
- cp $(RPMBUILD)/RPMS/*/$(RPM_NAME_VERSION)-*.rpm dist/rpms/
- cp $(RPMBUILD)/RPMS/*/$(PACKAGE)-*-$(RPM_VERSION)-*.rpm dist/rpms/
- cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)-*.src.rpm dist/srpms/
+ cp $(RPMBUILD)/RPMS/*/$(RPM_NAME_VERSION)*.rpm dist/rpms/
+ cp $(RPMBUILD)/RPMS/*/$(PACKAGE)-*-$(RPM_VERSION)*.rpm dist/rpms/
+ cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)*.src.rpm dist/srpms/
rm -rf $(RPMBUILD)

--
389-commits mailing list
389-commits@lists.fedoraproject.org
https://lists.fedoraproject.org/admin/lists/389-commits@lists.fedoraproject.org

No comments:

Post a Comment