Skip to content

Commit

Permalink
Plumbing for git instead of svn
Browse files Browse the repository at this point in the history
Use git tags for version numbers
  • Loading branch information
philpennock committed Apr 22, 2013
1 parent eb940ae commit d843bb5
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 26 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sieve-connect.pl
sieve-connect
datefile
versionfile
ChangeLog
39 changes: 21 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ RM=rm
# These you probably don't want to adjust
SCRIPTNAME=sieve-connect
MANPAGE=sieve-connect.1
SCRIPTSRC=sieve-connect.pl
SCRIPTSRC=sieve-connect.pre.pl
SCRIPTDIST=sieve-connect.pl
TARPREFIX=sieve-connect
DISTFILES=$(SCRIPTSRC) $(MANPAGE) ChangeLog Makefile README LICENSE TODO find-perl58.sh
DISTFILES=$(SCRIPTDIST) $(MANPAGE) ChangeLog Makefile README LICENSE TODO find-perl58.sh
GPG=gpg
PGPSIGNKEY=0x3903637F

TARVERSIONMAJ=0
# Set this to .N if not dealing with first release based on a given svn version
TARVERSIONPATCH=

# ======================================================================
# Targets for builders/installers

Expand All @@ -43,8 +40,8 @@ install-bin: $(SCRIPTNAME)
install-man:
$(INSTALLPROG) -m $(MANPERM) $(INSTALLARGS) $(MANPAGE) $(INSTALLROOT)$(PREFIX)/$(MANDIR)/$(MANSECTDIR)

bin $(SCRIPTNAME): $(SCRIPTSRC)
$(SED) <"$(SCRIPTSRC)" >"$(SCRIPTNAME)" "1s:/.*:$(PERL5BIN):"
bin $(SCRIPTNAME): $(SCRIPTDIST)
$(SED) <"$(SCRIPTDIST)" >"$(SCRIPTNAME)" "1s:/.*:$(PERL5BIN):"
$(CHMOD) +x "$(SCRIPTNAME)"

clean:
Expand All @@ -55,6 +52,14 @@ clean:

dist: tarball pgpsig

$(SCRIPTDIST): $(SCRIPTSRC) versionfile
perl -MFile::Slurp -p < $(SCRIPTSRC) > $(SCRIPTDIST) -e ' \
BEGIN { $$newver = read_file("versionfile"); chomp $$newver; }; \
next unless /VERSION.*MAGIC LINE REPLACED IN DISTRIBUTION/; \
$$_ = qq{our \$$VERSION = '"'"'$$newver'"'"';\n}; \
'
chmod +x $(SCRIPTDIST)

# This can use non-portable commands, so shove into subdir
tarball: $(DISTFILES) versionfile
pax -w -s ",^,$(TARPREFIX)-`cat versionfile`/," $(DISTFILES) > $(TARPREFIX)-`cat versionfile`.tar
Expand All @@ -63,20 +68,18 @@ tarball: $(DISTFILES) versionfile
pgpsig: tarball versionfile
$(GPG) -a --detach-sign --default-key $(PGPSIGNKEY) $(TARPREFIX)-`cat versionfile`.tar.bz2

man $(MANPAGE): $(SCRIPTSRC) datefile versionfile
pod2man -n "$(SCRIPTNAME)" -c '' -d "`cat datefile`" -r "`cat versionfile`" "$(SCRIPTSRC)" >"$(MANPAGE)"
man $(MANPAGE): $(SCRIPTDIST) datefile versionfile
pod2man -n "$(SCRIPTNAME)" -c '' -d "`cat datefile`" -r "`cat versionfile`" "$(SCRIPTDIST)" >"$(MANPAGE)"

# filter is against spammers (see README)
ChangeLog: .svn/wc.db
TZ='' svn log | sed '/^r[0-9]/s/|[^|]*|/| XXX |/' > ChangeLog
ChangeLog: .git/HEAD
TZ='' git log | sed '/^Author:/s/ <.*//' > ChangeLog

# NB: Id tag is already in zulu time, so no problem with program itself
datefile versionfile: .svn/wc.db
datefile versionfile: .git/HEAD
@grep -q "Copyright.*\\<`date +%Y`" $(SCRIPTSRC) || { echo "Current year not in $(SCRIPTSRC) Copyright line"; false; }
@grep -q "Copyright.*\\<`date +%Y`" LICENSE || { echo "Current year not in LICENSE Copyright line"; false; }
TZ='' svn up
TZ='' svn info | sed -n "s/^Revision: \(.*\)/$(TARVERSIONMAJ).\1$(TARVERSIONPATCH)/p" > versionfile
TZ='' svn info | sed -n 's/^Last Changed Date: \([^ ]*\) .*/\1/p' >datefile
TZ='' git describe --match 'v[0-9]*' --dirty=-XX | sed -n 's/^v//p' > versionfile
TZ='' git show -s --format=%ci HEAD | cut -d ' ' -f 1 > datefile

distclean: clean
$(RM) -f "./$(MANPAGE)" ./ChangeLog ./versionfile ./datefile
$(RM) -f "./$(MANPAGE)" ./ChangeLog ./versionfile ./datefile ./$(SCRIPTDIST)
16 changes: 16 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@ verify the key then attend a PGP keysigning party. It's where all the,
uhm, uncool people are. No, wait wait! The _cool_ people. That's it.
Yeah. *cough*

Up to (and including) v0.85, the release version was just the number of the
svn commit, so there would be gaps in release numbers. After that release,
the source moved to Git for revision control, and release numbers are
sequential, with gaps for major occurances (such as a v1.0, one day).


Revision Control
================

sieve-connect uses Git for revision control. The public-facing canonical repo
is currently GitHub, with the authoritative repository being:

https://github.com/syscomet/sieve-connect

Pull-requests, etc, are accepted there.


RFCs
====
Expand Down
9 changes: 1 addition & 8 deletions sieve-connect.pl → sieve-connect.pre.pl
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,7 @@
# ######################################################################
# No user-serviceable parts below

our $VERSION = 0;
my $svn_revision = '$Revision$';
if ($svn_revision =~ /^.Revision:\s*(\d+)\s*\$\z/) {
$svn_revision = $1;
$VERSION = '0.' . $1;
} else {
$svn_revision = '0 because unknown';
}
our $VERSION = 0; # MAGIC LINE REPLACED IN DISTRIBUTION

use Authen::SASL 2.11 qw(Perl);
# 2.11: first version with non-broken DIGEST-MD5
Expand Down

0 comments on commit d843bb5

Please sign in to comment.