mirror-cockpit-project-cockpit/autogen.sh

24 lines
495 B
Bash
Raw Normal View History

2013-11-01 09:42:29 -08:00
#!/bin/sh
set -eu
2013-11-01 09:42:29 -08:00
srcdir="${0%/*}"
2013-11-01 09:42:29 -08:00
build: change approach to versioning Currently, we choose the version number that we use at the time that ./autogen.sh is first run. That means that if you configure your tree and hack on it for a while, making commits as you go, the overly-specific version number will soon be out of date. This version number is the number used when building tarballs for testing. Even switching to old branches on previous versions can result in the version number not being updated. Let's move to automake's suggested approach[1] to dynamic versioning by introducing a `version.m4` file. We write that file from two places: - `./autogen.sh` writes an approximate version number (the last release) appended by +git (eg. "270+git") - from `make dist` we write the value we find in `$(VERSION)` and call autoreconf to update the configure script accordingly The expectation is now that anyone who calls `make dist` should specify the VERSION explicitly. That's two places: - from `tools/make-dist` we specify the full `git describe` style version - from the release workflow we specify the tag name Since the only thing that uses `make dump-dist` anymore is `tools/make-dist`, and since it now provides its own version number, we can drop the rule and print the filename directly. Since we move to `version.m4`-style versioning, our tarballs will no longer contain the `.tarball` file. Finally, since we're going to end up having more tarballs created, with various version numbers, add `cockpit-*.tar.xz` to `CLEANFILES` to help keep things under control. [1] https://www.gnu.org/software/automake/manual/html_node/Rebuilding.html
2022-06-01 00:03:30 -08:00
(
cd "${srcdir}"
echo "m4_define(VERSION_NUMBER, [$(git describe --tags --abbrev=0)+git])" > version.m4
autoreconf -i --warnings obsolete
build: change approach to versioning Currently, we choose the version number that we use at the time that ./autogen.sh is first run. That means that if you configure your tree and hack on it for a while, making commits as you go, the overly-specific version number will soon be out of date. This version number is the number used when building tarballs for testing. Even switching to old branches on previous versions can result in the version number not being updated. Let's move to automake's suggested approach[1] to dynamic versioning by introducing a `version.m4` file. We write that file from two places: - `./autogen.sh` writes an approximate version number (the last release) appended by +git (eg. "270+git") - from `make dist` we write the value we find in `$(VERSION)` and call autoreconf to update the configure script accordingly The expectation is now that anyone who calls `make dist` should specify the VERSION explicitly. That's two places: - from `tools/make-dist` we specify the full `git describe` style version - from the release workflow we specify the tag name Since the only thing that uses `make dump-dist` anymore is `tools/make-dist`, and since it now provides its own version number, we can drop the rule and print the filename directly. Since we move to `version.m4`-style versioning, our tarballs will no longer contain the `.tarball` file. Finally, since we're going to end up having more tarballs created, with various version numbers, add `cockpit-*.tar.xz` to `CLEANFILES` to help keep things under control. [1] https://www.gnu.org/software/automake/manual/html_node/Rebuilding.html
2022-06-01 00:03:30 -08:00
)
[ -n "${NOCONFIGURE:-}" ] && exit
2013-11-01 09:42:29 -08:00
case "${1:-}" in
rpm)
# configure with the same flags as when building an RPM
exec rpmbuild -D '_topdir tmp/rpmbuild' -D 'make_build #' \
--build-in-place -bc tools/cockpit.spec ;;
*)
exec "${srcdir}/configure" "$@" ;;
esac