Juan Hernandez has uploaded a new change for review.

Change subject: sdk: Always generate the tarball when building RPMs
......................................................................

sdk: Always generate the tarball when building RPMs

Currently the tarball is only generated if there were changes in the Makefile
or the .spec template. This means that changes to the SDK itself will not be
included in the resulting RPMs unless they are locally commited, which makes
things very confusing for developers. This patc changes the Makefile so that
the tarball is always regenerated.

Change-Id: I20cfe74995e9aac87a342ddc39577d85873313ba
Signed-off-by: Juan Hernandez <[email protected]>
---
M Makefile
M sdk/Makefile
2 files changed, 18 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-sdk-java 
refs/changes/56/39856/1

diff --git a/Makefile b/Makefile
index 71eeda1..9e8358f 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
 
 .PHONY: dist
 dist:
-       env rpmsuffix=$(GIT_RELEASE) $(MAKE) -C $(PROJ_DIR) dist; mv 
$(PROJ_DIR)/*.gz .
+       env rpmsuffix=$(GIT_RELEASE) $(MAKE) -C $(PROJ_DIR) tarball; mv 
$(PROJ_DIR)/*.gz .
 
 clean:
        $(MAKE) -C $(PROJ_DIR) clean; rm *gz
diff --git a/sdk/Makefile b/sdk/Makefile
index 46bbf69..17324a5 100644
--- a/sdk/Makefile
+++ b/sdk/Makefile
@@ -13,32 +13,33 @@
 TARBALL=$(NAME)-$(pomversion).tar.gz
 SRPM=$(RPMTOP)/SRPMS/$(NAME)-$(rpmversion)-$(rpmrelease).src.rpm
 
-$(SPEC): spec$(rpmdist).in
+.PHONY:
+spec: spec$(rpmdist).in
        sed \
                -e 's/@POM_VERSION@/$(pomversion)/g' \
                -e 's/@RPM_VERSION@/$(rpmversion)/g' \
                -e 's/@RPM_RELEASE@/$(rpmrelease)/g' \
                -e 's/@TARBALL@/$(TARBALL)/g' \
                < $< \
-               > $@
+               > $(SPEC)
 
-.PHONY: dist tarball
-tarball: dist
-dist: $(TARBALL)
-$(TARBALL): Makefile $(NAME).spec #$(TESTS)
-       git ls-files | tar --transform='s#^#$(NAME)/#' --files-from 
/proc/self/fd/0 -czf $(TARBALL) $(NAME).spec
+.PHONY: tarball
+tarball: spec
+       git ls-files | tar --transform='s|^|$(NAME)/|' --files-from 
/proc/self/fd/0 -czf $(TARBALL) $(SPEC)
 
-.PHONY: srpm rpm
-srpm: $(SRPM)
-$(SRPM): $(TARBALL)
-       mkdir -p $(RPMTOP)/{RPMS,SRPMS,SOURCES,BUILD}
-       rpmbuild -ts \
-           --define="_topdir $(RPMTOP)" \
-           $(TARBALL)
+.PHONY: srpm
+srpm: tarball
+       rpmbuild \
+               --define="_topdir $(RPMTOP)" \
+               -ts $(TARBALL)
 
-rpm: $(SRPM)
-       rpmbuild --define="_topdir $(RPMTOP)" --rebuild $<
+.PHONY: rpm
+rpm: srpm
+       rpmbuild \
+               --define="_topdir $(RPMTOP)" \
+               --rebuild $(SRPM)
 
+.PHONY: clean
 clean:
        $(RM) $(NAME)*.tar.gz $(SPEC)
        $(RM) -r rpmtop


-- 
To view, visit https://gerrit.ovirt.org/39856
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I20cfe74995e9aac87a342ddc39577d85873313ba
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk-java
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to