Debian Codegraph @

Makefile

raw
1 PACKAGE=sysvinit
2 VERSION=$(shell sed -rn '1s/.*[[:blank:]]\((.*)\)[[:blank:]].*/\1/p' doc/Changelog)
3
4 all install clean distclean:
5 @rm -f $(PACKAGE)-$(VERSION).tar.xz $(PACKAGE)-$(VERSION).tar.xz.sig
6 $(MAKE) VERSION=$(VERSION) -C man $@
7 $(MAKE) VERSION=$(VERSION) -C src $@
8
9 GITLOGIN=$(shell git remote -v | head -n 1 | cut -f 1 -d '@' | sed 's/origin\t//g')
10 override TMP:=$(shell mktemp -du $(VERSION).XXXXXXXX)
11 override TARBALL:=$(TMP)/$(PACKAGE)-$(VERSION).tar.xz
12 override SFTPBATCH:=$(TMP)/$(VERSION)-sftpbatch
13 SOURCES=contrib COPYING COPYRIGHT doc Makefile man README src
14
15 dist: $(TARBALL).sig
16 @cp $(TARBALL) .
17 @cp $(TARBALL).sig .
18 @echo "tarball $(PACKAGE)-$(VERSION).tar.xz ready"
19 rm -rf $(TMP)
20
21 upload: $(SFTPBATCH)
22 echo @sftp -b $< $(GITLOGIN)@dl.sv.nongnu.org:/releases/$(PACKAGE)
23 rm -rf $(TMP)
24
25 $(SFTPBATCH): $(TARBALL).sig
26 @echo progress > $@
27 @echo put $(TARBALL) >> $@
28 @echo chmod 664 $(notdir $(TARBALL)) >> $@
29 @echo put $(TARBALL).sig >> $@
30 @echo chmod 664 $(notdir $(TARBALL)).sig >> $@
31 @echo rm $(PACKAGE)-latest.tar.bz2 >> $@
32 @echo symlink $(notdir $(TARBALL)) $(PACKAGE)-latest.tar.bz2 >> $@
33 @echo quit >> $@
34
35 $(TARBALL).sig: $(TARBALL)
36 @gpg -q -ba --use-agent -o $@ $<
37
38 $(TARBALL): $(TMP)/$(PACKAGE)-$(VERSION)
39 @tar --exclude=.git --owner=nobody --group=nogroup -cJf $@ -C $(TMP) $(PACKAGE)-$(VERSION)
40
41 $(TMP)/$(PACKAGE)-$(VERSION): distclean
42 @mkdir -p $(TMP)/$(PACKAGE)-$(VERSION)
43 @cp -R $(SOURCES) $(TMP)/$(PACKAGE)-$(VERSION)/
44 @chmod -R a+r,u+w,og-w $@
45 @find $@ -type d | xargs -r chmod a+rx,u+w,og-w