Blame build-aux/release.mk

Packit 437b5e
# Slingshot release rules for GNU Make.
Packit 437b5e
Packit 437b5e
# ======================================================================
Packit 437b5e
# Copyright (C) 2001-2015 Free Software Foundation, Inc.
Packit 437b5e
# Originally by Jim Meyering, Simon Josefsson, Eric Blake,
Packit 437b5e
#               Akim Demaille, Gary V. Vaughan, and others.
Packit 437b5e
# This version by Gary V. Vaughan, 2013.
Packit 437b5e
#
Packit 437b5e
# This program is free software: you can redistribute it and/or modify
Packit 437b5e
# it under the terms of the GNU General Public License as published by
Packit 437b5e
# the Free Software Foundation, either version 3 of the License, or
Packit 437b5e
# (at your option) any later version.
Packit 437b5e
#
Packit 437b5e
# This program is distributed in the hope that it will be useful,
Packit 437b5e
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 437b5e
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 437b5e
# GNU General Public License for more details.
Packit 437b5e
#
Packit 437b5e
# You should have received a copy of the GNU General Public License
Packit 437b5e
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 437b5e
# ======================================================================
Packit 437b5e
Packit 437b5e
NOTHING_ELSE ?=
Packit 437b5e
Packit 437b5e
Packit 437b5e
## --------------- ##
Packit 437b5e
## GNU Make magic. ##
Packit 437b5e
## --------------- ##
Packit 437b5e
Packit 437b5e
# This file uses GNU Make extensions. Include it from GNUmakefile with:
Packit 437b5e
#
Packit 437b5e
#   include build-aux/release.mk
Packit 437b5e
Packit 437b5e
# Make tar archive easier to reproduce.
Packit 437b5e
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
Packit 437b5e
Packit 437b5e
# Helper variables.
Packit 437b5e
_empty =
Packit 437b5e
_sp = $(_empty) $(_empty)
Packit 437b5e
Packit 437b5e
# member-check,VARIABLE,VALID-VALUES
Packit 437b5e
# ----------------------------------
Packit 437b5e
# Check that $(VARIABLE) is in the space-separated list of VALID-VALUES, and
Packit 437b5e
# return it.  Die otherwise.
Packit 437b5e
member-check =								\
Packit 437b5e
  $(strip								\
Packit 437b5e
    $(if $($(1)),							\
Packit 437b5e
      $(if $(findstring $(_sp),$($(1))),				\
Packit 437b5e
          $(error invalid $(1): '$($(1))', expected $(2)),		\
Packit 437b5e
          $(or $(findstring $(_sp)$($(1))$(_sp),$(_sp)$(2)$(_sp)),	\
Packit 437b5e
            $(error invalid $(1): '$($(1))', expected $(2)))),		\
Packit 437b5e
      $(error $(1) undefined)))
Packit 437b5e
Packit 437b5e
include Makefile
Packit 437b5e
Packit 437b5e
## --------- ##
Packit 437b5e
## Defaults. ##
Packit 437b5e
## --------- ##
Packit 437b5e
Packit 437b5e
GIT	 ?= git
Packit 437b5e
LUA	 ?= lua
Packit 437b5e
LUAROCKS ?= luarocks
Packit 437b5e
TAR	 ?= tar
Packit 437b5e
Packit 437b5e
# Override this in cfg.mk if you are using a different format in your
Packit 437b5e
# NEWS file.
Packit 437b5e
today ?= $(shell date +%Y-%m-%d)
Packit 437b5e
Packit 437b5e
# Old releases are stored here.
Packit 437b5e
release_archive_dir ?= ../release
Packit 437b5e
Packit 437b5e
# Override this in cfg.mk if you follow different procedures.
Packit 437b5e
release-prep-hook  ?= release-prep
Packit 437b5e
Packit 437b5e
_build-aux         ?= build-aux
Packit 437b5e
my_distdir	   ?= $(PACKAGE)-$(VERSION)
Packit 437b5e
prev_version_file  ?= $(srcdir)/.prev-version
Packit 437b5e
old_NEWS_hash-file ?= $(srcdir)/local.mk
Packit 437b5e
gl_noteworthy_news_ = \#\# Noteworthy changes in release ?.? (????-??-??) [?]
Packit 437b5e
Packit 437b5e
PREV_VERSION        = $(shell cat $(prev_version_file) 2>/dev/null)
Packit 437b5e
VERSION_REGEXP      = $(subst .,\.,$(VERSION))
Packit 437b5e
PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION))
Packit 437b5e
Packit 437b5e
Packit 437b5e
## ------------- ##
Packit 437b5e
## Distribution. ##
Packit 437b5e
## ------------- ##
Packit 437b5e
Packit 437b5e
gitlog_to_changelog = $(srcdir)/build-aux/gitlog-to-changelog
Packit 437b5e
Packit 437b5e
dist-hook: ChangeLog
Packit 437b5e
.PHONY: ChangeLog
Packit 437b5e
ChangeLog:
Packit 437b5e
	$(AM_V_GEN)if test -d '$(srcdir)/.git'; then		\
