summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2015-08-25 09:48:14 -0700
committerJohn Stebbins <[email protected]>2015-08-25 14:17:11 -0700
commit4889bc95883dd2cb0eb679d381d15385b930bcfa (patch)
tree7a20ea87161e790b84b7f1cd4b0d10010201f995 /pkg
parentd4d9555eca3048d281d510bd51267ce67142acd6 (diff)
build: use git version info instead of svn
Migrate from svn to git. Since our build system automatically generates version info from the svn repo, this needs to change when we move the repo to git.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/linux/module.defs35
-rw-r--r--pkg/linux/module.rules42
-rw-r--r--pkg/module.rules5
3 files changed, 50 insertions, 32 deletions
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/) \