10
10
# clean Clean the build root from temporary files.
11
11
# dist Create source and data tarballs.
13
include /usr/share/python/python.mk
13
15
# Do not change this unless you know what you're doing.
14
16
PYTHON_VERSION=$(shell python -c "import sys; print sys.version[:3]")
18
19
# The prefix is added as a prefix (duh) to all other paths as default.
20
21
# Where the magicor package will be installed, including final directory.
21
PYTHON_LIB=$(PREFIX)/usr/share/games/magicor/magicor
22
PYTHON_LIB=$(PREFIX)$(call py_libdir,$(PYTHON_VERSION))/magicor
22
23
# Where the executable scripts will be installed.
23
BIN_PATH=$(PREFIX)/usr/share/games/magicor
24
BIN_PATH=$(PREFIX)/usr/games
24
25
# Where the shared data will be stored.
25
26
SHARE_PATH=$(PREFIX)/usr/share/games/magicor
26
27
# Where to find the system-wide config file.
27
28
CONFIG=$(PREFIX)/etc
29
# Docbook XSL stylesheet to use
30
DOCBOOK_STYLESHEET=/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl
31
# Options (string parameters) passed to the XSLT processor
32
#DOCBOOK_OPTIONS=--stringparam name value
33
# Docbook processing command
34
DOCBOOK_PROCESS=xsltproc -o $@ $(DOCBOOK_OPTIONS) $(DOCBOOK_STYLESHEET) $<
36
# For developers, change version with Magicor version number
33
42
@echo "Detected Python $(PYTHON_VERSION)"
34
43
@echo "Library path set to $(PYTHON_LIB)"
35
44
@echo "Binary path set to $(BIN_PATH)"
36
45
@echo "Data path set to $(SHARE_PATH)"
37
46
@echo "Default config in $(CONFIG)"
38
@echo "Edit the Makefile variables as you must, then 'make install' to install"
48
@echo "Docbook process (optional doc-target):"
49
@echo $(DOCBOOK_PROCESS)
51
@echo "Valid targets: install, uninstall, clean, doc"
43
57
mkdir -p $(PYTHON_LIB)
44
58
cp -fr magicor/* $(PYTHON_LIB)
45
59
mkdir -p $(BIN_PATH)
46
cat Magicor.py | python scripts/replacer.py "###CONFIG_PATH###" /etc/magicor.conf > $(BIN_PATH)/Magicor.py
60
cat Magicor.py | python scripts/replacer.py "###CONFIG_PATH###" /etc/magicor.conf > $(BIN_PATH)/magicor
48
62
cat etc/magicor.conf | python scripts/replacer.py "###SHARE_PATH###" /usr/share/games/magicor > $(CONFIG)/magicor.conf
49
cat Magicor-LevelEditor.py | python scripts/replacer.py "###CONFIG_PATH###" /etc/magicor-editor.conf > $(BIN_PATH)/Magicor-LevelEditor.py
63
cat Magicor-LevelEditor.py | python scripts/replacer.py "###CONFIG_PATH###" /etc/magicor-editor.conf > $(BIN_PATH)/magicor-editor
50
64
cat etc/magicor-editor.conf | python scripts/replacer.py "###SHARE_PATH###" /usr/share/games/magicor > $(CONFIG)/magicor-editor.conf
51
chmod a+x $(BIN_PATH)/Magicor.py
52
chmod a+x $(BIN_PATH)/Magicor-LevelEditor.py
65
chmod a+x $(BIN_PATH)/magicor
66
chmod a+x $(BIN_PATH)/magicor-editor
53
67
mkdir -p $(SHARE_PATH)
54
68
cp -fr data/* $(SHARE_PATH)
55
69
@echo "Done. If everything wen't well you can now run '$(BIN_PATH)/magicor'"
74
89
mkdir -p dist/magicor-$(VERSION)
75
90
rsync -Cavr --include=*.py magicor dist/magicor-$(VERSION)/
76
91
rsync -Cavr --include=*.py scripts dist/magicor-$(VERSION)/
92
cp -f *.py dist/magicor-$(VERSION)/
77
93
rsync -Cavr etc dist/magicor-$(VERSION)/
78
94
cp -f README INSTALL LICENSE COPYRIGHT Makefile dist/magicor-$(VERSION)/
79
95
rsync -Cavr --exclude=levels data dist/magicor-$(VERSION)/