Updated Makefile to use git to find version. Remove unnecessary

username information checking.
This commit is contained in:
Jesse Smith 2018-05-05 14:33:54 -03:00
parent 828c2704a1
commit 670d691e1a

View File

@ -2,21 +2,16 @@ all install clean distclean:
$(MAKE) -C src $@ $(MAKE) -C src $@
PACKAGE=sysvinit PACKAGE=sysvinit
VERSION=$(shell sed -rn '1s/.*[[:blank:]]\((.*)\)[[:blank:]].*/\1/p' doc/Changelog) VERSION=$(shell git describe --tags --abbrev=4 HEAD 2>/dev/null | tr %_ :~)
GITLOGIN=$(shell git remote -v | head -n 1 | cut -f 3 -d '/' | cut -f 1 -d '@') override TARBALL=$(PACKAGE)-$(VERSION).tar.xz
override TMP:=$(shell mktemp -d $(VERSION).XXXXXXXX) override TARBALL_LATEST=$(PACKAGE)-latest.tar.xz
override TARBALL:=$(TMP)/$(PACKAGE)-$(VERSION).tar.bz2 override SFTPBATCH=upload-$(VERSION)-sftpbatch
override SFTPBATCH:=$(TMP)/$(VERSION)-sftpbatch
SOURCES=contrib COPYING COPYRIGHT doc Makefile man README src
dist: $(TARBALL) dist: $(TARBALL)
@cp $(TARBALL) . @echo "tarball $(TARBALL) ready"
@echo "tarball $(PACKAGE)-$(VERSION).tar.bz2 ready"
rm -rf $(TMP)
upload: $(SFTPBATCH) upload: $(SFTPBATCH)
echo @sftp -b $< $(GITLOGIN)@dl.sv.nongnu.org:/releases/$(PACKAGE) echo @sftp -b $< dl.sv.nongnu.org:/releases/$(PACKAGE)
rm -rf $(TMP)
$(SFTPBATCH): $(TARBALL).sig $(SFTPBATCH): $(TARBALL).sig
@echo progress > $@ @echo progress > $@
@ -24,18 +19,12 @@ $(SFTPBATCH): $(TARBALL).sig
@echo chmod 664 $(notdir $(TARBALL)) >> $@ @echo chmod 664 $(notdir $(TARBALL)) >> $@
@echo put $(TARBALL).sig >> $@ @echo put $(TARBALL).sig >> $@
@echo chmod 664 $(notdir $(TARBALL)).sig >> $@ @echo chmod 664 $(notdir $(TARBALL)).sig >> $@
@echo rm $(PACKAGE)-latest.tar.bz2 >> $@ @echo rm $(TARBALL_LATEST) >> $@
@echo symlink $(notdir $(TARBALL)) $(PACKAGE)-latest.tar.bz2 >> $@ @echo symlink $(notdir $(TARBALL)) $(TARBALL_LATEST) >> $@
@echo quit >> $@ @echo quit >> $@
$(TARBALL).sig: $(TARBALL) $(TARBALL).sig: $(TARBALL)
@gpg -q -ba --use-agent -o $@ $< @gpg -q -ba --use-agent -o $@ $<
$(TARBALL): $(TMP)/$(PACKAGE)-$(VERSION) $(TARBALL): .git
@tar --exclude=.git --bzip2 --owner=nobody --group=nogroup -cf $@ -C $(TMP) $(PACKAGE)-$(VERSION) @git archive --prefix=$(PACKAGE)-$(VERSION)/ $(VERSION) -o $(TARBALL)
$(TMP)/$(PACKAGE)-$(VERSION):
@mkdir $(TMP)/$(PACKAGE)-$(VERSION)
@cp -R $(SOURCES) $(TMP)/$(PACKAGE)-$(VERSION)/
@chmod -R a+r,u+w,og-w $@
@find $@ -type d | xargs -r chmod a+rx,u+w,og-w