diff --git a/.gitignore b/.gitignore index d0c379a30..176a54ac5 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ gtk/po/*.mo gtk/transmission-gtk libtransmission/*.a libtransmission/.depend +libtransmission/version.h macosx/English.lproj/*~.nib macosx/Info.plist macosx/Transmission.app diff --git a/Makefile b/Makefile index eedb7fd9c..aa518d6f1 100644 --- a/Makefile +++ b/Makefile @@ -99,8 +99,18 @@ package-release: endif -Makefile.version: .version +.version: .version1 .version2 -.version: +.version1: @echo "Checking SVN revision..." @./version.sh + +.version2: + @$(RM) libtransmission/version.h + @( echo "#define VERSION_MAJOR $(VERSION_MAJOR)" && \ + echo "#define VERSION_MINOR $(VERSION_MINOR)" && \ + echo "#define VERSION_STRING \"$(VERSION_STRING)\"" && \ + echo "#define VERSION_REVISION $(VERSION_REVISION)" ) > \ + libtransmission/version.h + +Makefile.version: .version1 diff --git a/Makefile.common b/Makefile.common index b3a749c74..65e9f6499 100644 --- a/Makefile.common +++ b/Makefile.common @@ -2,13 +2,10 @@ VERSION_MAJOR = 0 VERSION_MINOR = 5 -VERSION_STRING = 0.6-svn-r$(SVN_REVISION) +VERSION_STRING = 0.6-svn TMPCFLAGS = -g -Wall -W -O3 -funroll-loops -D_FILE_OFFSET_BITS=64 \ -D_LARGEFILE_SOURCE -D_GNU_SOURCE \ - -DVERSION_MAJOR=$(VERSION_MAJOR) \ - -DVERSION_MINOR=$(VERSION_MINOR) \ - -DVERSION_STRING=\"$(VERSION_STRING)\" \ -DSYS_$(shell echo $(SYSTEM) | tr a-z A-Z) TMPCXXFLAGS = $(TMPCFLAGS) TMPLDFLAGS = diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index b3596f303..3b0f91fb2 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -637,14 +637,10 @@ "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-D_GNU_SOURCE", - "-DVERSION_MAJOR=0", - "-DVERSION_MINOR=5", - "$(OTHER_CFLAGS_QUOTED_1)", "-DSYS_DARWIN", "-DHAVE_OPENSSL", "-D__TRANSMISSION__", ); - OTHER_CFLAGS_QUOTED_1 = "-DVERSION_STRING=\\\"0.6-svn\\\""; PRODUCT_NAME = transmission; }; name = Debug; @@ -658,14 +654,10 @@ "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-D_GNU_SOURCE", - "-DVERSION_MAJOR=0", - "-DVERSION_MINOR=5", - "$(OTHER_CFLAGS_QUOTED_1)", "-DSYS_DARWIN", "-DHAVE_OPENSSL", "-D__TRANSMISSION__", ); - OTHER_CFLAGS_QUOTED_1 = "-DVERSION_STRING=\\\"0.6-svn\\\""; PRODUCT_NAME = transmissioncli; }; name = Debug; diff --git a/cli/transmissioncli.c b/cli/transmissioncli.c index 7bb0a4133..3b080d747 100644 --- a/cli/transmissioncli.c +++ b/cli/transmissioncli.c @@ -68,8 +68,8 @@ int main( int argc, char ** argv ) tr_torrent_t * tor; tr_stat_t * s; - printf( "Transmission %s - http://transmission.m0k.org/\n\n", - VERSION_STRING ); + printf( "Transmission %s (%d) - http://transmission.m0k.org/\n\n", + VERSION_STRING, VERSION_REVISION ); /* Get options */ if( parseCommandLine( argc, argv ) ) diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 75cd22293..4a1c6df18 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -29,6 +29,8 @@ extern "C" { #endif +#include "version.h" + #include #ifndef PRIu64 # define PRIu64 "lld" diff --git a/macosx/Info.plist.in b/macosx/Info.plist.in index 1bcb9918b..d30c8719f 100644 --- a/macosx/Info.plist.in +++ b/macosx/Info.plist.in @@ -36,9 +36,9 @@ CFBundleSignature TR## CFBundleVersion - %%VERSION%% + %%BUNDLE_VERSION%% CFBundleShortVersionString - %%VERSION%% + %%SHORT_VERSION_STRING%% NSMainNibFile MainMenu NSPrincipalClass diff --git a/macosx/Makefile b/macosx/Makefile index 0b2abb1b9..bb69466f9 100644 --- a/macosx/Makefile +++ b/macosx/Makefile @@ -6,7 +6,8 @@ include ../Makefile.common Info.plist: Info.plist.in ../Makefile.version ../Makefile.common $(RM) $@ - sed "s/%%VERSION%%/$(VERSION_STRING)/g" < $< > $@ + sed -e "s/%%BUNDLE_VERSION%%/$(VERSION_REVISION)/g" \ + -e "s/%%SHORT_VERSION_STRING%%/$(VERSION_STRING)/g" < $< > $@ clean: $(RM) Info.plist diff --git a/version.sh b/version.sh index 101eba968..defa4a049 100755 --- a/version.sh +++ b/version.sh @@ -16,6 +16,6 @@ for pattern in '*.[chm]' '*.cpp' '*.po' 'Makefile*' 'configure'; do done rm -f Makefile.version -echo "SVN_REVISION = $REVMAX" > Makefile.version +echo "VERSION_REVISION = $REVMAX" > Makefile.version exit 0