1 |
# Copyright (C) 2007 Marc Alexander Lehmann |
2 |
# Copyright (C) 2001 Mark Wedel & Crossfire Development Team |
3 |
# Copyright (C) 1992 Frank Tore Johansen |
4 |
# |
5 |
# This program is free software; you can redistribute it and/or modify |
6 |
# it under the terms of the GNU General Public License as published by |
7 |
# the Free Software Foundation; either version 2 of the License, or |
8 |
# (at your option) any later version. |
9 |
# |
10 |
# This program is distributed in the hope that it will be useful, |
11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
# GNU General Public License for more details. |
14 |
# |
15 |
# You should have received a copy of the GNU General Public License |
16 |
# along with this program; if not, write to the Free Software |
17 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
18 |
# |
19 |
# The authors can be reached via e-mail to crossfire@schmorp.de |
20 |
|
21 |
pkgstatedir = @pkgstatedir@ |
22 |
pkgconfdir = @pkgconfdir@ |
23 |
|
24 |
dist_noinst_SCRIPTS = collect.pl util.pl checkarch.pl |
25 |
nobase_dist_pkgdata_DATA = artifacts def_help formulae messages races \ |
26 |
attackmess materials cf.pm jeweler.yaml |
27 |
|
28 |
pmdir = $(pkgdatadir)/cf |
29 |
dist_pm_DATA = cf/pod.pm |
30 |
|
31 |
admdir = $(pkgdatadir)/adm |
32 |
dist_adm_DATA = adm/map_info adm/map_expand.pl adm/mapslitter.pl adm/archsearch.pl adm/collect_images.pl |
33 |
|
34 |
CONF_FILES = settings motd dm_file forbid exp_table news rules config |
35 |
VAR_FILES = highscore bookarch temp.maps |
36 |
EXTRA_DIST = README .collect-stamp $(CONF_FILES) |
37 |
|
38 |
MAINTAINERCLEANFILES = .collect-stamp Makefile.in |
39 |
|
40 |
PERL = @PERL@ |
41 |
|
42 |
install-data-local: jeweler.yaml |
43 |
@$(NORMAL_INSTALL) |
44 |
for i in $(CONF_FILES); do \ |
45 |
if [ ! -f $(DESTDIR)$(pkgconfdir)/$$i ]; then \ |
46 |
echo "Installing $$i"; \ |
47 |
$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(pkgconfdir); \ |
48 |
fi \ |
49 |
done |
50 |
$(mkinstalldirs) -m 755 $(DESTDIR)$(pkgstatedir) |
51 |
for i in $(VAR_FILES) ; do \ |
52 |
touch $(DESTDIR)$(pkgstatedir)/$$i ; \ |
53 |
done |
54 |
@for i in datafiles players unique-items template-maps maps random db tmp; do \ |
55 |
if [ ! -d $(DESTDIR)$(pkgstatedir)/$$i ]; then \ |
56 |
echo "Creating directory $(pkgstatedir)/$$i"; \ |
57 |
$(mkinstalldirs) -m 755 $(DESTDIR)$(pkgstatedir)/$$i; \ |
58 |
fi; \ |
59 |
done |
60 |
|
61 |
# Uninstall unchanged config/var files so make distcheck is happy |
62 |
# but leave changed file, so no configuration/game state is lost |
63 |
uninstall-local: |
64 |
-for i in $(CONF_FILES); do \ |
65 |
if test ! -f $(DESTDIR)$(pkgconfdir)/$$i ; then \ |
66 |
continue ; \ |
67 |
fi ; \ |
68 |
if diff -q $(srcdir)/$$i $(DESTDIR)$(pkgconfdir)/$$i ; then \ |
69 |
rm -f $(DESTDIR)$(pkgconfdir)/$$i ; \ |
70 |
fi ; \ |
71 |
done |
72 |
-for i in $(VAR_FILES) ; do \ |
73 |
if test ! -f $(DESTDIR)$(pkgstatedir)/$$i ; then \ |
74 |
continue ;\ |
75 |
fi ; \ |
76 |
if ! [ -s "$(DESTDIR)$(pkgstatedir)/$$i" ] ; then \ |
77 |
rm -f $(DESTDIR)$(pkgstatedir)/$$i ; \ |
78 |
fi ; \ |
79 |
done |
80 |
|
81 |
|