diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..beaee22 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +sieve-connect.pl +sieve-connect +datefile +versionfile +ChangeLog diff --git a/Makefile b/Makefile index d985df5..49ef120 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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: @@ -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 @@ -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) diff --git a/README b/README index b322ab8..a432b69 100644 --- a/README +++ b/README @@ -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 ==== diff --git a/sieve-connect.pl b/sieve-connect.pre.pl similarity index 99% rename from sieve-connect.pl rename to sieve-connect.pre.pl index dad6b23..83c5fe5 100755 --- a/sieve-connect.pl +++ b/sieve-connect.pre.pl @@ -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