Merge pull request #30 from blaenk/packageable

make syncplay packageable
This commit is contained in:
Daniel Wróbel 2013-12-28 13:05:36 -08:00
commit 801ae8dd47
3 changed files with 21 additions and 9 deletions

View File

@ -8,10 +8,10 @@ BASE_PATH = /usr
LOCAL_PATH = ~/.local
ifeq ($(SINGLE_USER),false)
BIN_PATH = $(BASE_PATH)/bin
LIB_PATH = $(BASE_PATH)/lib
APP_SHORTCUT_PATH = $(BASE_PATH)/share/applications
SHARE_PATH = $(BASE_PATH)/share
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
@ -23,6 +23,9 @@ 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/
@ -39,8 +42,8 @@ u-common:
client:
-mkdir -p $(BIN_PATH)
touch $(BIN_PATH)/syncplay
echo '#!/bin/sh\npython -OO $(LIB_PATH)/syncplay/syncplayClient.py "$$@"' > $(BIN_PATH)/syncplay
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)/
@ -58,8 +61,8 @@ u-client:
server:
-mkdir -p $(BIN_PATH)
touch $(BIN_PATH)/syncplay-server
echo '#!/bin/sh\npython -OO $(LIB_PATH)/syncplay/syncplayServer.py "$$@"' > $(BIN_PATH)/syncplay-server
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)/

View File

@ -1,7 +1,12 @@
#!/usr/bin/env python
import site
# libpath
from syncplay.clientManager import SyncplayClientManager
from syncplay.utils import blackholeStdoutForFrozenWindow
if(__name__ == '__main__'):
blackholeStdoutForFrozenWindow()
SyncplayClientManager().run()

View File

@ -1,6 +1,10 @@
#!/usr/bin/env python
#coding:utf8
import site
# libpath
from twisted.internet import reactor
from syncplay.server import SyncFactory, SyncIsolatedFactory, ConfigurationGetter