forked from Syncplay/syncplay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (69 loc) · 2.58 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
SINGLE_USER = false
ifndef VLC_SUPPORT
VLC_SUPPORT = true
endif
BASE_PATH = /usr
LOCAL_PATH = ~/.local
ifeq ($(SINGLE_USER),false)
BIN_PATH = ${PREFIX}$(BASE_PATH)/bin
LIB_PATH = ${PREFIX}$(BASE_PATH)/lib
APP_SHORTCUT_PATH = ${PREFIX}$(BASE_PATH)/share/applications
SHARE_PATH = ${PREFIX}$(BASE_PATH)/share
else
BIN_PATH = $(LOCAL_PATH)/syncplay
LIB_PATH = $(LOCAL_PATH)/syncplay
APP_SHORTCUT_PATH = $(LOCAL_PATH)/share/applications
SHARE_PATH = $(LOCAL_PATH)/share
endif
common:
-mkdir -p $(LIB_PATH)/syncplay/resources/
-mkdir -p $(LIB_PATH)/syncplay/resources/lua
-mkdir -p $(LIB_PATH)/syncplay/resources/lua/intf
-mkdir -p $(APP_SHORTCUT_PATH)
-mkdir -p $(SHARE_PATH)/app-install/icons
-mkdir -p $(SHARE_PATH)/pixmaps/
cp -r syncplay $(LIB_PATH)/syncplay/
chmod 755 $(LIB_PATH)/syncplay/
cp -r resources/hicolor $(SHARE_PATH)/icons/
cp -r resources/*.png $(LIB_PATH)/syncplay/resources/
cp -r resources/lua/intf/*.lua $(LIB_PATH)/syncplay/resources/lua/intf/
cp resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/app-install/icons/
cp resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/pixmaps/
u-common:
-rm -rf $(LIB_PATH)/syncplay
-rm $(SHARE_PATH)/icons/hicolor/*/apps/syncplay.png
-rm $(SHARE_PATH)/app-install/icons/syncplay.png
-rm $(SHARE_PATH)/pixmaps/syncplay.png
client:
-mkdir -p $(BIN_PATH)
cp syncplayClient.py $(BIN_PATH)/syncplay
sed -i -e 's%# libpath%site.addsitedir\("$(BASE_PATH)/lib/syncplay"\)%' $(BIN_PATH)/syncplay
chmod 755 $(BIN_PATH)/syncplay
cp syncplayClient.py $(LIB_PATH)/syncplay/
cp resources/syncplay.desktop $(APP_SHORTCUT_PATH)/
ifeq ($(VLC_SUPPORT),true)
-mkdir -p $(LIB_PATH)/vlc/lua/intf/
cp resources/lua/intf/syncplay.lua $(LIB_PATH)/vlc/lua/intf/
endif
u-client:
-rm $(BIN_PATH)/syncplay
-rm $(LIB_PATH)/syncplay/syncplayClient.py
-rm $(LIB_PATH)/vlc/lua/intf/syncplay.lua
-rm $(APP_SHORTCUT_PATH)/syncplay.desktop
server:
-mkdir -p $(BIN_PATH)
cp syncplayServer.py $(BIN_PATH)/syncplay-server
sed -i -e 's%# libpath%site.addsitedir\("$(BASE_PATH)/lib/syncplay"\)%' $(BIN_PATH)/syncplay-server
chmod 755 $(BIN_PATH)/syncplay-server
cp syncplayServer.py $(LIB_PATH)/syncplay/
cp resources/syncplay-server.desktop $(APP_SHORTCUT_PATH)/
u-server:
-rm $(BIN_PATH)/syncplay-server
-rm $(LIB_PATH)/syncplay/syncplayServer.py
-rm $(APP_SHORTCUT_PATH)/syncplay-server.desktop
install-client: common client
uninstall-client: u-client u-common
install-server: common server
uninstall-server: u-server u-common
install: common client server
uninstall: u-client u-server u-common