Packit 437b5e
	  $(gitlog_to_changelog) $(gitlog_args) > '$@T';	\
Packit 437b5e
	  rm -f '$@'; mv '$@T' '$@';				\
Packit 437b5e
	fi
Packit 437b5e
Packit 437b5e
# Override this in GNUmakefile if you don't want to automatically
Packit 437b5e
# redistribute all the maintainer support files (take care that
Packit 437b5e
# Travis CI is finicky about this, and will likely need tweaking
Packit 437b5e
# to cope with missing any of these if you decide to omit them).
Packit 437b5e
Packit 437b5e
_travis_yml ?= .travis.yml travis.yml.in
Packit 437b5e
Packit 437b5e
release_extra_dist ?=					\
Packit 437b5e
	.autom4te.cfg					\
Packit 437b5e
	GNUmakefile					\
Packit 437b5e
	bootstrap					\
Packit 437b5e
	bootstrap.conf					\
Packit 437b5e
	local.mk					\
Packit 437b5e
	$(_travis_yml)					\
Packit 437b5e
	$(NOTHING_ELSE)
Packit 437b5e
Packit 437b5e
EXTRA_DIST +=						\
Packit 437b5e
	$(_build-aux)/release.mk			\
Packit 437b5e
	$(gitlog_to_changelog)				\
Packit 437b5e
	$(release_extra_dist)				\
Packit 437b5e
	$(NOTHING_ELSE)
Packit 437b5e
Packit 437b5e
all-am: $(_travis_yml)
Packit 437b5e
Packit 437b5e
Packit 437b5e
## -------- ##
Packit 437b5e
## Release. ##
Packit 437b5e
## -------- ##
Packit 437b5e
Packit 437b5e
# The vast majority of what follows is preparation -in the form
Packit 437b5e
# of early bail-out if something is not right yet- for the final
Packit 437b5e
# check-in-release-branch rule that makes the tip of the release
Packit 437b5e
# branch match the contents of a 'make distcheck' tarball.
Packit 437b5e
Packit 437b5e
# Validate and return $(RELEASE_TYPE), or die.
Packit 437b5e
RELEASE_TYPES = alpha beta stable
Packit 437b5e
release-type = $(call member-check,RELEASE_TYPE,$(RELEASE_TYPES))
Packit 437b5e
Packit 437b5e
# This will actually make the release, including sending release
Packit 437b5e
# announcements, and pushing changes back to the origin.
Packit 437b5e
# Use it like this, eg:
Packit 437b5e
#				make RELEASE_TYPE=beta
Packit 437b5e
.PHONY: release
Packit 437b5e
release:
Packit 437b5e
	$(AM_V_GEN)$(MAKE) $(release-type)
Packit 437b5e
	$(AM_V_GEN)$(MAKE) push
Packit 437b5e
	$(AM_V_GEN)$(MAKE) upload
Packit 437b5e
	$(AM_V_GEN)$(MAKE) mail
Packit 437b5e
Packit 437b5e
submodule-checks ?= no-submodule-changes public-submodule-commit
Packit 437b5e
Packit 437b5e
.PHONY: no-submodule-changes
Packit 437b5e
no-submodule-changes:
Packit 437b5e
	$(AM_V_GEN)if test -d $(srcdir)/.git				\
Packit 437b5e
		&& git --version >/dev/null 2>&1; then			\
Packit 437b5e
	  diff=$$(cd $(srcdir) && git submodule -q foreach		\
Packit 437b5e
		  git diff-index --name-only HEAD);			\
