-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (82 loc) · 3.09 KB
/
Makefile
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
# File: vo-support/Makefile
# Author: Dennis van Dok <dennisvd@nikhef.nl>
#
# Copyright 2012 Stichting FOM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This package is pretty trivial to set up and install.
# There is no source code to compile; it only contains
# a couple of scripts.
# This Makefile respects the $DESTDIR convention that
# is commonly used in the GNU build system.
# the relevant variables
prefix = /usr
datadir = $(prefix)/share
sbindir = $(prefix)/sbin
sysconfdir = /etc
DESTDIR =
# These variables should not be changed by the user
package = vo-support
version = 0.6
modules = vomsdir.sh vomses.sh gridmapdir.sh grid-mapfile.sh
modulesrc = vomsdir.sh vomses.sh gridmapdir.sh.in grid-mapfile.sh.in
scriptlets = maintainerscript-helpers.sh
utils = vo-config vo-support
utilssources = vo-config.pl.in vo-support.pl.in
testsources = test/
distfiles = Makefile LICENSE-GPL LICENSE-LGPL LICENSE-APACHE2 Changes README.org \
vo-support.spec $(scriptlets) $(modulesrc) $(utilssources)
.PHONY: install build binary test installdirs install-scriptlets install-modules
build: binary
@echo "build done. Run 'make install' to finish the installation"
@echo "or 'make test' to run the test suite"
binary: $(utils) $(scriptlets) $(modules)
installdirs:
mkdir -p $(DESTDIR)/$(datadir)/$(package)/scriptlets
mkdir -p $(DESTDIR)/$(datadir)/vo-support/modules
mkdir -p $(DESTDIR)/$(datadir)/man/man1
mkdir -p $(DESTDIR)/$(sbindir)
%.sh: %.sh.in
$(do_subst) $< > $@
%: %.pl.in
$(do_subst) $< > $@
chmod +x $@
install-mans: installdirs $(utils)
for i in $(utils) ; do \
pod2man -c "VO SUPPORT" $$i $(DESTDIR)/$(datadir)/man/man1/$$i.1 ; \
done
install-scriptlets: installdirs
install -m 644 maintainerscript-helpers.sh $(DESTDIR)/$(datadir)/$(package)/scriptlets/
install-utils: installdirs $(utils)
for i in $(utils) ; do \
install -m 755 $$i $(DESTDIR)/$(sbindir)/ ; \
done
install-modules: installdirs $(modules)
for i in $(modules) ; do \
install -m 755 $$i $(DESTDIR)/$(datadir)/vo-support/modules/ ; \
done
install: install-scriptlets install-utils install-modules install-mans
dist:
rm -rf _dist/
mkdir -p _dist/$(package)-$(version)
install -m 644 $(distfiles) _dist/$(package)-$(version)
cd test && make dist distdir=../_dist/$(package)-$(version)
tar cCfz _dist $(package)-$(version).tar.gz $(package)-$(version)
test: binary
cd test && make test
clean:
rm -f gridmapdir.sh grid-mapfile.sh vo-config vo-support
cd test && make clean
do_subst = sed -e 's,[@]sbindir@,$(sbindir),' \
-e 's,[@]datadir@,$(datadir),' \
-e 's,[@]sysconfdir@,$(sysconfdir),'