Use 'make dist' instead of 'git archive' to create a release or snapshot tarball.

This commit is contained in:
Nathan Phillip Brink 2011-09-13 02:55:17 +00:00 committed by Pierre-Louis Bonicoli
parent 84fa6c7eb0
commit 7e1c80a65a
6 changed files with 69 additions and 37 deletions

View File

@ -1,5 +1,15 @@
bin_PROGRAMS = src/bip src/bipmkpw bin_PROGRAMS = src/bip src/bipmkpw
src_bip_SOURCES = src/conf.y src/lex.l src/bip.c src/connection.c src/irc.c src/line.c src/log.c src/md5.c src/util.c src_bip_SOURCES = src/conf.y src/lex.l \
src/bip.c src/bip.h \
src/connection.c src/connection.h \
src/defaults.h \
src/irc.c src/irc.h \
src/line.c src/line.h \
src/log.c src/log.h \
src/md5.c src/md5.h \
src/moduli.h \
src/tuple.h \
src/util.c src/util.h
src_bipmkpw_SOURCES = src/bipmkpw.c src/md5.c src/util.c src_bipmkpw_SOURCES = src/bipmkpw.c src/md5.c src/util.c
AM_YFLAGS= -d AM_YFLAGS= -d
BUILT_SOURCES = src/conf.c src/conf.h src/lex.c BUILT_SOURCES = src/conf.c src/conf.h src/lex.c
@ -11,7 +21,12 @@ else
endif endif
man_MANS = bip.1 bip.conf.5 dist_man_MANS = bip.1 bip.conf.5 bipmkpw.1
examplesdir = $(prefix)/share/doc/bip/examples/ examplesdir = $(prefix)/share/doc/bip/examples/
examples_DATA = samples/bip.conf samples/bip.vim dist_examples_DATA = samples/bip.conf samples/bip.vim
EXTRA_DIST = \
BUGS \
scripts/bip-release \
scripts/bipgenconfig

View File

@ -1,5 +1,5 @@
AC_PREREQ([2.64]) AC_PREREQ([2.64])
AC_INIT([bip], [0.8.2], [nohar@t1r.net]) AC_INIT([bip], [0.8.8-git], [http://bip.milkypond.org/projects/bip/activity], [Bip Sexy IRC Proxy], [http://bip.milkypond.org/])
AM_INIT_AUTOMAKE([subdir-objects]) AM_INIT_AUTOMAKE([subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_CONFIG_SRCDIR([src/bip.h]) AC_CONFIG_SRCDIR([src/bip.h])

View File

@ -8,35 +8,55 @@ if [ ! -d src ] ; then
fi fi
release="$1" release="$1"
: ${MAKEOPTS:=-j -l4}
if [ -n "$release" ] set_version() {
then local release
git log > ChangeLog release="${1}"
echo '#define BIP_VERSION "'$release'"' > src/version.h sed -i -e '/^AC_INIT/s/\(, \[\)[^]]*/\1'${release}'/' configure.ac
git commit -a -m "Update src/version.h and Changelog for release." }
get_version() {
grep -e '^AC_INIT' configure.ac | cut -d [ -f 3 | cut -d ] -f 1
}
make_distcheck() {
if ! make ${MAKEOPTS} distcheck; then
echo "'make distcheck' fails, please try again." >&2
return 1
else
true
fi
}
git log > ChangeLog
if [ -n "$release" ]; then
set_version "${release}"
make_distcheck || exit 1
git commit -a -m "Update version and ChangeLog for bip-${release} release."
git tag release-$release git tag release-$release
prefix=bip-$release
else
prefix=bip-$(date +%y%m%d)
fi
olddir=$(pwd) set_version "${release}-git"
tmpdir=$(mktemp -d /var/tmp/bip-XXXXXX)
git archive --format=tar --prefix=$prefix/ HEAD > $tmpdir/$prefix.tar
cd $tmpdir
tar xf $prefix.tar
cd $prefix
./bootstrap
rm -rf autom4te.cache
cd ..
tar czf $olddir/../$prefix.tar.gz $prefix
cd $olddir
rm -rf $tmpdir
echo "See ../$prefix.tar.gz"
if [ -n "$release" ]
then
echo '#define BIP_VERSION "'$release'-git"' > src/version.h
git commit -a -m "Add -git to version string." git commit -a -m "Add -git to version string."
fi
echo "See bip-${release}.tar.gz"
else
make_distcheck || exit 1
tarname=bip-$(get_version)
prefix=bip-$(date +%y%m%d)
rm -rf "${tarname}" "${prefix}"
tar -xzf "${tarname}".tar.gz
rm -rf "${tarname}".tar.gz
mv "${tarname}" "${prefix}"
tar -czf "${prefix}".tar.gz "${prefix}"
rm -rf "${prefix}"
# Revert the ChangeLog.
git checkout HEAD -- ChangeLog
echo "See ${prefix}.tar.gz"
fi

View File

@ -29,7 +29,6 @@
#include "log.h" #include "log.h"
#include "bip.h" #include "bip.h"
#include "line.h" #include "line.h"
#include "version.h"
#include "defaults.h" #include "defaults.h"
int sighup = 0; int sighup = 0;
@ -277,9 +276,9 @@ static void usage(char *name)
static void version() static void version()
{ {
printf( printf(
"Bip IRC Proxy - %s\n" "Bip IRC Proxy - " PACKAGE_VERSION "\n"
"Copyright © Arnaud Cornet and Loïc Gomez (2004 - 2008)\n" "Copyright © Arnaud Cornet and Loïc Gomez (2004 - 2008)\n"
"Distributed under the GNU Public License Version 2\n", BIP_VERSION); "Distributed under the GNU Public License Version 2\n");
} }
bip_t *_bip; bip_t *_bip;

View File

@ -22,7 +22,6 @@
#include "log.h" #include "log.h"
#include "connection.h" #include "connection.h"
#include "md5.h" #include "md5.h"
#include "version.h"
#define S_CONN_DELAY (10) #define S_CONN_DELAY (10)
@ -1836,7 +1835,7 @@ static void irc_privmsg_check_ctcp(struct link_server *server,
nick = nick_from_ircmask(line->origin); nick = nick_from_ircmask(line->origin);
if (irc_line_elem_equals(line, 2, "\001VERSION\001")) { if (irc_line_elem_equals(line, 2, "\001VERSION\001")) {
WRITE_LINE2(CONN(server), NULL, "NOTICE", nick, WRITE_LINE2(CONN(server), NULL, "NOTICE", nick,
"\001VERSION bip-" BIP_VERSION "\001"); "\001VERSION bip-" PACKAGE_VERSION "\001");
} }
free(nick); free(nick);
} }

View File

@ -1 +0,0 @@
#define BIP_VERSION "0.8.8-git"