+
+goal distcheck = : dist {
+ d=goals-%version
+ tar zxf %tarfile
+ pushd "$d"
+ ./configure
+ make
+ make check
+ popd
+ rm -rf "$d"
+ print_green "PASS: distcheck"
+}
+
+#----------------------------------------------------------------------
+# Maintainer rules.
+
+# Easy way to commit and tag a release.
+goal maintainer-commit = {
+ git commit -a -m "Version "%version"."
+}
+
+goal maintainer-tag = {
+ git tag -a v%version -m "Version "%version -f
+}
+
+# Check no files are missing from distfiles above by unpacking the
+# distribution tarball and comparing it to git.
+goal maintainer-check-extra-dist = : dist @{
+ tar ztf %tarfile | sort |
+ sed 's,^goals-'%version'/,,' > tarfiles
+ git ls-files | sort > gitfiles
+ comm -13 tarfiles gitfiles > comm.out
+ cat comm.out
+ [ ! -s comm.out ]
+ rm tarfiles gitfiles comm.out
+ print_green "PASS: distfiles"
+}
+
+# XXX This should also do a Fedora build.
+goal maintainer-release = : dist,
+ maintainer-check-extra-dist,
+ distcheck,
+ maintainer-upload,
+ maintainer-srpm,
+ maintainer-fedora-copr
+
+let websitedir = "%HOME/d/websites/people.redhat.com/goals"
+
+# XXX Should actually use the *url tactic here.
+goal maintainer-upload = : distcheck {
+ [ -d %websitedir ]
+ cp %tarfile %websitedir/files
+ cp README %websitedir/README
+ cp man/goals.1.txt man/Goalfile.5.txt %websitedir
+ cd %websitedir
+ git add files/%tarfile README goals.1.txt Goalfile.5.txt
+ git commit -m "goals "%version
+ cd ..
+ ./.rsync
+}
+
+pure function get-fedora-dist () returning string = @{
+ rpm --eval '%%dist'
+}
+let fedora-dist = get-fedora-dist ()
+# XXX Replace autoconf macro with %{version} in future.
+let srpm = "goals-@PACKAGE_VERSION@-1%fedora-dist.src.rpm"
+
+goal maintainer-srpm =
+"%srpm" : tarfile, "goals.spec" {
+ rpmbuild -bs \
+ --define "%%_sourcedir $PWD" \
+ --define "%%_srcrpmdir $PWD" \
+ goals.spec
+}
+
+goal maintainer-fedora-copr = : maintainer-upload, srpm {
+ copr build rjones/goals %srpm
+}
\ No newline at end of file