This bash script puts Webextension .xpi files into the correct path for
use with firefox, tested with noscript and adblock-plus so far:

#!/bin/bash
if test -z "$1"
then
        echo "use: $0 packagebasename"
        echo "e.g. adblock_plus to build package webext-adblock-plus
from adblock_plus*.xpi"
        exit 1
fi

rm -rf debian/tmp
xpi-unpack "${1}"*.xpi debian/tmp || exit 2
IDSTRING="$(grep '\"id\"' debian/tmp/manifest.json |cut -d '"' -f 4)"
test -n "$IDSTRING" || exit 3
mkdir -p "debian/webext-${1//_/-}/usr/lib/firefox/browser/extensions" ||
exit 4
cp -a "${1}"*.xpi
"debian/webext-${1//_/-}/usr/lib/firefox/browser/extensions/${IDSTRING}.xpi"
|| exit 5
#rm -rf debian/tmp
exit 0


debian/rules example:

#!/usr/bin/make -f

override_dh_install:
        mp_install_webex adblock_plus

%:
        dh $@


Amon Ott
-- 
Dr. Amon Ott
m-privacy GmbH           Tel: +49 30 24342334
Werner-Voß-Damm 62       Fax: +49 30 99296856
12101 Berlin             http://www.m-privacy.de

Amtsgericht Charlottenburg, HRB 84946

Geschäftsführer:
 Dipl.-Kfm. Holger Maczkowsky,
 Roman Maczkowsky

GnuPG-Key-ID: 0x2DD3A649

_______________________________________________
Pkg-mozext-maintainers mailing list
Pkg-mozext-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-mozext-maintainers

Reply via email to