~ubuntu-branches/ubuntu/wily/foomatic-db/wily

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Makefile to install foomatic-db
# $Revision$

# PREFIX defaults to /usr/local for manually installed progs, so that they
# are not messed up on a system upgrade.
#
# `architecture independent', static data files i.e. perl libs go into
#   $(PREFIX)/share/foomatic
# (user) executables into $(PREFIX)/bin/
# system binaries go into $(PREFIX)/sbin
# configuration files into /etc/foomatic/*.
#
# The PERLPREFIX allows a seperate prefix for the Perl libraries. Use this
# when Perl libraries in /usr/local are not found.

# Variables

DEBUG=

prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
bindir=@bindir@
sbindir=@sbindir@
mandir=@mandir@
datarootdir=@datarootdir@
datadir=@datadir@
sysconfdir=@sysconfdir@

PREFIX=$(prefix)

# The location where to install the database
LIBDIR=$(datadir)/foomatic

# List of user-selected driver XMLs to install
DRIVERXMLS=@DRIVERXMLS@

# Variables for CUPS
CUPS_PPDS=@CUPS_PPDS@
PPDS_TO_CUPS=@PPDS_TO_CUPS@

# Variables for gzipping the custom PPD files
GZIP=@GZIP@
GZIP_PPDS=@GZIP_PPDS@

# This is mainly useful for building a binary foomatic package
DESTDIR=/

### Probably nothing to fiddle past here

# Files generated by the AC_OUTPUT call of "./configure"
AC_OUTPUT_FILES:=Makefile

# Masks for trash files which have to be removed before packaging Foomatic
TRASHFILES:="*~" "*\#*" ".??*" "*.rej"

all: build

# The install rule should check for kitloads and avoid stomping.  It doesn't
install: install-db

install-db:
	install -d $(DESTDIR)$(LIBDIR)
	install -d $(DESTDIR)$(LIBDIR)/db/source/printer
	install -d $(DESTDIR)$(LIBDIR)/db/source/driver
	install -d $(DESTDIR)$(LIBDIR)/db/source/opt
	install -d $(DESTDIR)$(LIBDIR)/db/source/PPD
	install -d $(DESTDIR)$(LIBDIR)/xmlschema
	cp db/oldprinterids $(DESTDIR)$(LIBDIR)/db
	cp db/source/printer/*.xml $(DESTDIR)$(LIBDIR)/db/source/printer
	( cd db/source/driver/; \
	  for d in $(DRIVERXMLS); do \
	    cp $$d $(DESTDIR)$(LIBDIR)/db/source/driver; \
	  done )
	cp db/source/opt/*.xml $(DESTDIR)$(LIBDIR)/db/source/opt
	( cd db/source && tar cf - --exclude=.svn PPD ) | \
	  ( cd $(DESTDIR)$(LIBDIR)/db/source && tar xf -)
	if test $(GZIP) != GZIP_NOT_FOUND -a $(GZIP_PPDS) != no ; then \
	  GZIP='' find $(DESTDIR)$(LIBDIR)/db/source/PPD -name "*.ppd" -exec $(GZIP) "{}" \; ; \
	fi
	if test $(CUPS_PPDS) != CUPS_PPDS_NOT_FOUND -a $(PPDS_TO_CUPS) != no ; then \
	  install -d $(DESTDIR)$(CUPS_PPDS); \
	  ln -sf $(LIBDIR)/db/source/PPD $(DESTDIR)$(CUPS_PPDS)/foomatic-db-ppds; \
	fi
	cp xmlschema/*.xsd $(DESTDIR)$(LIBDIR)/xmlschema

build:
	@echo "Nothing to compile/build, use \"make install\" to install the database."

clean: remove-trash

distclean: clean
	rm -f $(AC_OUTPUT_FILES) config.log config.status config.cache
	rm -rf autom*.cache confdefs.h

maintainer-clean: distclean
	rm -f configure aclocal.m4

# Uninstall an installed Foomatic
uninstall: uninstall-db

uninstall-db:
	rm -rf $(DESTDIR)$(LIBDIR)

# Various testing/debugging/etc targets
inplace: testing
testing: INPLACE = --inplace
testing:
	@echo "For using this database without system-wide installation, uncompress this"
	@echo "package inside the main directory of \"foomatic-db-engine\" or in the"
	@echo "directory where you have uncompressed \"foomatic-db-engine\"."
	@echo "Build \"foomatic-db-engine\" with \"make inplace\" and do the database"
	@echo "operations from within the main directory of \"foomatic-db-engine\"."

inplace-clean: testing_clean
testing-clean: clean

# Remove editor backup and temporary files
remove-trash:
	for m in $(TRASHFILES); do \
	  find . -name "$$m" -exec rm "{}" \; ; \
	done

# We need to export all Variables for makeDefaults and the scripts target to
# work.
.EXPORT_ALL_VARIABLES:

.PHONY: all build install install-db \
	inplace testing clean inplace-clean testing-clean distclean \
	maintainer-clean