-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathicecat-hardened.slackbuild
executable file
·94 lines (66 loc) · 3.67 KB
/
icecat-hardened.slackbuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
# Slackware build script for icecat-hardened which make your icecat start
# under firejail and eqquiped with several privacy-enhanced add-ons:
# Noscript, ublock and User-Agent Switcher.
# Written by MDrights <[email protected]>
# With some code copy-pasted from the PKGBUILDs (iceweasel-hardened-
# preferences et al) in Parabola GNU/linux-libre.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version, with the following exception:
# the text of the GPL license may be omitted.
# This program is distributed in the hope that it will be useful, but
# without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose. Compiling,
# interpreting, executing or merely reading the text of the program
# may result in lapses of consciousness and/or very being, up to and
# including the end of all existence and the Universe as we know it.
# See the GNU General Public License for more details.
# You may have received a copy of the GNU General Public License along
# with this program (most likely, a file named COPYING). If not, see
# <http://www.gnu.org/licenses/>.
# NOTE: You don't need to run it as root.
set -eu
# Check icecat version.
ls /var/log/packages/icecat* | awk -F"-" '{ print $2 }' || (echo "Error: You didn't install icecat yet!" ; exit 1)
ICVER=$(ls /var/log/packages/icecat* | awk -F"-" '{ print $2 }' | sed -n '1 p')
# ICVER=52.3.0
# Check if firejail is installed.
a=$(ls /var/log/packages/firejail* 2>/dev/null)
if [ "$a" = "" ] ; then echo "Error: You didn't install firejail yet! quit..."; exit 1; fi
PRGNAM=icecat-hardened
VERSION=${VERSION:-0.3.0}
BUILD=${BUILD:-2}
TAG=${TAG:-_MD}
# Ignore the arch identification since we assume you are using 64bit OS :).
ARCH=x86_64
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
DESTDIR="usr/lib64/icecat-${ICVER}/browser/extensions"
rm -rf $PKG
mkdir -p $PKG
mkdir -p $PKG/$DESTDIR
# Please download the add-ons by hand if you have not yet (see download-addons.sh). However it seems some addons isn't compatible for doing in this way. And please BE AWARE of the addons you installed. Do it at your own risk.
# Will firstly copy user specific config and addons to the icecat install dir, then copy them to user's own dir by icecat-hardened.sh. This due to that user's icecat dir does not exist before first run.
cd $CWD
install -Dm644 https-everywhere-eff\@eff.org.xpi ${PKG}/${DESTDIR}/https-everywhere-eff\@eff.org.xpi
install -Dm644 jid1-MnnxcxisBPnSXQ-eff\@jetpack.xpi ${PKG}/${DESTDIR}/jid1-MnnxcxisBPnSXQ-eff\@jetpack.xpi
install -Dm644 langpack-zh-CN\@icecat.mozilla.org.xpi ${PKG}/${DESTDIR}/langpack-zh-CN\@icecat.mozilla.org.xpi
install -Dm644 {73a6fe31-595d-460b-a920-fcc0f8843232}.xpi ${PKG}/${DESTDIR}/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi
mkdir -p /usr/lib64/icecat-${ICVER}/defaults/pref/
install -Dm 644 user.js $PKG/usr/lib64/icecat-${ICVER}/defaults/pref/user.js
mkdir -p $PKG/usr/share/$PRGNAM
cat slack-desc > $PKG/usr/share/$PRGNAM/slack-desc
cat icecat-hardened.info > $PKG/usr/share/$PRGNAM/icecat-hardened.info
cat icecat-hardened.slackbuild > $PKG/usr/share/$PRGNAM/icecat-hardened.slackbuild
install -Dm755 icecat-hardened.sh $PKG/usr/bin/icecat-hardened
mkdir -p $PKG/install
cat doinst.sh > $PKG/install/doinst.sh
# Desktop integration
mkdir -p $PKG/usr/share/applications
cat $CWD/icecat-hardened.desktop > $PKG/usr/share/applications/icecat-hardened.desktop
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}