~ubuntu-branches/ubuntu/oneiric/magicor/oneiric

« back to all changes in this revision

Viewing changes to Makefile.debian

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2010-01-02 13:18:28 UTC
  • mfrom: (2.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100102131828-o4p3gthk8m1dopv5
Tags: 1.1-1ubuntu1
* Merge with Debian testing. Remaining changes: 
  + debian/control: As Ubuntu's cdbs symlinks identical files, magicor needs
    a strict versioned Depends on magicor-data for the symlinked files to be
    in the same version.
* debian/magicor.install: Update to also work for Python 2.6. 
* debian/magicor.dirs: Unneeded as Makefile.debian creates them too.
* debian/Makefile.debian: Use /usr/share/python/python.mk to determine the
  correct Python library directory.
* debian/control: Update python dependency to >= 2.6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
# clean                         Clean the build root from temporary files.
11
11
# dist                          Create source and data tarballs.
12
12
 
 
13
include /usr/share/python/python.mk
 
14
 
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]")
15
 
#PYTHON_VERSION=2.4
16
 
#PYTHON_VERSION=2.3
 
17
#PYTHON_VERSION=2.5
17
18
 
18
19
# The prefix is added as a prefix (duh) to all other paths as default.
19
20
PREFIX=$(DESTDIR)
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) $<
28
35
 
29
 
VERSION=1.0
 
36
# For developers, change version with Magicor version number
 
37
VERSION=1.1
30
38
 
31
39
.PHONY: all
32
40
all:
 
41
        @echo "Environment:"
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"
 
47
        @echo
 
48
        @echo "Docbook process (optional doc-target):"
 
49
        @echo $(DOCBOOK_PROCESS)
 
50
        @echo
 
51
        @echo "Valid targets: install, uninstall, clean, doc"
 
52
        @echo
39
53
 
40
54
.PHONY: install
41
55
install:
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
47
61
        mkdir -p $(CONFIG)
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'"
67
81
        find . -name "*~" | xargs rm -f
68
82
        rm -Rf dist
69
83
        rm -f magicor-*.tar.gz
 
84
        rm -f *.cdbs-config_list
70
85
 
71
86
.PHONY: dist
72
87
dist:
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)/
82
98
        rsync -Cavr data/levels/* dist/magicor-$(VERSION)/data/levels/
83
99
        sync
84
100
        for f in $$(find dist/magicor-$(VERSION)/data/levels/  -maxdepth 1 -mindepth 1 -type d -printf "%f "); do tar -cvzf magicor-levels-$$f-$(VERSION).tar.gz -C dist/magicor-$(VERSION)/data/levels $$f; done
 
101
.PHONY: doc
 
102
doc: doc/manual.xhtml
 
103
 
 
104
mdoc/manual.xhtml: doc/manual.docbook
 
105
        $(DOCBOOK_PROCESS)