Removed /usr/local from CDPATH
[clearscm.git] / rmc / Makefile
1 ################################################################################
2 #
3 # File:         Makefile
4 # Revision:     $Revision: 1 $
5 # Description:  Makefile for Devops/Web/rmc
6 # Author:       Andrew@Clearscm.com
7 # Created:      Mon, Jun 01, 2015 12:19:02 PM
8 # Modified:     $Date: 2012/09/20 06:52:37 $
9 # Language:     Makefile
10 #
11 # (c) Copyright 2015, Audience, Inc., all rights reserved.
12 #
13 # Aside from the standard make targets, the following additional targets exist:
14 #
15 # setup:        Set up rmc web app
16 #
17 ################################################################################
18 include ../../make.inc
19
20 WEBAPPS         := rmc
21 HTTPCONF        := /etc/httpd/conf.d
22 SERVER          := $(shell hostname -s)
23 PORT            := 8000
24 TEMPFILE        := $(shell mktemp --tmpdir $(TMP) -u rmc.conf.XXXX)
25
26 define helpText
27 Aside from the standard make targets, the following additional targets exist:\n\\n\
28 install:      Set up rmc web app\n\
29 uninstall:    Remove rmc web app\n
30 endef
31
32 all:
33         install
34
35 help:
36         @echo -e "$(helpText)"
37
38 test:
39         @read -p "Enter SERVER:" SERVER;\
40         echo "SERVER = $$SERVER";\
41         exit 1;
42
43 install:
44         @read -p "Enter server name for this instance (Default: $(SERVER)):" SERVER; \
45         read -p "Enter port number for this instance (Default: $(PORT)):" PORT; \
46         $(SUDO) $(RMF) $(HTTPCONF)/rmc.conf; \
47         $(SED) "s/<SERVER>/$$SERVER/" rmc.conf > $(TEMPFILE); \
48         $(SED) "s/<PORT>/$$PORT/" $(TEMPFILE) > /tmp/rmc.conf; \
49         $(SUDO) $(RMF) $(TEMPFILE); \
50         $(SUDO) chown root.root /tmp/rmc.conf; \
51         $(SUDO) $(MV) /tmp/rmc.conf $(HTTPCONF)/rmc.conf; \
52         $(SUDO) $(SERVICE) httpd reload
53
54 uninstall:
55         $(SUDO) $(RMF) $(HTTPCONF)/rmc.conf
56         $(SUDO) $(SERVICE) httpd reload