mobile-config-firefox/Makefile
Arnaud Ferraris 712b850c3b install userChrome.css using autoconfig instead of schell scripts (MR 2)
Firefox can run an autoconfig Javascript on startup, which can be used to
install and update userChrome.css, both when creating a new profile and
using a pre-existing one.

This removes the need for a wrapper script and related complications
(changes to $PATH, different processing for new and pre-existing
profiles...)

Co-Authored-By: Oliver Smith <ollieparanoid@postmarketos.org>
2020-08-21 10:49:49 +02:00

37 lines
1.1 KiB
Makefile

# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
USERCHROME_FILES := $(sort $(wildcard src/userChrome/*.css))
HOMEPAGE_FILES := head.html distro_links.html bottom.html
DISTRO := postmarketOS
DESTDIR :=
FIREFOX_DIR := /usr/lib/firefox
all: out/home.html out/userChrome.css
clean:
rm -rf out
out:
mkdir out
out/home.html: src/homepage/*.html out
( cd src/homepage; cat $(HOMEPAGE_FILES) ) > $@.temp
sed "s/@DISTRO@/$(DISTRO)/g" "$@.temp" > "$@"
rm "$@.temp"
out/userChrome.css: $(USERCHROME_FILES) out
cat $(USERCHROME_FILES) > $@
install: all
install -Dm644 src/policies.json \
"$(DESTDIR)/etc/firefox/policies/policies.json"
install -Dm644 src/prefs.js \
"$(DESTDIR)/$(FIREFOX_DIR)/defaults/pref/mobile-config.js"
install -Dm644 src/mobile-config-autoconfig.js \
"$(DESTDIR)/$(FIREFOX_DIR)/mobile-config-autoconfig.js"
install -Dm644 "out/home.html" \
"$(DESTDIR)/usr/share/mobile-config-firefox/home.html"
install -Dm644 "out/userChrome.css" \
"$(DESTDIR)/etc/mobile-config-firefox/userChrome.css"
.PHONY: all clean install