Packit 437b5e
	  case $$diff in '') ;;						\
Packit 437b5e
	    *) echo '$(ME): submodule files are locally modified:';	\
Packit 437b5e
		echo "$$diff"; exit 1;; esac;				\
Packit 437b5e
	else								\
Packit 437b5e
	  : ;								\
Packit 437b5e
	fi
Packit 437b5e
Packit 437b5e
# Ensure that each sub-module commit we're using is public.
Packit 437b5e
# Without this, it is too easy to tag and release code that
Packit 437b5e
# cannot be built from a fresh clone.
Packit 437b5e
.PHONY: public-submodule-commit
Packit 437b5e
public-submodule-commit:
Packit 437b5e
	$(AM_V_GEN)if test -d $(srcdir)/.git				\
Packit 437b5e
		&& git --version >/dev/null 2>&1; then			\
Packit 437b5e
	  cd $(srcdir) &&						\
Packit 437b5e
	  git submodule --quiet foreach					\
Packit 437b5e
	      'test "$$(git rev-parse "$$sha1")"			\
Packit 437b5e
	      = "$$(git merge-base origin "$$sha1")"'			\
Packit 437b5e
	    || { echo '$(ME): found non-public submodule commit' >&2;	\
Packit 437b5e
		 exit 1; };						\
Packit 437b5e
	else								\
Packit 437b5e
	  : ;								\
Packit 437b5e
	fi
Packit 437b5e
# This rule has a high enough utility/cost ratio that it should be a
Packit 437b5e
# dependent of "check" by default.  However, some of us do occasionally
Packit 437b5e
# commit a temporary change that deliberately points to a non-public
Packit 437b5e
# submodule commit, and want to be able to use rules like "make check".
Packit 437b5e
# In that case, run e.g., "make check gl_public_submodule_commit="
Packit 437b5e
# to disable this test.
Packit 437b5e
gl_public_submodule_commit ?= public-submodule-commit
Packit 437b5e
check: $(gl_public_submodule_commit)
Packit 437b5e
Packit 437b5e
# These targets do all the file shuffling necessary for a release, but
Packit 437b5e
# purely locally, so you can rewind and redo before pushing anything
Packit 437b5e
# to origin or sending release announcements. Use it like this, eg:
Packit 437b5e
#
Packit 437b5e
#				make beta
Packit 437b5e
.PHONY: alpha beta stable
Packit 437b5e
alpha beta stable: $(submodule-checks)
Packit 437b5e
	$(AM_V_GEN)test $@ = stable &&					\
