[744d192] | 1 | #!/usr/bin/make -f |
---|
| 2 | # -*- makefile -*- |
---|
| 3 | |
---|
| 4 | # Directories |
---|
| 5 | SOURCEDIR := ../src |
---|
| 6 | DESTDIR := /usr/local |
---|
| 7 | LIBDIR := $(DESTDIR)/share/OGAgent |
---|
| 8 | BINDIR := $(DESTDIR)/bin |
---|
| 9 | SBINDIR = $(DESTDIR)/sbin |
---|
| 10 | #APPSDIR := $(DESTDIR)/usr/share/applications |
---|
| 11 | CFGDIR := $(DESTDIR)/etc/ogagent |
---|
[96b942a] | 12 | INITDIR := /Library/LaunchDaemons |
---|
[744d192] | 13 | #XDGAUTOSTARTDIR := $(DESTDIR)/etc/xdg/autostart |
---|
| 14 | #KDEAUTOSTARTDIR := $(DESTDIR)/usr/share/autostart |
---|
| 15 | |
---|
| 16 | PYC := $(shell find $(SOURCEDIR) -name '*.py[co]') |
---|
| 17 | CACHES := $(shell find $(SOURCEDIR) -name '__pycache__') |
---|
| 18 | |
---|
| 19 | clean: |
---|
| 20 | rm -rf $(PYC) $(CACHES) |
---|
| 21 | |
---|
| 22 | install: |
---|
| 23 | dependencies |
---|
| 24 | install-ogagent |
---|
| 25 | |
---|
| 26 | dependencies: |
---|
| 27 | easy_install pip # Si no existe pip. |
---|
| 28 | # comprobar versión de six, descargar e instalar con easy_install. |
---|
| 29 | easy_install netifaces |
---|
| 30 | |
---|
| 31 | install-ogagent: |
---|
| 32 | mkdir -p $(LIBDIR) |
---|
| 33 | mkdir -p $(BINDIR) |
---|
| 34 | mkdir -p $(SBINDIR) |
---|
| 35 | mkdir -p $(CFGDIR) |
---|
| 36 | |
---|
| 37 | mkdir -p $(LIBDIR)/img |
---|
| 38 | |
---|
| 39 | # Cleans up .pyc and cache folders |
---|
| 40 | rm -f $(PYC) $(CACHES) |
---|
| 41 | |
---|
| 42 | cp -r $(SOURCEDIR)/opengnsys $(LIBDIR)/opengnsys |
---|
| 43 | cp -r $(SOURCEDIR)/cfg $(LIBDIR)/cfg |
---|
| 44 | cp $(SOURCEDIR)/img/oga.png $(LIBDIR)/img |
---|
| 45 | |
---|
| 46 | cp $(SOURCEDIR)/OGAgentUser.py $(LIBDIR) |
---|
| 47 | # QT Dialogs & resources |
---|
| 48 | #cp $(SOURCEDIR)/*_ui.py $(LIBDIR) |
---|
| 49 | #cp $(SOURCEDIR)/OGAgent_rc.py $(LIBDIR) |
---|
| 50 | |
---|
| 51 | # Autostart elements for gnome/kde |
---|
| 52 | #cp desktop/OGAgentTool.desktop $(XDGAUTOSTARTDIR) |
---|
| 53 | #cp desktop/OGAgentTool.desktop $(KDEAUTOSTARTDIR) |
---|
| 54 | |
---|
| 55 | # scripts |
---|
| 56 | cp scripts/ogagent $(BINDIR) |
---|
| 57 | cp scripts/OGAgentTool-startup $(BINDIR) |
---|
| 58 | cp scripts/OGAgentTool $(BINDIR) |
---|
[96b942a] | 59 | cp scripts/es.opengnsys.ogagent.plist $(INITDIR) |
---|
[744d192] | 60 | |
---|
| 61 | # Fix permissions |
---|
| 62 | chmod 755 $(BINDIR)/ogagent |
---|
| 63 | chmod 755 $(BINDIR)/OGAgentTool-startup |
---|
| 64 | chmod 755 $(LIBDIR)/OGAgentUser.py |
---|
| 65 | chmod 600 $(LIBDIR)/cfg/ogagent.cfg |
---|
| 66 | |
---|
| 67 | ln -fs $(LIBDIR)/cfg/ogagent.cfg $(CFGDIR) |
---|
| 68 | ln -fs $(LIBDIR)/cfg/ogclient.cfg $(CFGDIR) |
---|
| 69 | |
---|
| 70 | uninstall: |
---|
| 71 | rm -rf $(LIBDIR) |
---|
| 72 | rm -f $(BINDIR)/ogagent $(BINDIR)/OGAgent-Tool* |
---|
| 73 | rm -rf $(CFGDIR) |
---|