| @@ -1,24 +1,25 @@ | | | @@ -1,24 +1,25 @@ |
1 | # $NetBSD: xpi.mk,v 1.1 2010/04/22 17:06:19 tnn Exp $ | | 1 | # $NetBSD: xpi.mk,v 1.2 2012/04/08 16:44:40 bsiegert Exp $ |
2 | # | | 2 | # |
3 | # common logic for repackaging mozilla extensions (.xpi files) | | 3 | # common logic for repackaging mozilla extensions (.xpi files) |
4 | # Used by the {firefox,seamonkey,thunderbird}-l10n packages. | | 4 | # Used by the {firefox,seamonkey,thunderbird}-l10n packages. |
5 | | | 5 | |
6 | USE_TOOLS+= unzip pax | | 6 | USE_TOOLS+= unzip pax |
7 | | | 7 | |
8 | post-extract: extract-xpi | | 8 | post-extract: extract-xpi |
9 | | | 9 | |
10 | .PHONY: extract-xpi | | 10 | .PHONY: extract-xpi |
11 | extract-xpi: | | 11 | extract-xpi: |
12 | .for f in ${XPI_FILES} | | 12 | .for f in ${XPI_FILES} |
13 | @${MKDIR} ${WRKDIR}/${f:S/.xpi//} && cd ${WRKDIR}/${f:S/.xpi//} && ${UNZIP_CMD} -aqo "${WRKDIR}/${f}" | | 13 | @${MKDIR} ${WRKDIR}/${f:S/.xpi//} && cd ${WRKDIR}/${f:S/.xpi//} && ${UNZIP_CMD} -aqo "${WRKDIR}/${f}" |
14 | .endfor | | 14 | .endfor |
15 | | | 15 | |
16 | do-install: install-xpi | | 16 | do-install: install-xpi |
17 | | | 17 | |
18 | .PHONY: install-xpi | | 18 | .PHONY: install-xpi |
19 | install-xpi: | | 19 | install-xpi: |
20 | .for f in ${XPI_FILES} | | 20 | .for f in ${XPI_FILES} |
21 | id=$$(${AWK} '/em:id=/ {sub("^.*em:id=\"", "");sub("\".*$$","");print $$0}' < ${WRKDIR}/${f:S/.xpi//}/install.rdf); \ | | 21 | id=$$(${AWK} '/em:id=/ {sub("^.*em:id=\"", "");sub("\".*$$","");print $$0}' < ${WRKDIR}/${f:S/.xpi//}/install.rdf); \ |
| | | 22 | ${MKDIR} ${DESTDIR}${EXTENSIONS_DIR}/$${id} && \ |
22 | cd ${WRKDIR}/${f:S/.xpi//} && \ | | 23 | cd ${WRKDIR}/${f:S/.xpi//} && \ |
23 | pax -rw . ${DESTDIR}${EXTENSIONS_DIR}/$${id} | | 24 | pax -rw . ${DESTDIR}${EXTENSIONS_DIR}/$${id} |
24 | .endfor | | 25 | .endfor |