summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--make/include/main.defs1
-rw-r--r--pkg/darwin/module.defs10
-rw-r--r--pkg/darwin/module.rules36
-rw-r--r--pkg/module.defs29
-rw-r--r--pkg/module.rules19
5 files changed, 95 insertions, 0 deletions
diff --git a/make/include/main.defs b/make/include/main.defs
index 0e44c97c3..1c2a22e06 100644
--- a/make/include/main.defs
+++ b/make/include/main.defs
@@ -64,6 +64,7 @@ endif
###############################################################################
MODULES += doc
+MODULES += pkg
###############################################################################
diff --git a/pkg/darwin/module.defs b/pkg/darwin/module.defs
new file mode 100644
index 000000000..50d68cad8
--- /dev/null
+++ b/pkg/darwin/module.defs
@@ -0,0 +1,10 @@
+PKG.cli.dmg = $(PKG.out/)$(HB.name)-$(HB.version)-MacOSX.5_CLI_$(BUILD.machine).dmg
+PKG.gui.dmg = $(PKG.out/)$(HB.name)-$(HB.version)-MacOSX.5_GUI_$(BUILD.machine).dmg
+
+STAGE.cli/ = $(BUILD/)stage/cli/
+STAGE.gui/ = $(BUILD/)stage/gui/
+
+###############################################################################
+
+BUILD.out += $(PKG.cli.dmg)
+BUILD.out += $(PKG.gui.dmg)
diff --git a/pkg/darwin/module.rules b/pkg/darwin/module.rules
new file mode 100644
index 000000000..bef593bf3
--- /dev/null
+++ b/pkg/darwin/module.rules
@@ -0,0 +1,36 @@
+pkg.create:: $(PKG.cli.dmg) $(PKG.gui.dmg)
+
+$(PKG.cli.dmg): | $(dir $(PKG.cli.dmg))
+$(PKG.cli.dmg): | $(STAGE.cli/)
+ hdiutil create -srcfolder $(STAGE.cli/) -format UDBZ -mode 755 \
+ -volname $(basename $(notdir $@)) $@
+
+$(PKG.gui.dmg): | $(dir $(PKG.gui.dmg))
+$(PKG.gui.dmg): | $(STAGE.gui/)
+ hdiutil create -srcfolder $(STAGE.gui/) -format UDBZ -mode 755 \
+ -volname $(basename $(notdir $@)) $@
+
+pkg.cli.clean:
+ $(RM.exe) -fr $(STAGE.cli/)
+ $(RM.exe) $(PKG.cli.dmg)
+
+pkg.gui.clean:
+ $(RM.exe) -fr $(STAGE.gui/)
+ $(RM.exe) $(PKG.gui.dmg)
+
+$(STAGE.cli/):
+ $(MKDIR.exe) -p $@
+ifeq (1-darwin,$(FEATURE.xcode)-$(BUILD.system))
+ $(CP.exe) $(BUILD/)HandBrakeCLI $(STAGE.cli/)
+ $(call STAGE.doc,$(STAGE.cli/))
+else
+ $(CP.exe) $(TEST.exe) $(STAGE.cli/)
+ $(call STAGE.doc,$(STAGE.cli/))
+endif
+
+$(STAGE.gui/):
+ $(MKDIR.exe) -p $@
+ifeq (1-darwin,$(FEATURE.xcode)-$(BUILD.system))
+ $(CP.exe) -R $(BUILD/)HandBrake.app $(STAGE.gui/)
+ $(call STAGE.doc,$(STAGE.gui/))
+endif
diff --git a/pkg/module.defs b/pkg/module.defs
new file mode 100644
index 000000000..6a2281004
--- /dev/null
+++ b/pkg/module.defs
@@ -0,0 +1,29 @@
+$(eval $(call import.MODULE.defs,PKG,pkg))
+
+PKG.in/ = $(SRC/)pkg/
+PKG.out/ = $(BUILD/)pkg/
+
+PKG.src.tar.bz2 = $(PKG.out/)$(HB.name)-$(HB.version).tar.bz2
+
+STAGE.src/ = $(BUILD/)stage/src/
+
+###############################################################################
+
+define STAGE.doc
+ $(MKDIR.exe) -p $(1)doc
+ $(CP.exe) $(SRC/)AUTHORS $(1)doc
+ $(CP.exe) $(SRC/)COPYING $(1)doc
+ $(CP.exe) $(SRC/)CREDITS $(1)doc
+ $(CP.exe) $(SRC/)NEWS $(1)doc
+ $(CP.exe) $(SRC/)THANKS $(1)doc
+ $(CP.exe) $(SRC/)TRANSLATIONS $(1)doc
+endef
+
+###############################################################################
+
+BUILD.out += $(PKG.src.tar.bz2)
+
+###############################################################################
+
+## include optional platform packaging
+-include $(SRC/)pkg/$(BUILD.system)/module.defs
diff --git a/pkg/module.rules b/pkg/module.rules
new file mode 100644
index 000000000..6660d9fdd
--- /dev/null
+++ b/pkg/module.rules
@@ -0,0 +1,19 @@
+$(eval $(call import.MODULE.rules,PKG))
+
+###############################################################################
+
+.PHONY: pkg.create
+
+pkg.create:: $(PKG.src.tar.bz2)
+
+$(PKG.src.tar.bz2): | $(dir $(PKG.src.tar.bz2))
+$(PKG.src.tar.bz2): | $(STAGE.src/)
+ $(TAR.exe) cjf $@ -C $(STAGE.src/) .
+
+$(STAGE.src/):
+ svn export -r$(HB.repo.rev) $(HB.repo.url) $@/$(HB.name)-$(HB.version)
+
+###############################################################################
+
+## include optional platform packaging
+-include $(SRC/)pkg/$(BUILD.system)/module.rules