1
2###########
3#  Presage, an extensible predictive text entry system
4#  ------------------------------------------------------
5#
6#  Copyright (C) 2008  Matteo Vescovi <matteo.vescovi@yahoo.co.uk>
7#
8#  This program is free software; you can redistribute it and/or modify
9#  it under the terms of the GNU General Public License as published by
10#  the Free Software Foundation; either version 2 of the License, or
11#  (at your option) any later version.
12#
13#  This program is distributed in the hope that it will be useful,
14#  but WITHOUT ANY WARRANTY; without even the implied warranty of
15#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16#  GNU General Public License for more details.
17#
18#  You should have received a copy of the GNU General Public License along
19#  with this program; if not, write to the Free Software Foundation, Inc.,
20#  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22## Process this file with automake to produce Makefile.in
23
24if HAVE_SWIG
25if HAVE_PYTHON
26if ENABLE_PYTHON_BINDING
27
28
29if ENABLE_PYPRESAGEMATE
30# pypresagemate uses autotools
31dist_bin_SCRIPTS = \
32	pypresagemate
33
34presagematedir = $(pythondir)/presagemate
35presagemate_PYTHON = \
36	presagemate/__init__.py \
37	presagemate/presagemate.py
38
39endif
40#     ENABLE_PYPRESAGEMATE
41
42if ENABLE_PYPROMPTER
43# pyprompter delegates to setup.py
44EXTRA_DIST =	pyprompter \
45		prompter/__init__.py \
46		prompter/prompter.py
47
48all-local:	$(EXTRA_DIST)
49	@case "`uname`" in \
50	  MINGW*) \
51		$(PYTHON) setup.py build --compiler=mingw32 \
52	  ;; \
53	  *) \
54		$(PYTHON) setup.py build \
55	  ;; \
56	esac;
57
58# python on MinGW/MSYS requires pure Windows style paths
59# Using following (cd $dir && pwd -W) hack to get a nearly
60# native Windows path, then translating the forward slash
61# to a backward slash to make python distutils jolly.
62# P.S. the backslash has to be escaped thrice, hence a single
63# backslash turns into a sequence of eight (neat, huh?)
64#
65install-exec-local:
66	@case "`uname`" in \
67	  MINGW*) \
68		NATIVE_WINDOWS_PREFIX="`cd $(DESTDIR)$(prefix) && pwd -W`"; \
69		NATIVE_WINDOWS_PREFIX="`echo $$NATIVE_WINDOWS_PREFIX | sed -e 's|/|\\\\\\\\|g'`"; \
70		$(PYTHON) setup.py install --prefix="$$NATIVE_WINDOWS_PREFIX" \
71	  ;; \
72	  *) \
73		$(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix) \
74	  ;; \
75	esac;
76
77# This rule cleans up stuff installed by Python's setup.py
78# Unfortunately, Python's distutils do not provide an uninstall
79# command, so we have to make up for it here in uninstall-local
80# hook. This might break if distutils' behaviour changes as automake
81# has no control over what distutils install command does.
82#
83uninstall-local:
84	rm -rf $(DESTDIR)$(libdir)/python*/site-packages/prompter
85	rm -f $(DESTDIR)$(libdir)/python*/site-packages/pyprompter-*.egg-info
86	rm -f $(DESTDIR)$(bindir)/pyprompter
87
88clean-local:
89	rm -rf build
90
91
92if HAVE_HELP2MAN
93
94pyprompter.1:	pyprompter.in $(top_srcdir)/configure.ac
95	chmod u+x ./pyprompter
96	help2man --output=$@ --no-info --name="the intelligent predictive wxPython text editor" "$(PYTHON) ./pyprompter"
97
98dist_man_MANS =	pyprompter.1
99
100DISTCLEANFILES= pyprompter.1
101
102endif
103
104desktopdir = $(datadir)/applications
105dist_desktop_DATA = pyprompter.desktop
106
107svgicondir = $(datadir)/icons/hicolor/scalable/apps
108dist_svgicon_DATA = pyprompter.svg
109
110pixmapsdir = $(datadir)/pixmaps
111dist_pixmaps_DATA = pyprompter.png pyprompter.xpm
112
113endif
114#     ENABLE_PYPROMPTER
115
116endif
117endif
118endif
119