1# Copyright (c) 2010-2014, 2016, 2017, The Trusted Domain Project.
2# All rights reserved.
3
4AUTOMAKE_OPTIONS = foreign
5ACLOCAL_AMFLAGS = -I m4
6
7SUBDIRS = libopenarc contrib docs openarc
8dist_doc_DATA = LICENSE LICENSE.Sendmail RELEASE_NOTES
9dist_noinst_SCRIPTS = libtool
10
11DISTCLEANFILES = openarc-@VERSION@.tar.gz
12
13# TODO: get configure.ac to generate --enable-{feature} for all
14# non-experimental features and substitute it here e.g  @SUPPORTED_FEATURES@.
15# Perhaps all features would enable a more comprehensive test coverage map
16# though.
17DISTCHECK_CONFIGURE_FLAGS=--with-openssl=/usr/local
18
19$(DIST_ARCHIVES): distcheck
20
21$(DIST_ARCHIVES).md5: $(DIST_ARCHIVES)
22	md5 $? > $@ || md5sum $? > $@
23
24$(DIST_ARCHIVES).sha1: $(DIST_ARCHIVES)
25	sha1 $? > $@ || sha1sum $? > $@
26
27$(DIST_ARCHIVES).asc: $(DIST_ARCHIVES)
28	gpg -a -u security@trusteddomain.org --detach-sign $?
29
30push: $(DIST_ARCHIVES) $(DIST_ARCHIVES).sha1 $(DIST_ARCHIVES).md5 $(DIST_ARCHIVES).asc
31	@echo "Are you sure you want to tag and release $(DIST_ARCHIVES)? (y/n)"
32	@read confirm && [ $$confirm = 'y' ]
33	git tag rel-openarc-`echo $(VERSION) | sed 's/\./-/g'`
34	git push --tags
35
36dist-hook:
37	[ -f $(distdir)/libopenarc/arc.h ] && rm -f $(distdir)/libopenarc/arc.h
38	sed -e '/OPENARC_LIB_VERSION/s/0x[0-9]*/0x@HEX_VERSION@/' < $(srcdir)/libopenarc/arc.h > $(distdir)/libopenarc/arc.h
39	echo "looking to see if @VERSION@ is in the RELEASE_NOTES"
40	fgrep @VERSION@ $(srcdir)/RELEASE_NOTES
41	sed -e 's|\(@VERSION@[ \t]*\)[0-9?]\{4\}\(/[0-9?]\{2\}\)\{2\}|\1'`date +%Y/%m/%d`'|' < $(srcdir)/RELEASE_NOTES > $(distdir)/RELEASE_NOTES
42
43rpm: dist-gzip
44	rpmbuild -ta $(distdir).tar.gz
45
46.PHONY: push
47