summaryrefslogtreecommitdiff
path: root/www-misc/arkenfox
diff options
context:
space:
mode:
Diffstat (limited to 'www-misc/arkenfox')
-rw-r--r--www-misc/arkenfox/Manifest6
-rw-r--r--www-misc/arkenfox/arkenfox-126.1.ebuild2
-rw-r--r--www-misc/arkenfox/arkenfox-9999.ebuild67
3 files changed, 72 insertions, 3 deletions
diff --git a/www-misc/arkenfox/Manifest b/www-misc/arkenfox/Manifest
index ecb2224..3e9bc6e 100644
--- a/www-misc/arkenfox/Manifest
+++ b/www-misc/arkenfox/Manifest
@@ -1,2 +1,4 @@
-DIST 126.1.tar.gz 42646 BLAKE2B 8682f5d09833a8f8e8a3a57584b15ade46ffa807479744b366590b9bcb53f1c372b5d38fd0a22a60da4ba74d8696b89839164003c9661487fb50602e711d1f70 SHA512 1b17d105a7f0fb812ccd3c894d116a02fd69c873bae230970b62a4971a3c747143670c734effbeacf90c6d3c9fa5b9c1405d3286b22d452328987ece51e42341
-EBUILD arkenfox-126.1.ebuild 1875 BLAKE2B ac1dbe7c3de774d6529cb032889f8bddae5367c287421050bf3e036a361c0632a545a97c03a87a5b6967a549fb4bac04f9ac1bcd9bbd4da1c322e2471aab2748 SHA512 70d1980b7f4b5e2eaa988eb79c1416a869940cadb88970ed422175229ef58ff66ba9c0d7c1b8d36ed441c719e566247e1b50cfd5b2718e8bceec9ad0232eb708
+DIST arkenfox-126.1.tar.gz 42646 BLAKE2B 8682f5d09833a8f8e8a3a57584b15ade46ffa807479744b366590b9bcb53f1c372b5d38fd0a22a60da4ba74d8696b89839164003c9661487fb50602e711d1f70 SHA512 1b17d105a7f0fb812ccd3c894d116a02fd69c873bae230970b62a4971a3c747143670c734effbeacf90c6d3c9fa5b9c1405d3286b22d452328987ece51e42341
+DIST arkenfox-master.tar.gz 42744 BLAKE2B a89139a17de22c9d1ec071e9055d66440b7510decf9bfbd0c5297943815f89664781d7ba1d907ba5d02b0e43a7e360714c560cf5b8b494c31d19350ace4bfe35 SHA512 d881640606feb9aac266650f8af92932c25e1bf9b0aed92f7af69a76a812bc302f75dbd0a9a13ff82d46b3524f2cbf1ee8ee928e52c02f96dc2bb664ff2bfae3
+EBUILD arkenfox-126.1.ebuild 1901 BLAKE2B 89336730beabb223b468da6e430e15ebbd376527e00d19b58c49a2be363dae2c8f7b84b9ac5c77ebf5b35887bc52b14f931dc5f1fb9a9f623f5669205c7d9239 SHA512 0231856451e42fb2a6172f7c04ab92eacd67ed7ed9ef577392eea17f22bac38aaf3863c61f73afb93a10f991df29d0b6fca5ac48fa9ece25bcd9d9f26de77b5e
+EBUILD arkenfox-9999.ebuild 1905 BLAKE2B 1265e974bc8d3471313fe876cd52318066fa9226ceeadc1eec671484f4ffbb9b76660d28066ec8b0ad41cae178486e353ea865d345462d01d92111f67018a983 SHA512 57d5d8056c0bbcdd3a118b0e7f2f615fc5a2eb4eb0df1fd2225b1b883078528aa3d930911a80cf1dda7fb5eee4ee1115ca9c118caa0cfaf187a6c879253835b0
diff --git a/www-misc/arkenfox/arkenfox-126.1.ebuild b/www-misc/arkenfox/arkenfox-126.1.ebuild
index 21c10a5..02cdfdf 100644
--- a/www-misc/arkenfox/arkenfox-126.1.ebuild
+++ b/www-misc/arkenfox/arkenfox-126.1.ebuild
@@ -8,7 +8,7 @@ inherit savedconfig
DESCRIPTION="Firefox privacy, security and anti-tracking: a comprehensive user.js template for configuration and hardening"
HOMEPAGE="https://github.com/arkenfox/user.js"
VER="126.1"
-SRC_URI="https://github.com/arkenfox/user.js/archive/refs/tags/${VER}.tar.gz"
+SRC_URI="https://github.com/arkenfox/user.js/archive/refs/tags/${VER}.tar.gz -> arkenfox-${VER}.tar.gz"
LICENSE="MIT"
SLOT="0"
diff --git a/www-misc/arkenfox/arkenfox-9999.ebuild b/www-misc/arkenfox/arkenfox-9999.ebuild
new file mode 100644
index 0000000..2f9f496
--- /dev/null
+++ b/www-misc/arkenfox/arkenfox-9999.ebuild
@@ -0,0 +1,67 @@
+# Copyright 2024 Ivan Boikov
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit savedconfig
+
+DESCRIPTION="Firefox privacy, security and anti-tracking: a comprehensive user.js template for configuration and hardening"
+HOMEPAGE="https://github.com/arkenfox/user.js"
+VER="master"
+SRC_URI="https://github.com/arkenfox/user.js/archive/refs/heads/${VER}.tar.gz -> arkenfox-${VER}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+savedconfig"
+
+RDEPEND="
+"
+DEPEND="${RDEPEND}"
+BDEPEND=""
+
+S="${WORKDIR}"
+
+sanitize() {
+ # firefox is restrictive about the config content, so only leave the bare minimum
+ # arkenfox's updating script does a similar thing
+ cat "$1" | grep "user_pref" | grep -v "// user_pref" | sed "s/^user_pref/pref/g"
+}
+
+src_prepare() {
+ default
+
+ tar -xf "${DISTDIR}/${VER}.tar.gz"
+
+ restore_config user-overrides.js
+ if [ ! -f "user-overrides.js" ]; then
+ echo '// user_pref("parameter", "value")' > "user-overrides.js"
+ fi
+}
+
+src_compile() {
+ echo "// IMPORTANT: Start your code on the 2nd line" > "user.js-${VER}/arkenfox.cfg"
+ sanitize "user.js-${VER}/user.js" >> "user.js-${VER}/arkenfox.cfg"
+ sanitize "user-overrides.js" >> "user.js-${VER}/arkenfox.cfg"
+}
+
+src_install() {
+ # https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig
+ dodir "/etc/firefox/defaults/pref"
+ cat >> "${D}/etc/firefox/defaults/pref/autoconfig.js" << EOF
+pref("general.config.filename", "arkenfox.cfg");
+pref("general.config.obscure_value", 0);
+EOF
+
+ # it appears we can only install configs inside the install directory
+ if [ -d "/opt/firefox" ]; then # "firefox-bin" in installed
+ dodir "/opt/firefox"
+ cp "user.js-${VER}/arkenfox.cfg" "${D}/opt/firefox/"
+ fi
+ if [ -d "/usr/lib/firefox" ]; then # "firefox" in installed
+ dodir "/usr/lib/firefox"
+ cp "user.js-${VER}/arkenfox.cfg" "${D}/usr/lib/firefox/"
+ fi
+
+ save_config user-overrides.js
+}