2014-08-14 18:51:39 +00:00
SINGLE_USER = false
i f n d e f V L C _ S U P P O R T
VLC_SUPPORT = true
e n d i f
2014-09-12 21:51:52 +00:00
i f e q ( $( shell uname ) ) , F r e e B S D )
BSD = true
e n d i f
i f e q ( $( shell uname ) ) , N e t B S D )
BSD = true
e n d i f
i f e q ( $( shell uname ) ) , O p e n B S D )
BSD = true
e n d i f
i f e q ( $( shell uname ) ) , D r a g o n F l y )
BSD = true
e n d i f
2014-08-14 18:51:39 +00:00
i f e q ( $( SINGLE_USER ) , f a l s e )
2014-09-12 21:51:52 +00:00
i f n e q ( $( BSD ) , t r u e )
2014-08-14 18:51:39 +00:00
BASE_PATH = /usr
VLC_LIB_PATH = ${ PREFIX } /usr/lib
2014-09-12 21:51:52 +00:00
e l s e
BASE_PATH = /usr/local
VLC_LIB_PATH = ${ PREFIX } /usr/local/lib
e n d i f
2014-08-14 18:51:39 +00:00
e l s e
BASE_PATH = ${ HOME } /.local
VLC_LIB_PATH = ${ HOME } /.local/share
e n d i f
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
common :
-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) /
i f e q ( $( SINGLE_USER ) , f a l s e )
chmod 755 $( APP_SHORTCUT_PATH) /syncplay.desktop
e n d i f
i f e q ( $( VLC_SUPPORT ) , t r u e )
-mkdir -p $( VLC_LIB_PATH) /vlc/lua/intf/
cp resources/lua/intf/syncplay.lua $( VLC_LIB_PATH) /vlc/lua/intf/
e n d i f
u-client :
-rm $( BIN_PATH) /syncplay
-rm $( LIB_PATH) /syncplay/syncplayClient.py
-rm $( VLC_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) /
i f e q ( $( SINGLE_USER ) , f a l s e )
chmod 755 $( APP_SHORTCUT_PATH) /syncplay-server.desktop
e n d i f
u-server :
-rm $( BIN_PATH) /syncplay-server
-rm $( LIB_PATH) /syncplay/syncplayServer.py
-rm $( APP_SHORTCUT_PATH) /syncplay-server.desktop
warnings :
i f e q ( $( SINGLE_USER ) , t r u e )
@echo -e " \n**********\n**********\n \nRemeber to add ${ HOME } /.local/bin to your \$ $PATH with 'echo \"export PATH=\$ $PATH : ${ HOME } /.local/bin\" >> ${ HOME } /.profile' \nThis will take effect after you logoff.\n \n**********\n**********\n "
e n d i f
install-client : common client warnings
uninstall-client : u -client u -common
install-server : common server warnings
uninstall-server : u -server u -common
install : common client server warnings
uninstall : u -client u -server u -common