summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/texi/Building.linux.texi4
-rw-r--r--doc/texi/base/handbrake.texi.m44
-rw-r--r--doc/texi/building/appendix.repo.texi4
-rw-r--r--doc/texi/building/chapter.via.terminal.texi2
-rw-r--r--doc/texi/building/command.texi2
-rw-r--r--doc/texi/building/prerequisites.common.texi2
-rw-r--r--libhb/hb.c60
-rw-r--r--libhb/hb.h3
-rw-r--r--libhb/project.h.m410
-rw-r--r--make/configure.py152
-rw-r--r--make/include/tool.defs1
-rw-r--r--pkg/linux/module.defs35
-rw-r--r--pkg/linux/module.rules42
-rw-r--r--pkg/module.rules5
-rwxr-xr-xscripts/repo-info.sh67
-rwxr-xr-xscripts/tag-release.sh86
-rw-r--r--test/test.c10
17 files changed, 366 insertions, 123 deletions
diff --git a/doc/texi/Building.linux.texi b/doc/texi/Building.linux.texi
index ddab914ab..015f013e1 100644
--- a/doc/texi/Building.linux.texi
+++ b/doc/texi/Building.linux.texi
@@ -33,7 +33,7 @@ The @b{GTK UI} introduces some significant extra build requirements. GTK version
Ubuntu 14.04 packages:
@itemize @bullet
-@item subversion (cli/gui)
+@item git (cli/gui)
@item cmake (cli/gui)
@item yasm (cli/gui)
@item build-essential (cli/gui)
@@ -67,7 +67,7 @@ Ubuntu 14.04 packages:
To install these packages:
@example
-sudo apt-get install subversion cmake yasm build-essential autoconf libtool \
+sudo apt-get install git cmake yasm build-essential autoconf libtool \
zlib1g-dev libbz2-dev libogg-dev libtheora-dev libvorbis-dev \
libsamplerate-dev libxml2-dev libfribidi-dev libfreetype6-dev \
libfontconfig1-dev libass-dev libmp3lame-dev libx264-dev libjansson-dev \
diff --git a/doc/texi/base/handbrake.texi.m4 b/doc/texi/base/handbrake.texi.m4
index 1367c4d58..099e7f78f 100644
--- a/doc/texi/base/handbrake.texi.m4
+++ b/doc/texi/base/handbrake.texi.m4
@@ -20,10 +20,10 @@ dnl
@set HB-version-hex __HB_version_hex
@set HB-build __HB_build
@set HB-repo-url __HB_repo_url
-@set HB-repo-root __HB_repo_root
@set HB-repo-branch __HB_repo_branch
-@set HB-repo-uuid __HB_repo_uuid
+@set HB-repo-tag __HB_repo_tag
@set HB-repo-rev __HB_repo_rev
+@set HB-repo-hash __HB_repo_hash
@set HB-repo-date __HB_repo_date
@set HB-repo-official __HB_repo_official
@set HB-repo-type __HB_repo_type
diff --git a/doc/texi/building/appendix.repo.texi b/doc/texi/building/appendix.repo.texi
index ea7bf2d8a..59b501ed0 100644
--- a/doc/texi/building/appendix.repo.texi
+++ b/doc/texi/building/appendix.repo.texi
@@ -1,10 +1,10 @@
@appendix Project Repository Details
@example
url: @value{HB-repo-url}
-root: @value{HB-repo-root}
branch: @value{HB-repo-branch}
-uuid: @value{HB-repo-uuid}
+tag: @value{HB-repo-tag}
rev: @value{HB-repo-rev}
+hash: @value{HB-repo-hash}
date: @value{HB-repo-date}
type: @value{HB-repo-type}
@end example
diff --git a/doc/texi/building/chapter.via.terminal.texi b/doc/texi/building/chapter.via.terminal.texi
index b5c61eb38..b98301b66 100644
--- a/doc/texi/building/chapter.via.terminal.texi
+++ b/doc/texi/building/chapter.via.terminal.texi
@@ -62,7 +62,7 @@ Clean-room procedures dictate that when certain factors change, old builds shoul
@itemize
@item configure with different options
-@item subversion working dir is updated and you want configure to re-evaluate working dir metadata.
+@item git working dir is updated and you want configure to re-evaluate working dir metadata.
@item build corruption is suspected
@end itemize
diff --git a/doc/texi/building/command.texi b/doc/texi/building/command.texi
index fedb58188..cd97764c0 100644
--- a/doc/texi/building/command.texi
+++ b/doc/texi/building/command.texi
@@ -1,4 +1,4 @@
@macro COMMAND-checkout{}
-svn checkout @value{HB-repo-url} @value{HB-acro-lower}-@value{HB-repo-branch}
+git clone @value{HB-repo-url} @value{HB-acro-lower}-@value{HB-repo-branch}
cd @value{HB-acro-lower}-@value{HB-repo-branch}
@end macro
diff --git a/doc/texi/building/prerequisites.common.texi b/doc/texi/building/prerequisites.common.texi
index 64c21fd38..30b1621f1 100644
--- a/doc/texi/building/prerequisites.common.texi
+++ b/doc/texi/building/prerequisites.common.texi
@@ -1,7 +1,7 @@
The following general tools are used on various platforms and it is recommended you use these versions or similar:
@itemize @bullet
-@item subversion - 1.6.16
+@item git - 2.4.3
@item python - Python 2.7.1
@item curl - curl 7.21.4 (or wget)
@item m4 - GNU M4 1.4.6
diff --git a/libhb/hb.c b/libhb/hb.c
index e8418e741..2f4a71720 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -460,14 +460,68 @@ hb_handle_t * hb_init( int verbose, int update_check )
return h;
}
+// Make sure these strings at least exist in the executable even though
+// they may not all be visible in the frontend.
+static const char* hb_title = HB_PROJECT_TITLE;
+static const char* hb_name = HB_PROJECT_NAME;
+static const char* hb_website = HB_PROJECT_URL_WEBSITE;
+static const char* hb_community = HB_PROJECT_URL_COMMUNITY;
+static const char* hb_irc = HB_PROJECT_URL_IRC;
+static const char* hb_version = HB_PROJECT_VERSION;
+static const int hb_build = HB_PROJECT_BUILD;
+static const char* hb_repo_url = HB_PROJECT_REPO_URL;
+static const char* hb_repo_tag = HB_PROJECT_REPO_TAG;
+static const int hb_repo_rev = HB_PROJECT_REPO_REV;
+static const char* hb_repo_hash = HB_PROJECT_REPO_HASH;
+static const char* hb_repo_branch = HB_PROJECT_REPO_BRANCH;
+static const char* hb_repo_remote = HB_PROJECT_REPO_REMOTE;
+static const char* hb_repo_type = HB_PROJECT_REPO_TYPE;
+
+const char * hb_get_full_description()
+{
+ static char * desc = NULL;
+ if (desc == NULL)
+ {
+ desc = hb_strdup_printf("%s\n"
+ "\tWebsite: %s\n"
+ "\tForum: %s\n"
+ "\tIRC: %s\n"
+ "\tBuild Type: %s\n"
+ "\tRepository: %s\n"
+ "\tRelease Tag: %s\n"
+ "\tRevision: %d\n"
+ "\tCommit Hash: %s\n"
+ "\tBranch: %s\n"
+ "\tRemote: %s",
+ hb_title, hb_website, hb_community, hb_irc,
+ hb_repo_type, hb_repo_url, hb_repo_tag, hb_repo_rev,
+ hb_repo_hash, hb_repo_branch, hb_repo_remote);
+ }
+ return desc;
+}
+
/**
* Returns current version of libhb.
* @param h Handle to hb_handle_t.
* @return character array of version number.
*/
-char * hb_get_version( hb_handle_t * h )
+const char * hb_get_version( hb_handle_t * h )
{
- return HB_PROJECT_VERSION;
+ // Silence compiler warnings for unused variables
+ ((void)(hb_title));
+ ((void)(hb_name));
+ ((void)(hb_website));
+ ((void)(hb_community));
+ ((void)(hb_irc));
+ ((void)(hb_version));
+ ((void)(hb_repo_url));
+ ((void)(hb_repo_tag));
+ ((void)(hb_repo_rev));
+ ((void)(hb_repo_hash));
+ ((void)(hb_repo_branch));
+ ((void)(hb_repo_remote));
+ ((void)(hb_repo_type));
+ return hb_version;
}
/**
@@ -477,7 +531,7 @@ char * hb_get_version( hb_handle_t * h )
*/
int hb_get_build( hb_handle_t * h )
{
- return HB_PROJECT_BUILD;
+ return hb_build;
}
/**
diff --git a/libhb/hb.h b/libhb/hb.h
index cbf25f712..c8101ed68 100644
--- a/libhb/hb.h
+++ b/libhb/hb.h
@@ -39,7 +39,8 @@ int hb_hwd_enabled( hb_handle_t *h );
hb_hwd_t * hb_hwd_get_context();
/* hb_get_version() */
-char * hb_get_version( hb_handle_t * );
+const char * hb_get_full_description();
+const char * hb_get_version( hb_handle_t * );
int hb_get_build( hb_handle_t * );
/* hb_check_update()
diff --git a/libhb/project.h.m4 b/libhb/project.h.m4
index 7e70b5b36..ae54f255c 100644
--- a/libhb/project.h.m4
+++ b/libhb/project.h.m4
@@ -21,12 +21,14 @@ dnl
<<#>>define HB_PROJECT_VERSION_HEX 0x<<>>__HB_version_hex<<>>LL
<<#>>define HB_PROJECT_BUILD __HB_build
<<#>>define HB_PROJECT_REPO_URL "__HB_repo_url"
-<<#>>define HB_PROJECT_REPO_ROOT "__HB_repo_root"
-<<#>>define HB_PROJECT_REPO_UUID "__HB_repo_uuid"
+<<#>>define HB_PROJECT_REPO_TAG "__HB_repo_tag"
<<#>>define HB_PROJECT_REPO_REV __HB_repo_rev
-<<#>>define HB_PROJECT_REPO_DATE "__HB_repo_date"
-<<#>>define HB_PROJECT_REPO_OFFICIAL __HB_repo_official
+<<#>>define HB_PROJECT_REPO_HASH "__HB_repo_hash"
+<<#>>define HB_PROJECT_REPO_BRANCH "__HB_repo_branch"
+<<#>>define HB_PROJECT_REPO_REMOTE "__HB_repo_remote"
<<#>>define HB_PROJECT_REPO_TYPE "__HB_repo_type"
+<<#>>define HB_PROJECT_REPO_OFFICIAL __HB_repo_official
+<<#>>define HB_PROJECT_REPO_DATE "__HB_repo_date"
<<#>>define HB_PROJECT_BUILD_SPEC "__BUILD_spec"
<<#>>define HB_PROJECT_BUILD_MACHINE "__BUILD_machine"
diff --git a/make/configure.py b/make/configure.py
index 5f35ed4a6..7976a03c5 100644
--- a/make/configure.py
+++ b/make/configure.py
@@ -159,12 +159,12 @@ class Configure( object ):
if os.access( name, os.X_OK ):
return name
return None
-
+
if not os.environ.has_key( 'PATH' ) or os.environ[ 'PATH' ] == '':
path = os.defpath
else:
path = os.environ['PATH']
-
+
for dir in path.split( os.pathsep ):
f = os.path.join( dir, name )
if os.access( f, os.X_OK ):
@@ -317,7 +317,7 @@ class ShellProbe( Action ):
##
## returns true if feature successfully compiles
##
-##
+##
class CCProbe( Action ):
def __init__( self, pretext, command, test_file ):
super( CCProbe, self ).__init__( 'probe', pretext )
@@ -358,7 +358,7 @@ class CCProbe( Action ):
##
## returns true if feature successfully compiles
##
-##
+##
class LDProbe( Action ):
def __init__( self, pretext, command, lib, test_file ):
super( LDProbe, self ).__init__( 'probe', pretext )
@@ -444,7 +444,7 @@ class HostTupleProbe( ShellProbe, list ):
if self.match( '*-*-cygwin*' ):
self.systemf = self[2][0].upper() + self[2][1:]
-
+
## glob-match against spec
def match( self, *specs ):
for spec in specs:
@@ -519,7 +519,7 @@ class IfHost( object ):
def __nonzero__( self ):
return self.value != None
-
+
def __str__( self ):
return self.value
@@ -551,7 +551,7 @@ class ArchAction( Action ):
def _action( self ):
self.fail = False
- ## some match on system should be made here; otherwise we signal a warning.
+ ## some match on system should be made here; otherwise we signal a warning.
if host.match( '*-*-cygwin*' ):
pass
elif host.match( '*-*-darwin11.*' ):
@@ -673,74 +673,67 @@ class SelectMode( dict ):
## Builds are classed into one of the following types:
##
## release
-## must be built from official svn with '/tags/' in the url
+## must be built from official git at version tag
## developer
-## must be built from official svn but is not a release
-## unofficial
-## all other builds
+## must be built from official git but is not a release
##
class RepoProbe( ShellProbe ):
def __init__( self ):
- svn = 'svn'
-
- ## Possible the repo was created using an incompatible version than what is
- ## available in PATH when probe runs. Workaround by checking for file
- ## .svn/HANDBRAKE_REPO_PROBE which points to a preferred svn executable.
+ # Find script that creates repo info
try:
- hrp = os.path.join( cfg.src_dir, '.svn', 'HANDBRAKE_REPO_PROBE' )
- if os.path.isfile( hrp ) and os.path.getsize( hrp ) > 0:
- file = cfg.open( hrp, 'r' )
- line = file.readline().strip()
- file.close()
- if line:
- svn = line
+ repo_info = os.path.join( cfg.src_dir, 'scripts', 'repo-info.sh' )
+ if not os.path.isfile( repo_info ):
+ cfg.errln( 'Missing required script %s\n', repo_info )
+ sys.exit( 1 )
except:
- pass
+ sys.exit( 1 )
- super( RepoProbe, self ).__init__( 'svn info', '%s info %s' % (svn,cfg.src_dir) )
+ super( RepoProbe, self ).__init__( 'repo info', '%s %s' %
+ (repo_info, cfg.src_dir) )
- self.url = 'svn://nowhere.com/project/unknown'
- self.root = 'svn://nowhere.com/project'
+ self.url = 'git://nowhere.com/project/unknown'
+ self.tag = ''
self.branch = 'unknown'
- self.uuid = '00000000-0000-0000-0000-000000000000';
+ self.remote = 'unknown'
self.rev = 0
+ self.hash = 'deadbeaf'
+ self.shorthash = 'deadbea'
self.date = '0000-00-00 00:00:00 -0000'
self.official = 0
- self.type = 'unofficial'
+ self.type = 'developer'
def _parseSession( self ):
for line in self.session:
## grok fields
- m = re.match( '([^:]+):\\s+(.+)', line )
+ m = re.match( '([^\=]+)\=(.*)', line )
if not m:
continue
(name,value) = m.groups()
- if name == 'URL':
+ if name == 'URL' and value != '':
self.url = value
- elif name == 'Repository Root':
- self.root = value
- elif name == 'Repository UUID':
- self.uuid = value
- elif name == 'Revision':
+ elif name == 'TAG':
+ self.tag = value
+ elif name == 'BRANCH':
+ self.branch = value
+ elif name == 'REMOTE':
+ self.remote = value
+ elif name == 'REV':
self.rev = int( value )
- elif name == 'Last Changed Date':
- # strip chars in parens
- if value.find( ' (' ):
- self.date = value[0:value.find(' (')]
- else:
- self.date = value
-
- ## grok branch
- i = self.url.rfind( '/' )
- if i != -1 and i < len(self.url)-1:
- self.branch = self.url[i+1:]
-
- # type-classification via repository UUID
- if self.uuid == 'b64f7644-9d1e-0410-96f1-a4d463321fa5':
+ elif name == 'DATE':
+ self.date = value
+ elif name == 'HASH':
+ self.hash = value
+ self.shorthash = value[:7]
+
+ # type-classification via repository URL
+ official_url = 'https://github.com/HandBrake/HandBrake.git' # HTTPS
+ if self.url == '[email protected]:HandBrake/HandBrake.git': # SSH
+ self.url = official_url
+
+ if self.url == official_url:
self.official = 1
- m = re.match( '([^:]+)://([^/]+)/(.+)', self.url )
- if m and re.match( '.*tags/.*', m.group( 3 )):
+ if self.branch == '' and self.rev == 0:
self.type = 'release'
else:
self.type = 'developer'
@@ -748,12 +741,12 @@ class RepoProbe( ShellProbe ):
self.msg_end = self.url
def _failSession( self ):
- # Look for svn info in version file.
+ # Look for repo info in version file.
#
# Version file would be created manually by source packager.
# e.g.
- # $ svn info HandBrake > HandBrake/version.txt
- # $ tar -czf handbrake-source.tgz --exclude .svn HandBrake
+ # $ HandBrake/scripts/repo-info.sh HandBrake > HandBrake/version.txt
+ # $ tar -czf handbrake-source.tgz --exclude .git HandBrake
cfg.infof( 'probe: version.txt...' )
try:
hvp = os.path.join( cfg.src_dir, 'version.txt' )
@@ -793,7 +786,7 @@ class Project( Action ):
self.name_upper = self.name.upper()
self.vmajor = 0
- self.vminor = 10
+ self.vminor = 0
self.vpoint = 0
def _action( self ):
@@ -803,24 +796,33 @@ class Project( Action ):
else:
url_arch = ''
+ if repo.tag != '':
+ m = re.match( '([0-9]+)\.([0-9]+)\.([0-9]+)', repo.tag )
+ if not m:
+ cfg.errln( 'Invalid repo tag format %s\n', repo.tag )
+ sys.exit( 1 )
+ (vmajor, vminor, vpoint) = m.groups()
+ self.vmajor = int(vmajor)
+ self.vminor = int(vminor)
+ self.vpoint = int(vpoint)
+
if repo.type == 'release':
self.version = '%d.%d.%d' % (self.vmajor,self.vminor,self.vpoint)
url_ctype = ''
url_ntype = 'stable'
self.build = time.strftime('%Y%m%d') + '00'
self.title = '%s %s (%s)' % (self.name,self.version,self.build)
- elif repo.type == 'developer':
- self.version = '%dsvn' % (repo.rev)
+ else:
+ if repo.branch != '':
+ self.version = '%d.%d.%d-%d-%s-%s' % (self.vmajor, self.vminor,
+ self.vpoint, repo.rev, repo.shorthash, repo.branch)
+ else:
+ self.version = '%d.%d.%d-%d-%s' % (self.vmajor, self.vminor,
+ self.vpoint, repo.rev, repo.shorthash)
url_ctype = '_unstable'
url_ntype = 'unstable'
self.build = time.strftime('%Y%m%d') + '01'
- self.title = '%s svn%d (%s)' % (self.name,repo.rev,self.build)
- else:
- self.version = 'rev%d' % (repo.rev)
- url_ctype = '_unofficial'
- url_ntype = 'unofficial'
- self.build = time.strftime('%Y%m%d') + '99'
- self.title = '%s rev%d (%s)' % (self.name,repo.rev,self.build)
+ self.title = '%s %s (%s)' % (self.name,self.version,self.build)
self.url_appcast = 'https://handbrake.fr/appcast%s%s.xml' % (url_ctype,url_arch)
self.url_appnote = 'https://handbrake.fr/appcast/%s.html' % (url_ntype)
@@ -1206,7 +1208,7 @@ def createCLI():
h = IfHost( 'enable HWD features', '*-*-*', none=optparse.SUPPRESS_HELP ).value
grp.add_option( '--enable-hwd', default=False, action='store_true', help=h )
-
+
h = IfHost( 'enable use of x265 encoding', '*-*-*', none=optparse.SUPPRESS_HELP ).value
grp.add_option( '--enable-x265', default=True, action='store_true', help=h )
grp.add_option( '--disable-x265', dest="enable_x265", action='store_false' )
@@ -1667,13 +1669,15 @@ int main ()
doc.add( 'HB.build', project.build )
doc.add( 'HB.repo.url', repo.url )
- doc.add( 'HB.repo.root', repo.root )
- doc.add( 'HB.repo.branch', repo.branch )
- doc.add( 'HB.repo.uuid', repo.uuid )
+ doc.add( 'HB.repo.tag', repo.tag )
doc.add( 'HB.repo.rev', repo.rev )
- doc.add( 'HB.repo.date', repo.date )
- doc.add( 'HB.repo.official', repo.official )
+ doc.add( 'HB.repo.hash', repo.hash )
+ doc.add( 'HB.repo.shorthash', repo.shorthash )
+ doc.add( 'HB.repo.branch', repo.branch )
+ doc.add( 'HB.repo.remote', repo.remote )
doc.add( 'HB.repo.type', repo.type )
+ doc.add( 'HB.repo.official', repo.official )
+ doc.add( 'HB.repo.date', repo.date )
doc.addBlank()
doc.add( 'HOST.spec', host.spec )
@@ -1714,7 +1718,7 @@ int main ()
doc.add( 'BUILD/', cfg.build_final + os.sep )
doc.add( 'PREFIX', cfg.prefix_final )
doc.add( 'PREFIX/', cfg.prefix_final + os.sep )
-
+
doc.addBlank()
doc.add( 'FEATURE.local_yasm', int( options.enable_local_yasm ))
doc.add( 'FEATURE.local_autotools', int( options.enable_local_autotools ))
@@ -1867,7 +1871,7 @@ except AbortError, x:
try:
cfg.record_log()
except:
- pass
- sys.exit( 1 )
+ pass
+ sys.exit( 1 )
sys.exit( 0 )
diff --git a/make/include/tool.defs b/make/include/tool.defs
index 29f45e9a7..3efe5d83f 100644
--- a/make/include/tool.defs
+++ b/make/include/tool.defs
@@ -11,3 +11,4 @@ WGET.exe = wget
MV.exe = mv
ZIP.exe = zip
LN.exe = ln
+GIT.exe = git
diff --git a/pkg/linux/module.defs b/pkg/linux/module.defs
index 2570d0857..3b1a81f8e 100644
--- a/pkg/linux/module.defs
+++ b/pkg/linux/module.defs
@@ -1,8 +1,19 @@
PKG.deb.machine = `dpkg --print-architecture`
PKG.rpm.machine = `rpm -E "%_target_cpu"`
-PKG.release = 1
+PKG.release = $(HB.repo.rev)
PKG.rpm.dist = `rpm -E "%dist"`
+ifeq ($(HB.repo.tag),)
+ tag = 0.0.0
+endif
+ifeq ($(HB.repo.type),release)
+ PKG.rpm.hb.version = $(tag)
+else ifeq ($(HB.repo.branch),)
+ PKG.rpm.hb.version = $(tab).$(HB.repo.shorthash)
+else
+ PKG.rpm.hb.version = $(tag).$(HB.repo.shorthash).$(HB.repo.branch)
+endif
+
###############################################################################
@@ -12,27 +23,29 @@ STAGE.out.cli/ = $(STAGE.out/)cli/
###############################################################################
-PKG.rpm.src.tar.bz2 = $(STAGE.out.src/)rpm/$(PKG.basename).tar.bz2
+PKG.rpm.basename = $(HB.name.lower)-$(PKG.rpm.hb.version)
+PKG.rpm.src.tar.bz2 = $(STAGE.out.src/)rpm/$(PKG.rpm.basename).tar.bz2
STAGE.out.rpm.src/ = $(STAGE.out.src/)rpm/
PKG.debian = $(PKG.in/)linux/debian
PKG.cli.deb = $(PKG.out/)$(HB.name)-$(HB.version)-Ubuntu_CLI_$(BUILD.machine).deb
PKG.gui.deb = $(PKG.out/)$(HB.name)-$(HB.version)-Ubuntu_GUI_$(BUILD.machine).deb
-PKG.deb.basename = handbrake-$(HB.version)
-PKG.src.deb.tar = handbrake_$(HB.version).tar.gz
+PKG.deb.basename = $(HB.name.lower)-$(HB.version)
+PKG.src.deb.tar = $(HB.name.lower)_$(HB.version).tar.gz
PKG.src.deb.stamp = $(STAGE.out.src/).debsrc.stamp
-PKG.src.deb = $(PKG.out/)handbrake_$(HB.version).deb
+PKG.src.deb = $(PKG.out/)$(HB.name.lower)_$(HB.version).deb
-PKG.cli.tmp.deb = $(PKG.out/)handbrake-cli_$(HB.version)_$(PKG.deb.machine).deb
-PKG.gui.tmp.deb = $(PKG.out/)handbrake-gtk_$(HB.version)_$(PKG.deb.machine).deb
+PKG.cli.tmp.deb = $(PKG.out/)$(HB.name.lower)-cli_$(HB.version)_$(PKG.deb.machine).deb
+PKG.gui.tmp.deb = $(PKG.out/)$(HB.name.lower)-gtk_$(HB.version)_$(PKG.deb.machine).deb
PKG.native.rpm.stamp = $(RPM.out/).rpm.stamp
+PKG.rpm.stamp = $(PKG.out/).rpm.stamp
-PKG.gui.native.rpm = $(RPM.out/)RPMS/$(PKG.rpm.machine)/$(HB.name)-gui-$(HB.version)-$(PKG.release)$(PKG.rpm.dist).$(PKG.rpm.machine).rpm
-PKG.cli.native.rpm = $(RPM.out/)RPMS/$(PKG.rpm.machine)/$(HB.name)-cli-$(HB.version)-$(PKG.release)$(PKG.rpm.dist).$(PKG.rpm.machine).rpm
+PKG.gui.native.rpm = $(RPM.out/)RPMS/$(PKG.rpm.machine)/$(HB.name.lower)-gui-$(PKG.rpm.hb.version)-$(PKG.release)$(PKG.rpm.dist).$(PKG.rpm.machine).rpm
+PKG.cli.native.rpm = $(RPM.out/)RPMS/$(PKG.rpm.machine)/$(HB.name.lower)-cli-$(PKG.rpm.hb.version)-$(PKG.release)$(PKG.rpm.dist).$(PKG.rpm.machine).rpm
-PKG.cli.rpm = $(PKG.out/)$(HB.name)-$(HB.version)-Fedora_CLI_$(BUILD.machine).rpm
-PKG.gui.rpm = $(PKG.out/)$(HB.name)-$(HB.version)-Fedora_GUI_$(BUILD.machine).rpm
+PKG.cli.rpm = $(PKG.out/)$(HB.name.lower)-cli-$(PKG.rpm.hb.version)-$(PKG.release)$(PKG.rpm.dist).$(PKG.rpm.machine).rpm
+PKG.gui.rpm = $(PKG.out/)$(HB.name.lower)-gui-$(PKG.rpm.hb.version)-$(PKG.release)$(PKG.rpm.dist).$(PKG.rpm.machine).rpm
RPM.out = $(STAGE.out/)rpm
RPM.out/ = $(STAGE.out/)rpm/
RPMROOT.out = $(PWD)/$(STAGE.out/)rpmroot
diff --git a/pkg/linux/module.rules b/pkg/linux/module.rules
index b7b66a38a..c0c2fba34 100644
--- a/pkg/linux/module.rules
+++ b/pkg/linux/module.rules
@@ -1,5 +1,5 @@
pkg.create.deb:: $(PKG.gui.deb) $(PKG.cli.deb)
-pkg.create.rpm:: $(PKG.gui.rpm)
+pkg.create.rpm:: $(PKG.rpm.stamp)
pkg.create.src.deb:: $(PKG.src.deb.stamp)
pkg.create.tar:: pkg.create $(PKG.cli.tar)
@@ -21,17 +21,18 @@ $(STAGE.out.cli/):
# RPM binary package rules
#
$(PKG.rpm.src.tar.bz2): $(STAGE.out.rpm.src/)
- $(TAR.exe) cjf $@ -C $(STAGE.out.rpm.src/) $(PKG.basename)
+ $(TAR.exe) cjf $(PKG.rpm.src.tar.bz2) -C $(STAGE.out.rpm.src/) $(PKG.rpm.basename)
$(STAGE.out.rpm.src/): GNUmakefile
# -$(MKDIR.exe) -p $(STAGE.out.rpm.src/)$(PKG.basename)
# tar c --exclude build ../* | tar x -C $(STAGE.out.rpm.src/)$(PKG.basename)
-$(RM.exe) -rf $(STAGE.out.src/)
make contrib.fetch
- svn export -r$(HB.repo.rev) $(HB.repo.url) $@/$(PKG.basename)
- svn info $(HB.repo.url)@$(HB.repo.rev) > $@/$(PKG.basename)/version.txt
- -$(MKDIR.exe) $(STAGE.out.rpm.src/)$(PKG.basename)/download
- $(CP.exe) $(SRC/)download/*.tar.* $(STAGE.out.rpm.src/)$(PKG.basename)/download
+ $(MKDIR.exe) -p $@
+ $(GIT.exe) -C $(SRC/) archive --format=tar --prefix=$(PKG.rpm.basename)/ $(HB.repo.shorthash) | $(TAR.exe) -xC $@
+ $(SRC/)scripts/repo-info.sh $(SRC/) > $@/$(PKG.rpm.basename)/version.txt
+ -$(MKDIR.exe) $(STAGE.out.rpm.src/)$(PKG.rpm.basename)/download
+ $(CP.exe) $(SRC/)download/*.tar.* $(STAGE.out.rpm.src/)$(PKG.rpm.basename)/download
$(PKG.native.rpm.stamp): $(PKG.rpm.src.tar.bz2)
-$(MKDIR.exe) -p $(RPM.out/)SOURCES
@@ -40,18 +41,19 @@ $(PKG.native.rpm.stamp): $(PKG.rpm.src.tar.bz2)
-$(MKDIR.exe) -p $(RPM.out/)RPMS
-$(MKDIR.exe) -p $(RPM.out/)SRPMS
-$(MKDIR.exe) -p $(RPMROOT.out/)
- echo "%define name $(HB.name)" > $(RPM.out/)SPECS/ghb.spec
- echo "%define release 1" >> $(RPM.out/)SPECS/ghb.spec
- echo "%define version $(HB.version)" >> $(RPM.out/)SPECS/ghb.spec
+ echo "%define name $(HB.name.lower)" > $(RPM.out/)SPECS/ghb.spec
+ echo "%define release $(PKG.release)" >> $(RPM.out/)SPECS/ghb.spec
+ echo "%define version $(PKG.rpm.hb.version)" >> $(RPM.out/)SPECS/ghb.spec
cat $(GTK.src/)ghb.spec >> $(RPM.out/)SPECS/ghb.spec
$(CP.exe) $(PKG.rpm.src.tar.bz2) $(RPM.out/)SOURCES
rpmbuild --define="_topdir $(PWD)/$(RPM.out)" --buildroot $(RPMROOT.out) -ba $(RPM.out/)SPECS/ghb.spec
$(TOUCH.exe) $(PKG.native.rpm.stamp)
-$(PKG.gui.rpm): | $(dir $(PKG.gui.rpm))
-$(PKG.gui.rpm): $(PKG.native.rpm.stamp)
+$(PKG.rpm.stamp): | $(dir $(PKG.gui.rpm))
+$(PKG.rpm.stamp): $(PKG.native.rpm.stamp)
$(CP.exe) $(PKG.gui.native.rpm) $(PKG.gui.rpm)
$(CP.exe) $(PKG.cli.native.rpm) $(PKG.cli.rpm)
+ $(TOUCH.exe) $(PKG.rpm.stamp)
#
# Debian binary package rules
@@ -77,32 +79,34 @@ $(PKG.cli.deb): $(PKG.gui.tmp.deb)
# Debian source package rules
#
pkg.push.src.deb:: $(PKG.src.deb.stamp)
- (cd $(STAGE.out.src/)vivid && dput handbrake-snapshots handbrake_$(HB.version)ppa1~vivid1_source.changes )
- (cd $(STAGE.out.src/)trusty && dput handbrake-snapshots handbrake_$(HB.version)ppa1~trusty1_source.changes )
+ (cd $(STAGE.out.src/)vivid && dput handbrake-snapshots $(HB.name.lower)_$(HB.version)ppa1~vivid1_source.changes )
+ (cd $(STAGE.out.src/)trusty && dput handbrake-snapshots $(HB.name.lower)_$(HB.version)ppa1~trusty1_source.changes )
$(PKG.src.deb.stamp): GNUmakefile
-$(RM.exe) -rf $(STAGE.out.src/)
make contrib.fetch
- svn export -r$(HB.repo.rev) $(HB.repo.url) $(STAGE.out.src/)vivid/$(PKG.deb.basename)
- svn info $(HB.repo.url)@$(HB.repo.rev) > $(STAGE.out.src/)vivid/$(PKG.deb.basename)/version.txt
+ $(MKDIR.exe) -p $(STAGE.out.src/)vivid
+ $(GIT.exe) -C $(SRC/) archive --format=tar --prefix=$(PKG.deb.basename)/ $(HB.repo.shorthash) | $(TAR.exe) -xC $(STAGE.out.src/)vivid/
+ $(SRC/)scripts/repo-info.sh $(SRC/) > $(STAGE.out.src/)vivid/$(PKG.deb.basename)/version.txt
$(CP.exe) -a $(SRC/)download $(STAGE.out.src/)vivid/$(PKG.deb.basename)
cp -a $(PWD)/$(PKG.debian) $(STAGE.out.src/)vivid/$(PKG.deb.basename)
$(CP.exe) $(STAGE.out.src/)vivid/$(PKG.deb.basename)/debian/control.vivid $(STAGE.out.src/)vivid/$(PKG.deb.basename)/debian/control
$(CP.exe) $(STAGE.out.src/)vivid/$(PKG.deb.basename)/debian/rules.vivid $(STAGE.out.src/)vivid/$(PKG.deb.basename)/debian/rules
- echo "handbrake ($(HB.version)ppa1~vivid1) vivid; urgency=low" > $(STAGE.out.src/)vivid/$(PKG.deb.basename)/debian/changelog
+ echo "$(HB.name.lower) ($(HB.version)ppa1~vivid1) vivid; urgency=low" > $(STAGE.out.src/)vivid/$(PKG.deb.basename)/debian/changelog
echo " * Snapshot" >> $(STAGE.out.src/)vivid/$(PKG.deb.basename)/debian/changelog
echo " - See timeline at http://trac.handbrake.fr/timeline" >> $(STAGE.out.src/)vivid/$(PKG.deb.basename)/debian/changelog
echo "" >> $(STAGE.out.src/)vivid/$(PKG.deb.basename)/debian/changelog
echo " -- John Stebbins <[email protected]> Sun, 11 Apr 2010 9:51:07 -0800" >> $(STAGE.out.src/)vivid/$(PKG.deb.basename)/debian/changelog
$(TAR.exe) czf $(STAGE.out.src/)vivid/$(PKG.src.deb.tar) -C $(STAGE.out.src/)vivid $(PKG.deb.basename)
(cd $(STAGE.out.src/)vivid/$(PKG.deb.basename) && debuild -S -kjstebbins.hb)
- svn export -r$(HB.repo.rev) $(HB.repo.url) $(STAGE.out.src/)trusty/$(PKG.deb.basename)
- svn info $(HB.repo.url)@$(HB.repo.rev) > $(STAGE.out.src/)trusty/$(PKG.deb.basename)/version.txt
+ $(MKDIR.exe) -p $(STAGE.out.src/)trusty
+ $(GIT.exe) -C $(SRC/) archive --format=tar --prefix=$(PKG.deb.basename)/ $(HB.repo.shorthash) | $(TAR.exe) -xC $(STAGE.out.src/)trusty/
+ $(SRC/)scripts/repo-info.sh $(SRC/) > $(STAGE.out.src/)trusty/$(PKG.deb.basename)/version.txt
$(CP.exe) -a $(SRC/)download $(STAGE.out.src/)trusty/$(PKG.deb.basename)
cp -a $(PWD)/$(PKG.debian) $(STAGE.out.src/)trusty/$(PKG.deb.basename)
$(CP.exe) $(STAGE.out.src/)trusty/$(PKG.deb.basename)/debian/control.trusty $(STAGE.out.src/)trusty/$(PKG.deb.basename)/debian/control
$(CP.exe) $(STAGE.out.src/)trusty/$(PKG.deb.basename)/debian/rules.trusty $(STAGE.out.src/)trusty/$(PKG.deb.basename)/debian/rules
- echo "handbrake ($(HB.version)ppa1~trusty1) trusty; urgency=low" > $(STAGE.out.src/)trusty/$(PKG.deb.basename)/debian/changelog
+ echo "$(HB.name.lower) ($(HB.version)ppa1~trusty1) trusty; urgency=low" > $(STAGE.out.src/)trusty/$(PKG.deb.basename)/debian/changelog
echo " * Snapshot" >> $(STAGE.out.src/)trusty/$(PKG.deb.basename)/debian/changelog
echo " - See timeline at http://trac.handbrake.fr/timeline" >> $(STAGE.out.src/)trusty/$(PKG.deb.basename)/debian/changelog
echo "" >> $(STAGE.out.src/)trusty/$(PKG.deb.basename)/debian/changelog
diff --git a/pkg/module.rules b/pkg/module.rules
index 9c0457e3b..5ec109fd3 100644
--- a/pkg/module.rules
+++ b/pkg/module.rules
@@ -17,8 +17,9 @@ $(PKG.src.tar.bz2): | $(STAGE.out.src/)
$(TAR.exe) cjf $@ -C $(STAGE.out.src/) $(PKG.basename)
$(STAGE.out.src/):
- svn export -r$(HB.repo.rev) $(HB.repo.url) $@/$(PKG.basename)
- svn info $(HB.repo.url)@$(HB.repo.rev) > $@/$(PKG.basename)/version.txt
+ $(MKDIR.exe) -p $@
+ $(GIT.exe) -C $(SRC/) archive --format=tar --prefix=$(PKG.basename)/ $(HB.repo.shorthash) | $(TAR.exe) -xC $@
+ $(SRC/)scripts/repo-info.sh $(SRC/) $(GIT.exe) > $@/$(PKG.basename)/version.txt
$(PKG.src-contrib.tar.bz2):
$(TAR.exe) cjf $@ -C $(CONTRIB.download/) \
diff --git a/scripts/repo-info.sh b/scripts/repo-info.sh
new file mode 100755
index 000000000..72d974d04
--- /dev/null
+++ b/scripts/repo-info.sh
@@ -0,0 +1,67 @@
+#! /bin/bash
+#
+# Retrieves git repository info for directory ${1} using command ${2}
+
+# Args
+REPO_DIR='.'
+if [[ ${1} ]]; then
+ REPO_DIR=${1}
+fi
+GIT_EXE='git'
+if [[ ${2} ]]; then
+ GIT_EXE=${2}
+fi
+
+# Switch to working directory
+if ! cd ${REPO_DIR} 2>/dev/null; then
+ echo "Invalid directory ${REPO_DIR}." 1>&2
+ exit 1
+fi
+
+# Check whether we have git
+if ! hash ${GIT_EXE} 2>/dev/null; then
+ echo "Command '${GIT_EXE}' not found." 1>&2
+ exit 1
+fi
+
+# Check if there is a valid git repo here
+HASH=$(${GIT_EXE} rev-parse HEAD)
+ERR=$?
+if [[ ${ERR} -ne 0 ]]; then
+ echo "Not a valid repository." 1>&2
+ exit ${ERR}
+elif [[ -z ${HASH} ]]; then
+ echo "Not a valid repository." 1>&2
+ exit 1
+fi
+
+# Retrieve info
+URL=$(${GIT_EXE} config remote.origin.url)
+TAG=$(${GIT_EXE} describe --abbrev=0)
+if [[ ${TAG} ]]; then
+ REV=$(${GIT_EXE} rev-list ${TAG}.. --count)
+else
+ TAG=$(${GIT_EXE} describe $(${GIT_EXE} rev-list --tags --max-count=1))
+ if [[ ${TAG} ]]; then
+ REV=$(${GIT_EXE} rev-list $(${GIT_EXE} merge-base 0.10.2 HEAD).. --count)
+ else
+ REV=$(${GIT_EXE} rev-list HEAD --count)
+ fi
+fi
+BRANCH=$(${GIT_EXE} symbolic-ref -q --short HEAD)
+REMOTE="${URL}"
+UPSTREAM=$(${GIT_EXE} config branch.${BRANCH}.remote)
+if [[ ${UPSTREAM} ]]; then
+ REMOTE="${UPSTREAM}"
+fi
+DATE=$(${GIT_EXE} log -1 --format="format:%ai")
+
+# Output
+# Only write tag and rev if they exist. A fresh clone currently has no tags.
+echo "URL=${URL}"
+echo "HASH=${HASH}"
+if [[ ${TAG} ]]; then echo "TAG=${TAG}"; fi
+if [[ ${REV} ]]; then echo "REV=${REV}"; fi
+echo "BRANCH=${BRANCH}"
+echo "REMOTE=${REMOTE}"
+echo "DATE=${DATE}"
diff --git a/scripts/tag-release.sh b/scripts/tag-release.sh
new file mode 100755
index 000000000..64f98103e
--- /dev/null
+++ b/scripts/tag-release.sh
@@ -0,0 +1,86 @@
+#! /bin/bash
+#
+# Usage: tag-release.sh <release-ver> [<commit>]
+#
+# Creates a new branch and tag for the release
+# Optionally, the release can be based off a specific git commit.
+#
+
+TAG=${1}
+COMMIT=${2}
+
+if [ "x${TAG}" == "x" ]; then
+ echo "Missing release tag (e.g. 0.10.0)"
+fi
+
+if [ "x${COMMIT}" == "x" ]; then
+ echo "Creating release tag ${TAG} and branch ${TAG}-dev from HEAD, proceed?"
+else
+ echo "Creating release tag ${TAG} and branch ${TAG}-dev from ${COMMIT}, proceed?"
+fi
+read proceed
+if [[ ( "x${proceed}" != "xy" ) && ( "x${proceed}" != "xY" ) ]] ; then
+ echo "Aborting..."
+ exit 0
+fi
+
+if [ "x${COMMIT}" != "x" ]; then
+ # create release branch from specific commit
+ git checkout "${COMMIT}" -b "${TAG}-dev"
+ ERR=$?
+else
+ # create release branch from head of current branch
+ git checkout -b "${TAG}-dev"
+ ERR=$?
+fi
+if [ ${ERR} -ne 0 ]; then
+ echo "Failed to create branch ${TAG}-dev"
+ exit ${ERR}
+fi
+
+# creat tag
+git tag -a "${TAG}" -m "Release ${TAG}" HEAD
+ERR=$?
+if [ ${ERR} -ne 0 ]; then
+ echo "Failed to create tag ${TAG}"
+ # cleanup... remove the branch that was created
+ git branch -d "${TAG}-dev"
+ exit ${ERR}
+fi
+
+# checkout tag in preparation for building release
+# this should put you in a "detached HEAD" state
+git checkout "${TAG}"
+ERR=$?
+if [ ${ERR} -ne 0 ]; then
+ echo "Failed to checkout tag ${TAG}"
+ # cleanup... remove the branch that was created
+ git branch -d "${TAG}-dev"
+ exit ${ERR}
+fi
+
+remote=$(git config remote.origin.url)
+echo
+echo "Do you wish to push this release branch and tag to $remote? (y/N)"
+echo "You may want to do this manually after creating and verifying release."
+echo "e.g."
+echo " git push -u origin ${TAG}-dev"
+echo " git push origin ${TAG}"
+read proceed
+if [[ ( "x${proceed}" == "xy" ) || ( "x${proceed}" == "xY" ) ]] ; then
+ git push -u origin "${TAG}-dev"
+ ERR=$?
+ if [ ${ERR} -ne 0 ]; then
+ echo "Failed to push branch ${TAG}-dev to remote"
+ exit ${ERR}
+ fi
+ git push origin "${TAG}"
+ ERR=$?
+ if [ ${ERR} -ne 0 ]; then
+ echo "Failed to push tag ${TAG}-dev to remote"
+ exit ${ERR}
+ fi
+else
+ echo "Branch and tag are local, changes not pushed to remote!"
+fi
+
diff --git a/test/test.c b/test/test.c
index 7aa8aad0a..a0bb1b3f3 100644
--- a/test/test.c
+++ b/test/test.c
@@ -1731,12 +1731,16 @@ static int ParseOptions( int argc, char ** argv )
#define PRESET_EXPORT_FILE 304
#define PRESET_IMPORT 305
#define PRESET_IMPORT_GUI 306
+ #define VERSION 307
+ #define DESCRIBE 308
for( ;; )
{
static struct option long_options[] =
{
{ "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, VERSION },
+ { "describe", no_argument, NULL, DESCRIBE },
{ "update", no_argument, NULL, 'u' },
{ "verbose", optional_argument, NULL, 'v' },
{ "no-dvdnav", no_argument, NULL, DVDNAV },
@@ -1906,6 +1910,12 @@ static int ParseOptions( int argc, char ** argv )
case 'h':
ShowHelp();
exit( 0 );
+ case VERSION:
+ printf("HandBrake %s\n", hb_get_version(NULL));
+ exit(0);
+ case DESCRIBE:
+ printf("%s\n", hb_get_full_description());
+ exit(0);
case 'u':
update = 1;
break;