summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--[-rwxr-xr-x]Makefile99
1 files changed, 43 insertions, 56 deletions
diff --git a/Makefile b/Makefile
index a11840d..3dcda0e 100755..100644
--- a/Makefile
+++ b/Makefile
@@ -1,66 +1,48 @@
EXTNAME := bitmask-thunderbird
+XPINAME := bitmask.xpi # debian package will use this name
PREFIX := .
FILES_TO_PACKAGE := chrome,chrome.manifest,install.rdf
RSA_FILE := META-INF/zigbert.rsa
# the following variables are updated automatically
COMMIT := $(shell git --no-pager log -1 --format=format:%h)
-VERSION = $(shell head -n1 CHANGELOG | cut -d" " -f1)
+VERSION := $(shell head -n1 CHANGELOG | cut -d" " -f1)
PKGNAME := $(EXTNAME)-$(VERSION)-$(COMMIT).xpi
-# XXX for debian makefile it's simpler to pick a fixed name.
-# XXX we could build it and rename in another goal.
-XPINAME := bitmask.xpi
-TARGET := $(CURDIR)/$(XPINAME)
-#TARGET := $(CURDIR)/build/$(PKGNAME)
+TARGET := $(CURDIR)/build/$(PKGNAME)
TEMPDIR := $(shell mktemp -d -u)
-# make sure CERTDIR and CERTNAME are defined for signing
-USAGE := "Usage: make CERTDIR=<certificate directory> CERTNAME=<certificate name> DEFAULTKEY=<key id>"
-ifeq ($(MAKECMDGOALS),signed)
-ifndef CERTDIR
- $(error $(USAGE))
-endif
-ifndef CERTNAME
- $(error $(USAGE))
-endif
-ifndef DEFAULTKEY
- $(error $(USAGE))
-endif
-endif
+XPI_CONTENTS := $(shell find chrome -name "*.html" -o -name "*.xhtml" -o -name "*.css" -o -name "*.png" -o -name "*.gif" -o -name "*.js" -o -name "*.jsm" -o -name "*.dtd" -o -name "*.xul" -o -name "messages" -o -name "*.properties") chrome.manifest install.rdf COPYING
-# make sure DEFAULTKEY was given to sign the calculated hashes
-ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(MAKECMDGOALS),upload)
-ifneq ($(MAKECMDGOALS),bitmask.xpi)
-ifneq ($(MAKECMDGOALS),install.rdf)
-ifndef DEFAULTKEY
-# XXX need to remove signed from default build, debian chokes otherwise
-# $(error "Usage: make DEFAULTKEY=<key id>")
-endif
-endif
-endif
-endif
-endif
-XPI_CONTENTS:=$(shell find chrome -name "*.html" -o -name "*.xhtml" -o -name "*.css" -o -name "*.png" -o -name "*.gif" -o -name "*.js" -o -name "*.jsm" -o -name "*.dtd" -o -name "*.xul" -o -name "messages" -o -name "*.properties") chrome.manifest install.rdf COPYING
+#-----------------------------------------------------------------------------
+# debhelper targets
+#-----------------------------------------------------------------------------
-bitmask.xpi: $(XPI_CONTENTS)
+$(XPINAME): $(XPI_CONTENTS)
zip $@ $(XPI_CONTENTS)
install.rdf: install.rdf.template Changelog
- sed 's/__VERSION__/$(VERSION)/' < $< > $@
+ sed 's/__VERSION__/$(VERSION)/' < $< > $@
xpi_release:
ln -s $(XPINAME) $(PKGNAME)
+debian-package:
+ git buildpackage -us -uc
-# main rule
-#all: clean $(TARGET)
+#-----------------------------------------------------------------------------
+# unsigned XPI file
+#-----------------------------------------------------------------------------
-# main target: .xpi file
+# make sure DEFAULTKEY is defined to sign the calculated hashes
+ifeq ($(MAKECMDGOALS),unsigned)
+ifndef DEFAULTKEY
+ $(error "Usage: make DEFAULTKEY=<key id>")
+endif
+endif
-$(TARGET): clean install.rdf
+unsigned: clean install.rdf
mkdir -p $(TEMPDIR)
mkdir -p `dirname $@`
cp -r $(PREFIX)/{$(FILES_TO_PACKAGE)} $(TEMPDIR)/
@@ -69,7 +51,26 @@ $(TARGET): clean install.rdf
rm -rf $(TEMPDIR)
(cd build/ && sha512sum $(PKGNAME) > SHA512SUMS && gpg -a --default-key $(DEFAULTKEY) --detach-sign SHA512SUMS)
-signed: clean
+
+#-----------------------------------------------------------------------------
+# signed XPI file
+#-----------------------------------------------------------------------------
+
+# make sure CERTDIR, CERTNAME and DEFAULTKEY are defined for signing
+ifeq ($(MAKECMDGOALS),signed)
+USAGE := "Usage: make CERTDIR=<certificate directory> CERTNAME=<certificate name> DEFAULTKEY=<key id>"
+ifndef CERTDIR
+ $(error $(USAGE))
+endif
+ifndef CERTNAME
+ $(error $(USAGE))
+endif
+ifndef DEFAULTKEY
+ $(error $(USAGE))
+endif
+endif
+
+signed: clean install.rdf
mkdir -p $(TEMPDIR)
mkdir -p `dirname $@`
cp -r $(PREFIX)/{$(FILES_TO_PACKAGE)} $(TEMPDIR)/
@@ -79,27 +80,13 @@ signed: clean
rm -rf $(TEMPDIR)
(cd build/ && sha512sum $(PKGNAME) > SHA512SUMS && gpg -a --default-key $(DEFAULTKEY) --detach-sign SHA512SUMS)
-clean:
- rm -f $(TARGET) build/*
- rm -f install.rdf
-
upload:
ssh downloads.leap.se rm -rf /var/www/leap-downloads/public/thunderbird_extension/*
scp build/* downloads.leap.se:/var/www/leap-downloads/public/thunderbird_extension/
-debian-package:
- git buildpackage -us -uc
-
-install.rdf: install.rdf.template Changelog
- sed 's/__VERSION__/$(VERSION)/' < $< > $@
-
-debian-package:
- git buildpackage -us -uc
-
clean:
- #rm -f $(TARGET) build/*
+ rm -f $(TARGET) build/*
rm -f *.xpi
rm -f install.rdf
-
-.PHONY: all clean
+.PHONY: all clean xpi_release unsigned signed upload debian-package