summarylogtreecommitdiffstats
path: root/softplan-websigner.install
diff options
context:
space:
mode:
Diffstat (limited to 'softplan-websigner.install')
-rw-r--r--softplan-websigner.install35
1 files changed, 35 insertions, 0 deletions
diff --git a/softplan-websigner.install b/softplan-websigner.install
new file mode 100644
index 000000000000..d7345f900ad1
--- /dev/null
+++ b/softplan-websigner.install
@@ -0,0 +1,35 @@
+post_install() {
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+
+ # Chrome and Chromium uses the manifest file in the /etc dir, which is
+ # checked as an error in Litium package verification.
+ # Thus we are going to move the manifest file after installation.
+
+ # ensure that chrome and chromium extension manifest dir exists
+ CHROME_MANIFEST_DIR=/etc/opt/chrome/native-messaging-hosts/
+ CHROMIUM_MANIFEST_DIR=/etc/chromium/native-messaging-hosts/
+ mkdir -p $CHROME_MANIFEST_DIR
+ mkdir -p $CHROMIUM_MANIFEST_DIR
+
+ # copy manifest to respective dirs
+ cp /opt/softplan-websigner/manifest.json "$CHROME_MANIFEST_DIR"br.com.softplan.webpki.json
+ cp /opt/softplan-websigner/manifest.json "$CHROMIUM_MANIFEST_DIR"br.com.softplan.webpki.json
+
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+
+ # remove chromium and chrome manifests
+ CHROME_MANIFEST_DIR=/etc/opt/chrome/native-messaging-hosts/
+ CHROMIUM_MANIFEST_DIR=/etc/chromium/native-messaging-hosts/
+ rm -rf "$CHROME_MANIFEST_DIR"br.com.softplan.webpki.json
+ rm -rf "$CHROMIUM_MANIFEST_DIR"br.com.softplan.webpki.json
+
+ update-desktop-database -q
+}