File: Install

package info (click to toggle)
yaws 1.65-4etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,164 kB
  • ctags: 3,907
  • sloc: erlang: 20,138; sh: 3,675; makefile: 556; ansic: 404; lisp: 79
file content (90 lines) | stat: -rw-r--r-- 3,117 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

set -x

prefix=$1
destdir=$2
erl=$3
werl=$4
etcdir=$5
vardir=$6
bindir=$7

#bindir=`dirname $erl` ; bindir=`dirname $bindir`/lib/erlang/bin

. ../vsn.mk
y=yaws-${YAWS_VSN}
p=${prefix}
e=${etcdir}
v=${vardir}

install -d ${destdir}/${prefix}/bin

cat yaws.template | \
    ./Subst %yawsdir% ${prefix}/lib/erlang/lib/yaws-${YAWS_VSN} | \
    ./Subst %vardir% ${vardir} | \
    ./Subst %erl% "${erl}" | \
    ./Subst %run_erl% "${bindir}/run_erl" | \
    ./Subst %to_erl% "${bindir}/to_erl" | \
    ./Subst %werl% "${werl}" > ${destdir}/${prefix}/bin/yaws

chmod +x ${destdir}/${prefix}/bin/yaws

install -d ${destdir}/${prefix}/lib/erlang/lib/yaws-${YAWS_VSN}/examples/ebin
install -d ${destdir}/${prefix}/lib/erlang/lib/yaws-${YAWS_VSN}/examples/include

if [ -f /etc/gentoo-release ]; then
    install -d ${destdir}/${etcdir}/init.d/
    install -d ${destdir}/${etcdir}/conf.d/
    install -d ${destdir}/${vardir}/run/yaws
    chmod a+rwx ${destdir}/${vardir}/run/yaws
    cp gentoo/init.d.yaws  ${destdir}/${etcdir}/init.d/yaws
    chmod +x ${destdir}/${etcdir}/init.d/yaws
    sed -e "s;%prefix%;$p;g" gentoo/conf.d.yaws > ${destdir}/${etcdir}/conf.d/yaws
elif [ -f /etc/redhat-release ]; then
    install -d ${destdir}/${etcdir}/init.d
    sed -e "s;%prefix%;$p;g" redhat/yaws.init.d  > ${destdir}/${etcdir}/init.d/yaws
    chmod +x ${destdir}/${etcdir}/init.d/yaws
    install -d ${destdir}/${vardir}/run/yaws
    chmod a+rwx ${destdir}/${vardir}/run/yaws
elif [ -f /etc/suseservers ]; then
    install -d ${destdir}/${etcdir}/init.d
    sed -e "s;%prefix%;$p;g" suse/yaws.init.d  > ${destdir}/${etcdir}/init.d/yaws
    chmod +x ${destdir}/${etcdir}/init.d/yaws
    install -d ${destdir}/${vardir}/run/yaws
    chmod a+rwx ${destdir}/${vardir}/run/yaws
elif [ -f /etc/debian_version ]; then
    install -d ${destdir}/${etcdir}/init.d
    sed -e "s;%prefix%;$p;g" debian/yaws.init.d  > ${destdir}/${etcdir}/init.d/yaws
    chmod +x ${destdir}/${etcdir}/init.d/yaws
    install -d ${destdir}/${vardir}/run/yaws
    chmod a+rwx ${destdir}/${vardir}/run/yaws

elif [ "`uname -s`" = "Darwin" -a `id -u` = 0 ]; then
     startupdir="/Library/StartupItems/Yaws"
     if [ ! -e ${startupdir} && ]; then
       mkdir ${startupdir};
     elif [ ! -d ${startupdir} ]; then
	 echo "${startupdir} exists but is not a directory, bailing out ..."
	 exit 1
     fi
     sed -e "s;%prefix%;$p;g" darwin/Yaws.StartupItem > ${startupdir}/Yaws
     chmod +x ${startupdir}/Yaws
     cp darwin/Yaws.plist ${startupdir}/StartupParameters.plist
      # MacOS is particular about the ownership of startup items.
     chown -R root:wheel ${startupdir}
elif [ "`uname -s`" = "FreeBSD" ]; then
    sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" freebsd/yaws.sh > ${destdir}/${etcdir}/rc.d/yaws.sh
elif [ "`uname -s`" = "NetBSD" ]; then
    sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" netbsd/yaws.sh > /etc/rc.d/yaws
else    
    install -d ${destdir}/${etcdir} 
    echo "Don't know how to make /etc/init scrips for this system"
    echo "possibly add ${prefix}/bin/yaws --daemon --heart to your /etc/rc.local manually"
fi