aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRahiel Kasim <rahiel@protonmail.ch>2016-01-06 22:07:05 +0100
committerRahiel Kasim <rahiel@protonmail.ch>2016-01-06 22:07:05 +0100
commitd22b10589d6818c891266d049779af5d42c54757 (patch)
treef13e9db6d324646511665c9728574174d26b5f16
parent83b51ed4a2ce04a30be0b4edf2e85a243264224b (diff)
dpkg triggers to automatically restore on desktop file updates
-rw-r--r--.gitignore1
-rw-r--r--release/deb-postinst.sh7
-rw-r--r--release/deb-postrm.sh7
-rw-r--r--release/deb-prerm.sh7
-rwxr-xr-xrelease/make-deb.bash22
5 files changed, 44 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 029cd93..cc4066f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ dist
build
*.egg-info
__pycache__
+*.deb
diff --git a/release/deb-postinst.sh b/release/deb-postinst.sh
new file mode 100644
index 0000000..bfcb965
--- /dev/null
+++ b/release/deb-postinst.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "triggered" ]; then
+ firectl restore
+fi
diff --git a/release/deb-postrm.sh b/release/deb-postrm.sh
new file mode 100644
index 0000000..39e016d
--- /dev/null
+++ b/release/deb-postrm.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "purge" ]; then
+ rm -f /etc/firejail/firectl.conf
+fi
diff --git a/release/deb-prerm.sh b/release/deb-prerm.sh
new file mode 100644
index 0000000..2d3bdfe
--- /dev/null
+++ b/release/deb-prerm.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "remove" ]; then
+ firectl disable all
+fi
diff --git a/release/make-deb.bash b/release/make-deb.bash
new file mode 100755
index 0000000..a7e4dd7
--- /dev/null
+++ b/release/make-deb.bash
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+OS=$1
+
+if [[ $OS = 'debian' ]]; then
+ echo 'Building deb for Debian'
+ click='python3-click'
+else
+ echo 'Building deb for Ubuntu'
+ click='python3-click-cli'
+fi
+
+fpm -s python -t deb \
+ --python-bin python3 --python-pip pip3 \
+ -n 'firectl' \
+ -d 'firejail' \
+ -d $click --no-python-dependencies \
+ --after-install 'deb-postinst.sh' \
+ --deb-interest '/usr/share/applications' \
+ --before-remove 'deb-prerm.sh' \
+ --after-remove 'deb-postrm.sh' \
+ --iteration 1 \
+ ../setup.py