-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (57 loc) · 2.59 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
include makefilet-download-ondemand.mk
RELEASE_DIR = releases
RELEASE_PREFIX = bdsync-manager
# read the latest "Release" line from the changelog
VERSION = $(shell cat VERSION)
RELEASE_ARCHIVE_FILE = $(RELEASE_DIR)/$(RELEASE_PREFIX)-$(VERSION).tar.gz
RELEASE_DEB_FILE = $(RELEASE_DIR)/$(RELEASE_PREFIX)_$(VERSION)-1_all.deb
RELEASE_SIGNATURE_FILE = $(RELEASE_ARCHIVE_FILE).sig
UPLOAD_TARGET = $(UPLOAD_USER)@dl.sv.nongnu.org:/releases/bdsync-manager
PYTHON_BUILD_DIRS = bdsync_manager.egg-info build dist
MANPAGE = $(DIR_BUILD)/bdsync-manager.1
SETUPTOOLS ?= python3 setup.py
PYPI_UPLOAD_TARGET = pypi
.PHONY: release sign upload pypi-upload website website-upload clean
default-target: help
help:
@echo "Available targets for bdsync-manager:"
@echo " sign - create a signature for a release archive"
@echo " release - create distributable files for a release"
@echo " upload-python - upload the Python package to the Python Package Index (pypi)"
@echo " upload-savannah - upload release files to the savannah hosting"
@echo " website - create the html output of the website"
@echo " website-upload - upload the website to savannah"
@echo " test - run code style checks"
@echo " clean - remove temporary files"
@echo
sign: $(RELEASE_SIGNATURE_FILE)
release: $(RELEASE_ARCHIVE_FILE) $(RELEASE_DEB_FILE)
build: manpages
.PHONY: manpages
manpages: $(MANPAGE)
$(MANPAGE): Makefile bdsync-manager.help2man.include
help2man --no-info --include bdsync-manager.help2man.include ./bdsync-manager >"$@.new"
mv "$@.new" "$@"
upload-savannah: sign release
@[ -z "$(UPLOAD_USER)" ] && { echo >&2 "ERROR: Missing savannah user name for upload:\n make upload-savannah UPLOAD_USER=foobar"; exit 1; } || true
rsync -a "$(RELEASE_ARCHIVE_FILE)" "$(RELEASE_SIGNATURE_FILE)" "$(RELEASE_DEB_FILE)" "$(UPLOAD_TARGET)/"
$(RELEASE_SIGNATURE_FILE): $(RELEASE_ARCHIVE_FILE) Makefile
gpg --detach-sign --use-agent "$<"
$(RELEASE_ARCHIVE_FILE): Makefile
# verify that the given version exists
git tag | grep -qwF "v$(VERSION)"
git archive --prefix=$(RELEASE_PREFIX)-$(VERSION)/ --output=$@ v$(VERSION)
$(RELEASE_DEB_FILE): Makefile dist-deb $(DIR_DEBIAN_BUILD)/$(notdir $@)
cp "$(DIR_DEBIAN_BUILD)/$(notdir $@)" "$@"
website:
$(MAKE) -C website html
website-upload: website
$(MAKE) -C website cvs-publish
clean:
$(MAKE) -C website clean
# python build directories
$(RM) -r $(PYTHON_BUILD_DIRS)