2014-08-14 18:51:39 +00:00
SINGLE_USER = false
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 )
2016-09-03 15:50:18 +00:00
PREFIX ?= /usr
VLC_LIB_PATH = ${ PREFIX } /lib
2017-01-23 21:10:30 +00:00
VLC_LIB_PATH64 = ${ PREFIX } /lib/x86_64-linux-gnu
2014-09-12 21:51:52 +00:00
e l s e
2017-01-23 21:10:30 +00:00
PREFIX ?= /usr/local
2016-09-03 15:50:18 +00:00
VLC_LIB_PATH = ${ PREFIX } /lib
2017-01-23 21:10:30 +00:00
VLC_LIB_PATH64 = ${ PREFIX } /lib
2014-09-12 21:51:52 +00:00
e n d i f
2014-08-14 18:51:39 +00:00
e l s e
2016-09-03 15:50:18 +00:00
PREFIX = ${ HOME } /.local
2014-08-14 18:51:39 +00:00
VLC_LIB_PATH = ${ HOME } /.local/share
2017-01-23 21:10:30 +00:00
VLC_LIB_PATH64 = ${ HOME } /.local/share
2014-08-14 18:51:39 +00:00
e n d i f
2016-09-03 15:50:18 +00:00
BIN_PATH = ${ DESTDIR } ${ PREFIX } /bin
LIB_PATH = ${ DESTDIR } ${ PREFIX } /lib
APP_SHORTCUT_PATH = ${ DESTDIR } ${ PREFIX } /share/applications
SHARE_PATH = ${ DESTDIR } ${ PREFIX } /share
2014-08-14 18:51:39 +00:00
common :
2019-04-13 13:39:55 +00:00
-mkdir -p $( LIB_PATH) /syncplay/syncplay/resources/lua/intf
2014-08-14 18:51:39 +00:00
-mkdir -p $( APP_SHORTCUT_PATH)
2020-05-25 21:34:04 +00:00
-mkdir -p $( SHARE_PATH) /pixmaps/
2020-11-29 18:20:00 +00:00
-mkdir -p $( SHARE_PATH) /icons/
2021-03-07 19:16:35 +00:00
-mkdir -p $( SHARE_PATH) /man/man1/
2014-08-14 18:51:39 +00:00
cp -r syncplay $( LIB_PATH) /syncplay/
chmod 755 $( LIB_PATH) /syncplay/
2019-04-13 13:39:55 +00:00
cp -r syncplay/resources/hicolor $( SHARE_PATH) /icons/
cp -r syncplay/resources/*.png $( LIB_PATH) /syncplay/syncplay/resources/
cp -r syncplay/resources/*.lua $( LIB_PATH) /syncplay/syncplay/resources/
cp -r syncplay/resources/lua/intf/*.lua $( LIB_PATH) /syncplay/syncplay/resources/lua/intf/
2020-05-25 21:26:16 +00:00
cp syncplay/resources/hicolor/128x128/apps/syncplay.png $( SHARE_PATH) /pixmaps/
2014-08-14 18:51:39 +00:00
u-common :
-rm -rf $( LIB_PATH) /syncplay
-rm $( SHARE_PATH) /icons/hicolor/*/apps/syncplay.png
2020-05-25 21:26:16 +00:00
-rm $( SHARE_PATH) /pixmaps/syncplay.png
2021-03-07 19:16:35 +00:00
-rm $( SHARE_PATH) /man/man1/syncplay.1.gz
2014-08-14 18:51:39 +00:00
client :
-mkdir -p $( BIN_PATH)
cp syncplayClient.py $( BIN_PATH) /syncplay
2018-07-28 21:10:41 +00:00
sed -i -e '/# libpath/ a\import site\nsite.addsitedir\("${PREFIX}/lib/syncplay"\)' $( BIN_PATH) /syncplay
2014-08-14 18:51:39 +00:00
chmod 755 $( BIN_PATH) /syncplay
cp syncplayClient.py $( LIB_PATH) /syncplay/
2019-04-13 13:39:55 +00:00
cp syncplay/resources/syncplay.desktop $( APP_SHORTCUT_PATH) /
2021-03-07 19:16:35 +00:00
gzip docs/syncplay.1 --stdout > $( SHARE_PATH) /man/man1/syncplay.1.gz
2014-08-14 18:51:39 +00:00
u-client :
-rm $( BIN_PATH) /syncplay
-rm $( LIB_PATH) /syncplay/syncplayClient.py
2016-09-03 15:50:18 +00:00
-rm ${ DESTDIR } $( VLC_LIB_PATH) /vlc/lua/intf/syncplay.lua
2017-01-23 21:10:30 +00:00
-rm ${ DESTDIR } $( VLC_LIB_PATH64) /vlc/lua/intf/syncplay.lua
2014-08-14 18:51:39 +00:00
-rm $( APP_SHORTCUT_PATH) /syncplay.desktop
2021-03-07 19:16:35 +00:00
-rm $( SHARE_PATH) /man/man1/syncplay.1.gz
2014-08-14 18:51:39 +00:00
server :
-mkdir -p $( BIN_PATH)
cp syncplayServer.py $( BIN_PATH) /syncplay-server
2018-07-28 21:10:41 +00:00
sed -i -e '/# libpath/ a\import site\nsite.addsitedir\("${PREFIX}/lib/syncplay"\)' $( BIN_PATH) /syncplay-server
2014-08-14 18:51:39 +00:00
chmod 755 $( BIN_PATH) /syncplay-server
cp syncplayServer.py $( LIB_PATH) /syncplay/
2019-04-13 13:39:55 +00:00
cp syncplay/resources/syncplay-server.desktop $( APP_SHORTCUT_PATH) /
2021-03-07 19:16:35 +00:00
gzip docs/syncplay-server.1 --stdout > $( SHARE_PATH) /man/man1/syncplay-server.1.gz
2014-08-14 18:51:39 +00:00
u-server :
-rm $( BIN_PATH) /syncplay-server
-rm $( LIB_PATH) /syncplay/syncplayServer.py
-rm $( APP_SHORTCUT_PATH) /syncplay-server.desktop
2021-03-07 19:16:35 +00:00
-rm $( SHARE_PATH) /man/man1/syncplay-server.1.gz
2014-08-14 18:51:39 +00:00
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
2021-03-07 19:16:35 +00:00
uninstall-client : u -client u -common
2014-08-14 18:51:39 +00:00
install-server : common server warnings
uninstall-server : u -server u -common
2021-03-07 19:16:35 +00:00
install : common client server warnings
2014-08-14 18:51:39 +00:00
uninstall : u -client u -server u -common