Makefile: simplify make rpm

Prior to this patch, `make rpm` would produce rpms that have the latest
tag as their versions. This was confusing, because one could never know
which contents are in a locally built rpm.

Change this so that the is version always based on the commit hash of
HEAD. This is easy: the golang macros read a `%commit` macro when it
exists and do this for us.

To simplify more, only define `%_topdir` to ./rpmbuild and use
rpmbuild's known directory structure (SPEC, SOURCES, RPMS, ...)
otherwise, to make it easier to find build results.

Build the specfile, tarball, source rpms, and rpms with `make rpm`,
without separate sub-targets. We can reintroduce them if they're needed
somewhere.

Also remove the `check-working-directory` target. It should be clear
from the output that only the currently-committed files are included,
because the resulting tarball and rpms contain the commit hash. Without
the check, one can work on the Makefile without having to commit all the
time, for example ;)
This commit is contained in:
Lars Karlitski 2020-03-04 21:03:07 +01:00 committed by Tom Gundersen
parent 44889842bd
commit 132554d015
2 changed files with 16 additions and 34 deletions

2
.gitignore vendored
View file

@ -11,6 +11,4 @@ __pycache__
/*.tar.gz
/*.src.rpm
/build
/rpmbuild
/output