diff options
Diffstat (limited to 'Makefile')
-rwxr-xr-x | Makefile | 40 |
1 files changed, 35 insertions, 5 deletions
@@ -7,7 +7,11 @@ RSA_FILE := META-INF/zigbert.rsa COMMIT := $(shell git --no-pager log -1 --format=format:%h) VERSION = $(shell head -n1 CHANGELOG | cut -d" " -f1) PKGNAME := $(EXTNAME)-$(VERSION)-$(COMMIT).xpi -TARGET := $(CURDIR)/build/$(PKGNAME) +# 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) TEMPDIR := $(shell mktemp -d -u) # make sure CERTDIR and CERTNAME are defined for signing @@ -27,15 +31,32 @@ endif # 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 - $(error "Usage: make DEFAULTKEY=<key id>") +# 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") chrome.manifest install.rdf COPYING + +bitmask.xpi: $(XPI_CONTENTS) + zip $@ $(XPI_CONTENTS) + +install.rdf: install.rdf.template Changelog + sed 's/__VERSION__/$(VERSION)/' < $< > $@ + +xpi_release: + ln -s $(XPINAME) $(PKGNAME) + # main rule -all: clean $(TARGET) +#all: clean $(TARGET) # main target: .xpi file @@ -54,7 +75,7 @@ signed: clean cp -r $(PREFIX)/{$(FILES_TO_PACKAGE)} $(TEMPDIR)/ rm -rf $(TEMPDIR)/.gitignore signtool -d $(CERTDIR) -k $(CERTNAME) $(TEMPDIR)/ - (cd $(TEMPDIR) && zip $(TARGET) ./$(RSA_FILE) && zip -r -D $(TARGET) ./ -x ./$(RSA_FILE)) + (cd $(TEMPDIR) && zip $(TARGET) ./$(RSA_FILE) && zip -D $@ $(XPI_CONTENTS) -x ./$(RSA_FILE)) rm -rf $(TEMPDIR) (cd build/ && sha512sum $(PKGNAME) > SHA512SUMS && gpg -a --default-key $(DEFAULTKEY) --detach-sign SHA512SUMS) @@ -72,4 +93,13 @@ debian-package: install.rdf: install.rdf.template Changelog sed 's/__VERSION__/$(VERSION)/' < $< > $@ -.PHONY: all clean signed +debian-package: + git buildpackage -us -uc + +clean: + #rm -f $(TARGET) build/* + rm -f *.xpi + rm -f install.rdf + + +.PHONY: all clean |