forked from cs50/ide50-deb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
95 lines (84 loc) · 2.27 KB
/
Makefile
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
94
95
FILES_DIR := files
C9SDK_DIR := $(FILES_DIR)/var/c9sdk
CONFIGS_DIR := $(C9SDK_DIR)/configs/ide
OFFLINE_DIR := /tmp/ide
PLUGINS_DIR := $(C9SDK_DIR)/plugins
VERSION_FILE := $(FILES_DIR)/etc/version50
PLUGINS := audioplayer browser cat debug gist hex info presentation simple statuspage theme
NAME := ide50
VERSION := 158
define getplugin
@echo "\nFetching $(1)..."
@plugin_dir="$(PLUGINS_DIR)/c9.ide.cs50.$(1)"; \
mkdir -p "$$plugin_dir"; \
git clone --depth=1 "https://github.com/cs50/harvard.cs50.$(1).git" "$$plugin_dir"; \
rm -rf "$$plugin_dir/README.md" "$$plugin_dir/.git"*
endef
.PHONY: bash
bash:
docker run -i --rm -t -v "$(PWD):/root" cs50/cli
.PHONY: deb
deb: clean Makefile
@echo "\nDownloading latest CS50 plugins..."
$(foreach plugin,$(PLUGINS),$(call getplugin,$(plugin)))
@echo "\nFetching latest offline configs..."
mkdir -p "$(CONFIGS_DIR)"
git clone --depth=1 https://github.com/cs50/ide.git "$(OFFLINE_DIR)"
@cp "$(OFFLINE_DIR)"/files/workspace-cs50.js "$(CONFIGS_DIR)"
@echo "\nBuilding Deb..."
echo "version=$(VERSION)" > "$(VERSION_FILE)"
# set permissions
chmod -R 755 "$(FILES_DIR)/usr/bin/"
chmod 644 "$(VERSION_FILE)" "$(FILES_DIR)/etc/profile.d/ide50.sh" "$(FILES_DIR)/home/ubuntu/.cs50/prompt"
fpm \
-C "$(FILES_DIR)" \
--after-install postinst \
--category misc \
--deb-changelog changelog \
--deb-no-default-config-files \
--deb-priority optional \
--depends \
"adminer50 (>= 1.0.1), \
apache2, \
astyle (>= 3.0.1), \
bc, \
clang-3.8, \
dnsutils, \
dos2unix, \
git (>= 1:2.13.0), \
git-lfs (>= 2.3.4), \
gdbserver, \
inotify-tools, \
libcs50-java (>= 2.0.2), \
libphp-phpmailer, \
libxslt1-dev, \
manpages-dev, \
ngrok-client, \
nodejs, \
openjdk-7-jdk, \
pgloader (>= 3.4.1), \
php-cs50 (>= 6.0.0), \
php5-cgi, \
php5-curl, \
php5-sqlite, \
php5-xdebug, \
phpliteadmin (>= 1.4.0), \
sqlite3, \
telnet, \
traceroute, \
wamerican, \
whois" \
--license "" \
--maintainer "CS50 <[email protected]>" \
-n "$(NAME)" \
-s dir \
-t deb \
-v $(VERSION) \
--vendor CS50 \
--description "installs necessary software on CS50 IDE" \
--provides "$(NAME)" \
--url "https://github.com/cs50" \
.
clean:
@echo "Cleaning up..."
rm -rf *.deb "$(C9SDK_DIR)" "$(OFFLINE_DIR)" "$(VERSION_FILE)"