From 312e4d37cc964bbc5bd4e20fd25500b08dc70268 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 9 Apr 2014 00:35:55 -0700 Subject: Add @source command to help modified verions satisfy the AGPL --- version.make | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) (limited to 'version.make') diff --git a/version.make b/version.make index 7ceea82..f7d5511 100644 --- a/version.make +++ b/version.make @@ -1,7 +1,11 @@ +# These lines are automatically replaced in tarballs generated by 'make dist' VERSION_FULL := $(shell git --git-dir=${SRC_DIR}/.git describe --tags HEAD) VERSION_HASH := $(shell git --git-dir=${SRC_DIR}/.git rev-parse HEAD) version_bits := $(subst v, ,$(subst -, ,$(subst ., ,${VERSION_FULL}))) +# Note: these four numbers are limited to 255. +# Currently, my tags are yy.mm.dd instead of semantic versioning. +# The dev number is how many commits since the last tag. VERSION_MAJOR := $(word 1,${version_bits}) VERSION_MINOR := $(word 2,${version_bits}) VERSION_PATCH := $(word 3,${version_bits}) @@ -9,8 +13,35 @@ VERSION_DEVEL := $(word 4,${version_bits}) ifeq "${VERSION_DEVEL}" "" VERSION_DEVEL := 0 endif -# tracking dirty trees is more trouble than it's worth -#VERSION_FULL += $(shell cd ${SRC_DIR}; git diff --quiet HEAD || echo dirty) -VENDOR := Vanilla -VENDOR_VERSION := 0 + + +# Settings for those distributing modified versions. +# +# It is strongly recommended that all distributors set these, +# but the only *requirement* is that modified versions that are run +# (semi)publicly give VENDOR_SOURCE to satisfy section 13 of the AGPLv3. + +# TODO should these be passed to configure instead? + +# Vendor Name: String (no newlines, no parentheses) +# This is usually one word, and does not (usually) change over time. +# (Examples: Gentoo, Debian, Fedora, Ubuntu) +VENDOR_NAME := Vanilla +# Vendor Point: Integer (max value 65535) +# This is intended to be the "packaging revision number", assuming that's +# an integer. At a minimum, please try to make it nonzero if you have +# any non-upstream patches (unconditionally nonzero is also okay). +# (If your revision 0 package has patches ... please be nicer to upstream) +VENDOR_POINT := 0 +# URL where the source may be found (after searching for version number). +# See AGPLv3 section 13 +VENDOR_SOURCE := https://github.com/themanaworld/tmwa + +# Convenience +VERSION_STRING := TMWA ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} dev${VERSION_DEVEL} +${VENDOR_POINT} (${VENDOR_NAME}) + +version: + @echo version '${VERSION_STRING}' + @echo based on commit ${VERSION_FULL} aka ${VERSION_HASH} + @echo source ${VENDOR_SOURCE} -- cgit v1.2.3-60-g2f50