-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathturnkey.mk
More file actions
72 lines (58 loc) · 2.87 KB
/
turnkey.mk
File metadata and controls
72 lines (58 loc) · 2.87 KB
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
RELEASE ?= debian/$(shell lsb_release -s -c)
CDROOT ?= gfxboot-turnkey
HOSTNAME ?= $(shell basename "$(shell pwd)")
# general TKL vars
CONF_VARS += HOSTNAME ROOT_PASS NONFREE BACKPORTS_NONFREE TKL_TESTING BACKPORTS
# set specific software versions
CONF_VARS += PHP_VERSION RUBY_VER NODE_VER YARN_VER
# Webmin/firewall related
CONF_VARS += WEBMIN_THEME WEBMIN_FW_TCP_INCOMING WEBMIN_FW_TCP_INCOMING_REJECT WEBMIN_FW_UDP_INCOMING WEBMIN_FW_NAT_EXTRA WEBMIN_FW_MANGLE_EXTRA
# these are needed to control styling of credits (e.g., conf/apache-credit)
CONF_VARS += CREDIT_STYLE CREDIT_STYLE_EXTRA CREDIT_ANCHORTEXT CREDIT_LOCATION
# these are needed to ensure github queries don't get limited
CONF_VARS += GITHUB_USER GITHUB_USER_TOKEN
# for dynamically adding pins to sury & backports respectively
CONF_VARS += PHP_EXTRA_PINS BACKPORTS_PINS
COMMON_OVERLAYS := turnkey.d $(COMMON_OVERLAYS)
COMMON_CONF := turnkey.d $(COMMON_CONF)
COMMON_REMOVELISTS += turnkey
COMMON_REMOVELISTS_FINAL += turnkey
FAB_SHARE_PATH ?= /usr/share/fab
APT_OVERLAY = fab-apply-overlay $(COMMON_OVERLAYS_PATH)/bootstrap_apt $O/bootstrap;
# below hacks allow inheritors to define their own hooks, which will be
# prepended. warning: first line *needs* to be empty for this to work
# setup apt and dns for root.build
define _bootstrap/post
$(APT_OVERLAY)
fab-chroot $O/bootstrap "echo nameserver 8.8.8.8 > /etc/resolv.conf";
fab-chroot $O/bootstrap "echo nameserver 8.8.4.4 >> /etc/resolv.conf";
mkdir -p $O/bootstrap/usr/local/share/ca-certificates/;
# temporarily allow cert to not exist
cp /usr/local/share/ca-certificates/squid_proxyCA.crt $O/bootstrap/usr/local/share/ca-certificates/ || true;
fab-chroot $O/bootstrap --script $(COMMON_CONF_PATH)/bootstrap_apt;
endef
bootstrap/post += $(_bootstrap/post)
# tag package management system with release package
# set /etc/turnkey_version and apt user-agent
define _root.patched/post
#
# tagging package management system with release package
# setting /etc/turnkey_version and apt user-agent
#
@if [ -f ./changelog ]; then \
echo $(FAB_SHARE_PATH)/make-release-deb.py ./changelog $O/root.patched; \
$(FAB_SHARE_PATH)/make-release-deb.py ./changelog $O/root.patched; \
turnkey_version=$$($(FAB_SHARE_PATH)/turnkey-version.py --dist=$(CODENAME) --tag=$(VERSION_TAG) ./changelog $(FAB_ARCH)); \
turnkey_aptconf="Acquire::http::User-Agent \"TurnKey APT-HTTP/1.3 ($$turnkey_version)\";"; \
echo $$turnkey_version > $O/root.patched/etc/turnkey_version; \
echo $$turnkey_aptconf > $O/root.patched/etc/apt/apt.conf.d/01turnkey; \
else \
echo; \
echo "WARNING: can't tag local release (./changelog doesn't exist)"; \
echo; \
fi
fab-chroot $O/root.patched "dpkg -i *.deb && rm *.deb && rm -f /var/log/dpkg.log"
fab-chroot $O/root.patched "which postsuper >/dev/null && postsuper -d ALL || true"
endef
root.patched/post += $(_root.patched/post)
include $(FAB_SHARE_PATH)/product.mk