root/trunk/Makefile

Revision 219, 1.8 kB (checked in by poillubo, 19 months ago)

* removed hard-coded refs to python2.5 in Makefile

Line 
1# '<' (less than) shortcut
2lt = $(shell expr $(1) \< $(2))
3
4# python version checks
5PYTHONVERSION=$(shell python -c "print __import__('sys').version[:3]")
6PYTHONMAJOR=$(shell echo $(PYTHONVERSION) | cut -d'.' -f1)
7PYTHONMINOR=$(shell echo $(PYTHONVERSION) | cut -d'.' -f2)
8ifeq ($(PYTHONVERSION),)
9$(error PycaWM needs Python >= 2.5 and < 3.X)
10endif
11ifneq ($(PYTHONMAJOR),2)
12$(error PycaWM needs Python >= 2.5 and < 3.X, not $(PYTHONVERSION))
13endif
14ifeq ($(call lt,$(PYTHONMINOR),5),1)
15$(error PycaWM needs Python >= 2.5 and < 3.X, not $(PYTHONVERSION))
16endif
17
18prefix = /usr/local
19XSESSIONDIR=$(DESTDIR)/usr/share/xsessions
20BIN=$(DESTDIR)${prefix}/bin
21CONFDIR=$(DESTDIR)/etc/xdg
22DATADIR=$(DESTDIR)${prefix}/share
23MODULEDIR=$(DESTDIR)/usr/lib/python$(PYTHONVERSION)/site-packages
24
25install:
26        install -d $(XSESSIONDIR) $(BIN) $(CONFDIR)/PycaWM $(DATADIR)/PycaWM $(MODULEDIR)/pycawm $(MODULEDIR)/pycawm/plugins
27        install -m644 PycaWM.desktop $(XSESSIONDIR)
28        sed -i "s=/usr/local=$(prefix)=" $(XSESSIONDIR)/PycaWM.desktop
29        install -m755 pycawm_launcher utils/pycarepl utils/pycagenconf $(BIN)
30        install -m755 conf/config-example.py $(CONFDIR)/PycaWM/config.py
31        install -m644 conf/*.png $(DATADIR)/PycaWM
32        install -m644 pycawm/*.py $(MODULEDIR)/pycawm
33        install -m644 pycawm/plugins/*.py  $(MODULEDIR)/pycawm/plugins
34        python -O -c "from compileall import compile_dir; compile_dir('$(MODULEDIR)/pycawm')"
35
36
37uninstall:
38        if [ -f $(XSESSIONDIR)/PycaWM.desktop ] ; then rm -f $(XSESSIONDIR)/PycaWM.desktop; fi
39        if [ `ls -al $(XSESSIONDIR) | wc -l` -lt 4 ]; then rmdir $(XSESSIONDIR); fi
40        rm -f $(BIN)/pycawm_launcher $(BIN)/pycarepl $(BIN)/pycagenconf
41        rm -rf $(MODULEDIR)/pycawm
42        rm -rf $(CONFDIR)/PycaWM
43        rm -rf $(DATADIR)/PycaWM
44        if [ `ls -al $(CONFDIR) | wc -l` -lt 4 ]; then rmdir $(CONFDIR); fi
45
46clean:
47        rm -f pycawm/*.py{c,o} pycawm/plugins/*.py{c,o}
48        rm -f pycawm/*~ conf/*~ utils/*~ *~
Note: See TracBrowser for help on using the browser.