-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (40 loc) · 1.21 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
CURDIR := $(shell pwd)
ARCH ?= x64
VERSION ?= 0.2
REPO_NAME := nativefier/nativefier
CONTAINER_NAME := notion_builder
.PHONY: check-root
check-root:
ifneq ($(shell id -u), 0)
echo "Root privileges is required"
exit 1
endif
.PHONY: clean
clean:
rm -rf $(CURDIR)/nativefier $(CURDIR)/notion-linux-$(ARCH)
docker rmi -f $(REPO_NAME)
docker rm $(CONTAINER_NAME)
.PHONY: uninstall
uninstall:
rm -rf /usr/share/notion \
/usr/share/applications/notion.desktop \
/usr/bin/notion
notion-linux-$(ARCH):
docker run \
-v $(CURDIR):/src \
-v $(CURDIR):/target \
--name $(CONTAINER_NAME) \
$(REPO_NAME) \
--inject /src/scrollbar.css \
--icon /src/icon.png \
--name notion -p linux -a $(ARCH) https://notion.so/ /target/
sed -i \
-e 's/-nativefier-[a-zA-Z0-9]\+//g' \
-e 's/"version":"1.0.0"/"version":"$(VERSION)"/g' \
$(CURDIR)/notion-linux-$(ARCH)/resources/app/package.json
notion-linux-$(ARCH).tar.gz: notion-linux-$(ARCH)
tar -zcf notion_$(VERSION).tar.gz notion-linux-$(ARCH)
install: check-root uninstall notion-linux-$(ARCH)
cp -r $(CURDIR)/notion-linux-$(ARCH) /usr/share/notion
cp -u $(CURDIR)/notion.desktop /usr/share/applications/notion.desktop
ln -sf /usr/share/notion/notion /usr/bin/notion