forked from xiph/opusfile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This one meets or exceeds the following requirements: - Version is checked/updated for every build action when in the git repo. Does not require the user to re- ./configure to get the correct version. - Version is not updated automatically when using exported tarball source. Avoids accidentally getting a wrong version from some other git repo in a parent directory of the source, and allows setting the correct version for distro package exports. - Automatic updating can be manually suppressed. For developers doing lots of change/rebuild cycles they don't plan to release, when they don't want a full rebuild triggered for every commit, and again for every change made immediately after a commit. The version will still always be updated if they do a `make dist`. - Does not require any manual updating of versions in the mainline git repo for each release aside from normal tagging. The version is recorded in one file only, that is automatically generated and will never need to be committed. - Does not require gnu-make features for the autoconf builds. It does not currently: - Keep a checksum of every source file in tarball releases to mangle the version if people modify the tarball source. Responsible people can manually update the version easily though in such cases.
- Loading branch information
Ron
committed
May 13, 2013
1 parent
4986154
commit ff86866
Showing
12 changed files
with
141 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.gitignore export-ignore | ||
.gitattributes export-ignore | ||
|
||
update_version export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
# autoconf source script for generating configure | ||
|
||
AC_INIT([opusfile], m4_esyscmd([doc/git-version.sh])) | ||
dnl The package_version file will be automatically synced to the git revision | ||
dnl by the update_version script when configured in the repository, but will | ||
dnl remain constant in tarball releases unless it is manually edited. | ||
m4_define([CURRENT_VERSION], | ||
m4_esyscmd_s([ if test -e package_version || ./update_version; then | ||
. ./package_version | ||
printf "$PACKAGE_VERSION" | ||
else | ||
printf "unknown" | ||
fi ])) | ||
|
||
AC_INIT([opusfile],[CURRENT_VERSION],[[email protected]]) | ||
AC_CONFIG_SRCDIR([src/opusfile.c]) | ||
|
||
AC_USE_SYSTEM_EXTENSIONS | ||
AC_SYS_LARGEFILE | ||
|
||
AM_INIT_AUTOMAKE([1.11 foreign]) | ||
AM_INIT_AUTOMAKE([1.11 foreign no-define]) | ||
AM_MAINTAINER_MODE([enable]) | ||
LT_INIT | ||
|
||
|
@@ -130,18 +142,19 @@ if test "$HAVE_DOXYGEN" != "yes" -o "$enable_doc" != "yes" ; then | |
fi | ||
AM_CONDITIONAL(HAVE_DOXYGEN, [test $HAVE_DOXYGEN = yes]) | ||
|
||
AC_OUTPUT([ | ||
AC_CONFIG_FILES([ | ||
Makefile | ||
opusfile.pc | ||
opusurl.pc | ||
opusfile-uninstalled.pc | ||
opusurl-uninstalled.pc | ||
doc/Doxyfile | ||
]) | ||
AC_OUTPUT | ||
|
||
AC_MSG_NOTICE([ | ||
------------------------------------------------------------------------ | ||
$PACKAGE $VERSION: Automatic configuration OK. | ||
$PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK. | ||
Assertions ................... ${enable_assertions} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
|
||
# Creates and updates the package_version information used by configure.ac | ||
# (or other makefiles). When run inside a git repository it will use the | ||
# version information that can be queried from it unless AUTO_UPDATE is set | ||
# to 'no'. If no version is currently known it will be set to 'unknown'. | ||
# | ||
# If called with the argument 'release', the PACKAGE_VERSION will be updated | ||
# even if AUTO_UPDATE=no, but the value of AUTO_UPDATE shall be preserved. | ||
# This is used to force a version update whenever `make dist` is run. | ||
# | ||
# The exit status is 1 if package_version is not modified, else 0 is returned. | ||
# | ||
# This script should NOT be included in distributed tarballs, because if a | ||
# parent directory contains a git repository we do not want to accidentally | ||
# retrieve the version information from it instead. Tarballs should ship | ||
# with only the package_version file. | ||
# | ||
# Ron <[email protected]>, 2012. | ||
|
||
SRCDIR=$(dirname $0) | ||
|
||
if [ -e "$SRCDIR/package_version" ]; then | ||
. "$SRCDIR/package_version" | ||
fi | ||
|
||
if [ "$AUTO_UPDATE" = no ]; then | ||
[ "$1" = release ] || exit 1 | ||
else | ||
AUTO_UPDATE=yes | ||
fi | ||
|
||
# We run `git status` before describe here to ensure that we don't get a false | ||
# -dirty from files that have been touched but are not actually altered in the | ||
# working dir. | ||
GIT_VERSION=$(cd "$SRCDIR" && git status > /dev/null 2>&1 \ | ||
&& git describe --tags --match 'v*' --dirty 2> /dev/null) | ||
GIT_VERSION=${GIT_VERSION#v} | ||
|
||
if [ -n "$GIT_VERSION" ]; then | ||
|
||
[ "$GIT_VERSION" != "$PACKAGE_VERSION" ] || exit 1 | ||
PACKAGE_VERSION="$GIT_VERSION" | ||
|
||
elif [ -z "$PACKAGE_VERSION" ]; then | ||
# No current package_version and no git ... | ||
# We really shouldn't ever get here, because this script should only be | ||
# included in the git repository, and should usually be export-ignored. | ||
PACKAGE_VERSION="unknown" | ||
else | ||
exit 1 | ||
fi | ||
|
||
cat > "$SRCDIR/package_version" <<-EOF | ||
# Automatically generated by update_version. | ||
# This file may be sourced into a shell script or makefile. | ||
# Set this to 'no' if you do not wish the version information | ||
# to be checked and updated for every build. Most people will | ||
# never want to change this, it is an option for developers | ||
# making frequent changes that they know will not be released. | ||
AUTO_UPDATE=$AUTO_UPDATE | ||
PACKAGE_VERSION="$PACKAGE_VERSION" | ||
EOF |