Packit 437b5e
	  { echo $(VERSION) |$(EGREP) '^[0-9]+(\.[0-9]+)*$$' >/dev/null	\
Packit 437b5e
	    || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
Packit 437b5e
	  || :
Packit 437b5e
	$(AM_V_at)$(MAKE) prev-version-check
Packit 437b5e
	$(AM_V_at)$(MAKE) vc-diff-check
Packit 437b5e
	$(AM_V_at)$(MAKE) release-commit RELEASE_TYPE=$@
Packit 437b5e
	$(AM_V_at)$(MAKE) news-check
Packit 437b5e
	$(AM_V_at)$(MAKE) distcheck
Packit 437b5e
	$(AM_V_at)$(MAKE) check
Packit 437b5e
	$(AM_V_at)$(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
Packit 437b5e
	$(AM_V_at)$(MAKE) check-in-release-branch
Packit 437b5e
Packit 437b5e
prev-version-check:
Packit 437b5e
	$(AM_V_at)if test -z "`$(GIT) ls-files $(prev_version_file)`";	\
Packit 437b5e
	then								\
Packit 437b5e
	  echo "error: checked in $(prev_version_file) required." >&2;	\
Packit 437b5e
	  exit 1;							\
Packit 437b5e
	fi
Packit 437b5e
Packit 437b5e
# Abort the release if there are unchecked in changes remaining.
Packit 437b5e
vc-diff-check:
Packit 437b5e
	$(AM_V_at)if ! $(GIT) diff --exit-code; then		\
Packit 437b5e
	  $(GIT) diff >/dev/null;				\
Packit 437b5e
	  echo "error: Some files are locally modified" >&2;	\
Packit 437b5e
	  exit 1;						\
Packit 437b5e
	fi
Packit 437b5e
Packit 437b5e
# Select which lines of NEWS are searched for $(news-check-regexp).
Packit 437b5e
# This is a sed line number spec.  The default says that we search
Packit 437b5e
# only line 3 of NEWS for $(news-check-regexp), to match the behaviour
Packit 437b5e
# of '$(_build-aux)/do-release-commit-and-tag'.
Packit 437b5e
# If you want to search only lines 1-10, use "1,10".
Packit 437b5e
news-check-lines-spec ?= 3
Packit 437b5e
news-check-regexp ?= '^\#\#.* $(VERSION_REGEXP) \($(today)\)'
Packit 437b5e
Packit 437b5e
Makefile.in: NEWS
Packit 437b5e
Packit 437b5e
NEWS:
Packit 437b5e
	$(AM_V_GEN)if test -f NEWS.md; then ln -s NEWS.md NEWS;		\
Packit 437b5e
	elif test -f NEWS.rst; then ln -s NEWS.rst NEWS;		\
Packit 437b5e
	elif test -f NEWS.txt; then ln -s NEWS.txt NEWS;		\
Packit 437b5e
	fi
Packit 437b5e
Packit 437b5e
news-check: NEWS
Packit 437b5e
	$(AM_V_GEN)if $(SED) -n $(news-check-lines-spec)p $<		\
Packit 437b5e
	    | $(EGREP) $(news-check-regexp) >/dev/null; then		\
Packit 437b5e
	  :;								\
Packit 437b5e
	else								\
Packit 437b5e
	  echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2;	\
Packit 437b5e
	  exit 1;							\
Packit 437b5e
	fi
Packit 437b5e
Packit 437b5e
.PHONY: release-commit
Packit 437b5e
release-commit: NEWS
Packit 437b5e
	$(AM_V_GEN)cd $(srcdir)						\
Packit 437b5e
	  && $(_build-aux)/do-release-commit-and-tag			\
Packit 437b5e
	       -C $(abs_builddir) $(VERSION) $(RELEASE_TYPE)
Packit 437b5e
Packit 437b5e
define emit-commit-log
Packit 437b5e
  printf '%s\n' 'maint: post-release administrivia.' ''			\
Packit 437b5e
    '* NEWS: Add header line for next release.'				\
Packit 437b5e
    '* .prev-version: Record previous version.'				\
Packit 437b5e
    '* $(old_NEWS_hash-file) (old_NEWS_hash): Auto-update.'
Packit 437b5e
endef
Packit 437b5e
Packit 437b5e
.PHONY: release-prep
Packit 437b5e
release-prep: $(scm_rockspec)
Packit 437b5e
	$(AM_V_GEN)$(MAKE) --no-print-directory -s announcement		\
Packit 437b5e
	  > ~/announce-$(my_distdir)
Packit 437b5e
	$(AM_V_at)if test -d $(release_archive_dir); then		\
Packit 437b5e
	  ln $(rel-files) $(release_archive_dir);			\
Packit 437b5e
	  chmod a-w $(rel-files);					\
Packit 437b5e
	fi
Packit 437b5e
	$(AM_V_at)echo $(VERSION) > $(prev_version_file)
Packit 437b5e
	$(AM_V_at)$(MAKE) update-old-NEWS-hash
Packit 437b5e
	$(AM_V_at)perl -pi						\
Packit 437b5e
	  -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"'	\
Packit 437b5e
	  `readlink $(srcdir)/NEWS 2>/dev/null || echo $(srcdir)/NEWS`
Packit 437b5e
	$(AM_V_at)msg=$$($(emit-commit-log)) || exit 1;			\
Packit 437b5e
	cd $(srcdir) && $(GIT) commit -s -m "$$msg" -a
Packit 437b5e
	@echo '**** Release announcement in ~/announce-$(my_distdir)'
Packit 437b5e
Packit 437b5e
# Strip out copyright messages with years, so that changing those (e.g.
Packit 437b5e
# with 'make update-copyight') doesn't change the old_NEWS_hash.
Packit 437b5e
NEWS_hash =								\
Packit 437b5e
  $$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p'		\
Packit 437b5e
       $(srcdir)/NEWS							\
Packit 437b5e
     | perl -0777 -pe 's/^Copyright.+?[12][0-9]{3}.+?\n//ms'		\
Packit 437b5e
     | md5sum -								\
Packit 437b5e
     | sed 's/ .*//')
Packit 437b5e
Packit 437b5e
# Update the hash stored above.  Do this after each release and
Packit 437b5e
# for any corrections to old entries.
Packit 437b5e
Packit 437b5e
old-NEWS-regexp = '^old_NEWS_hash[ \t]+?=[ \t]+'
Packit 437b5e
update-old-NEWS-hash: NEWS
Packit 437b5e
	$(AM_V_GEN)if $(EGREP) $(old-NEWS-regexp) $(old_NEWS_hash-file); then \
Packit 437b5e
	  perl -pi -e 's/^(old_NEWS_hash[ \t]+:?=[ \t]+).*/$${1}'"$(NEWS_hash)/" \
Packit 437b5e
	    $(old_NEWS_hash-file);					\
Packit 437b5e
	else								\
Packit 437b5e
	  printf '%s\n' '' "old_NEWS_hash = $(NEWS_hash)"		\
Packit 437b5e
	    >> $(old_NEWS_hash-file); \
Packit 437b5e
	fi
Packit 437b5e
Packit 437b5e
ANNOUNCE_ENV	= LUA_INIT= LUA_PATH='$(abs_srcdir)/?-git-1.rockspec'
Packit 437b5e
ANNOUNCE_PRINT	= $(ANNOUNCE_ENV) $(LUA) -l$(PACKAGE) -e
Packit 437b5e
Packit 437b5e
_PRE	= "    https://raw.githubusercontent"
Packit 437b5e
_POST	= "/release-v$(VERSION)/$(PACKAGE)-$(VERSION)-$(rockspec_revision).rockspec"
Packit 437b5e
GITHUB_ROCKSPEC	= (source.url:gsub ("^git://github", $(_PRE)):gsub ("%.git$$", $(_POST)))
Packit 437b5e
Packit 437b5e
announcement: NEWS
Packit 437b5e
# Not $(AM_V_GEN) since the output of this command serves as
Packit 437b5e
# announcement message: else, it would start with " GEN announcement".
Packit 437b5e
	$(AM_V_at)printf '%s\n'						\
Packit 437b5e
	  '# [ANN] $(PACKAGE_NAME) $(VERSION) released'			\
Packit 437b5e
	  ''
Packit 437b5e
	$(AM_V_at)$(ANNOUNCE_PRINT) 'print (description.detailed)'
Packit 437b5e
	$(AM_V_at)printf '%s\n'	''					\
Packit 437b5e
	  'I am happy to announce release $(VERSION) of $(PACKAGE_NAME).' \
Packit 437b5e
	  ''
Packit 437b5e
	$(AM_V_at)$(ANNOUNCE_PRINT)					\
Packit 437b5e
	  'print ("$(PACKAGE_NAME)'\''s home page is at " .. description.homepage)'
Packit 437b5e
	$(AM_V_at)printf '\n'
Packit 437b5e
	$(AM_V_at)$(SED) -n						\
Packit 437b5e
	    -e '/^\#\# Noteworthy changes in release $(PREV_VERSION)/q'	\
Packit 437b5e
	    -e p NEWS |$(SED) -e 1,2d
Packit 437b5e
	$(AM_V_at)printf '%s\n'						\
Packit 437b5e
	  'Install it with LuaRocks, using:' ''				\
Packit 437b5e
	  '    luarocks install $(PACKAGE) $(VERSION)'
Packit 437b5e
	$(AM_V_at)$(ANNOUNCE_PRINT) 'print ($(GITHUB_ROCKSPEC))'
Packit 437b5e
Packit 437b5e
Packit 437b5e
branch		 = $(shell $(GIT) branch |$(SED) -ne '/^\* /{s///;p;q;}')
Packit 437b5e
GCO		 = $(GIT) checkout
Packit 437b5e
release-tarball	 = $(my_distdir).tar.gz
Packit 437b5e
Packit 437b5e
# Anything in $(_save-files) is not removed after switching to the
Packit 437b5e
# release branch, and is thus "in the release". Add addtional partial
Packit 437b5e
# filenames to save in save_release_files, for example:
Packit 437b5e
#    save_release_files = RELEASE-NOTES-
Packit 437b5e
_save-files =						\
Packit 437b5e
		$(release-tarball)			\
Packit 437b5e
		$(save_release_files)			\
Packit 437b5e
		$(NOTHING_ELSE)
Packit 437b5e
Packit 437b5e
Packit 437b5e
list-to-rexp     = $(SED) -e 's|^|(|' -e 's/|$$/)/'
Packit 437b5e
git-clean-files  = `printf -- '-e %s ' $(_save-files)`
Packit 437b5e
grep-clean-files = `printf -- '%s|' $(_save-files) |$(list-to-rexp)`
Packit 437b5e
Packit 437b5e
# Switch to (or create) 'release' branch, remove all files, except the
Packit 437b5e
# newly generated dist tarball, then unpack the dist tarball and check
Packit 437b5e
# in all the files it creates, and tag that as the next release.
Packit 437b5e
# Github creates automatic zipballs of tagged git revisions, so we can
Packit 437b5e
# safely use this tag in the rockspecs we distribute.
Packit 437b5e
submodule-regexp ?= '^\[submodule "'
Packit 437b5e
submodule-extract-spec ?= 's|^.*"\([^"]*\)".*$$|\1|'
Packit 437b5e
Packit 437b5e
.PHONY: check-in-release-branch
Packit 437b5e
check-in-release-branch:
Packit 437b5e
	$(AM_V_GEN)$(GCO) -b release v$(VERSION) 2>/dev/null || $(GCO) release
Packit 437b5e
	$(AM_V_at)$(GIT) pull origin release 2>/dev/null || true
Packit 437b5e
	$(AM_V_at)if $(EGREP) $(submodule-regexp) .gitmodules >/dev/null 2>&1; then \
Packit 437b5e
	    $(EGREP) $(submodule-regexp) .gitmodules			\
Packit 437b5e
	    | $(SED) $(submodule-extract-spec) | xargs rm -rf;		\
Packit 437b5e
	fi
Packit 437b5e
	$(AM_V_at)$(GIT) clean -dfx $(git-clean-files)
Packit 437b5e
	$(AM_V_at)remove_re=$(grep-clean-files);			\
Packit 437b5e
	    $(GIT) rm -f `$(GIT) ls-files |$(EGREP) -v "$$remove_re"`
Packit 437b5e
	$(AM_V_at)ln -s . '$(my_distdir)'
Packit 437b5e
	$(AM_V_at)$(TAR) zxf '$(release-tarball)'
Packit 437b5e
	$(AM_V_at)rm -f '$(my_distdir)' '$(release-tarball)'
Packit 437b5e
	$(AM_V_at)$(GIT) add .
Packit 437b5e
	$(AM_V_at)$(GIT) commit -s -a -m 'Release v$(VERSION).'
Packit 437b5e
	$(AM_V_at)$(GIT) tag -s -a -m 'Full source release v$(VERSION)' release-v$(VERSION)
Packit 437b5e
	$(AM_V_at)$(GCO) $(branch)
Packit 437b5e
Packit 437b5e
.PHONY: push
Packit 437b5e
push:
Packit 437b5e
	$(AM_V_at)$(GIT) push origin master
Packit 437b5e
	$(AM_V_at)$(GIT) push origin release
Packit 437b5e
	$(AM_V_at)$(GIT) push origin v$(VERSION)
Packit 437b5e
	$(AM_V_at)$(GIT) push origin release-v$(VERSION)
Packit 437b5e
Packit 437b5e
.PHONY: upload
Packit 437b5e
upload: rockspecs
Packit 437b5e
	$(AM_V_at)$(LUAROCKS) upload $${API_KEY+--api-key=$$API_KEY} \
Packit 437b5e
	    '$(PACKAGE)-$(VERSION)-$(rockspec_revision).rockspec'
Packit 437b5e
Packit 437b5e
announce_emails ?= lua-l@lists.lua.org
Packit 437b5e
Packit 437b5e
.PHONY: mail
Packit 437b5e
mail: rockspecs
Packit 437b5e
	$(AM_V_at)cat ~/announce-$(my_distdir)				\
Packit 437b5e
	  | mail -s '[ANN] $(PACKAGE) $(VERSION) released' --		\
Packit 437b5e
	    $(announce_emails)