From cd9b8b1438cfdf759053ea5500f9afeff785846a Mon Sep 17 00:00:00 2001 From: ivan-boikov Date: Fri, 7 Jun 2024 22:19:52 +0200 Subject: Arkenfox 126 --- www-misc/arkenfox/Manifest | 2 ++ www-misc/arkenfox/arkenfox-126.ebuild | 67 +++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 www-misc/arkenfox/arkenfox-126.ebuild diff --git a/www-misc/arkenfox/Manifest b/www-misc/arkenfox/Manifest index 6ebf5cb..13a2543 100644 --- a/www-misc/arkenfox/Manifest +++ b/www-misc/arkenfox/Manifest @@ -1,2 +1,4 @@ DIST 122.0.tar.gz 41602 BLAKE2B d8cab12236241baafda61c3e2f45ece3973246af7f3fb61d8618a06ed6a9e969d298f4c750b1e805a356a11e62280656cc961342052da24b29bd9c94d608452b SHA512 5c5dd630f762216b455abb60846f9655180dcd2aad2d32cc685f68af7c4f8d5937c138d42f426180375da89a5fa7614dac7e114f40071db4d254240d3fd2c29f +DIST 126.0.tar.gz 42663 BLAKE2B d31e1f95326c78c8324077e10f08a1f265da6ddce961d34499dd77e596c63f5f55315d297380165168f552546b95cbbc827261848d91f4982abde1cccb13f5b1 SHA512 9546ec8d06d3f97d1a076c711ed5608a1ff83fe24756ce31b24819c927ab4b3e83b2557f88742b0bfc72ed178fbc6a2aa19dad2332896650c66e4066ce73e929 EBUILD arkenfox-122.ebuild 1875 BLAKE2B 52c9da8c62cbf759ae4e69696b4445bf02fedc3ff8c6a30f055dd2c605dbbb7bd5f70d4446fe03003246f6871ac464385e2ab4808f532cfbccdcea559c6fb02a SHA512 f27d48ced19c70a1ff386e07d7e838c25a8318ccd047e81be2312e752b274a852a130eaf81f67b1a365ebaed4b4cb4a542556dba255e89d3e1916e13fcebad94 +EBUILD arkenfox-126.ebuild 1877 BLAKE2B 068ee17d09c4ad78b96f80727cad723d0dca03418f9403fb75e8f3eeb1b14a182e6263bdfcf00b322a6bcc86964f95cbdff1f5504a419c303b2a9fc35536ea58 SHA512 9a41068677686ec4d9f91e95ad84675eef7b1bebb79aa76315773443d42f75f39e63ab2e2da327bbfcf4067861289dfccf4cb6aa111637910fab2ca29145dd72 diff --git a/www-misc/arkenfox/arkenfox-126.ebuild b/www-misc/arkenfox/arkenfox-126.ebuild new file mode 100644 index 0000000..be38c6a --- /dev/null +++ b/www-misc/arkenfox/arkenfox-126.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="126.0" +SRC_URI="https://github.com/arkenfox/user.js/archive/refs/tags/${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 +} -- cgit v1.2.3