yaws/yaws-2.0-systemd.patch
Filip Andres 0096882bf8 Ver. 2.0
2015-07-28 14:48:47 +02:00

175 lines
5.6 KiB
Diff

From 4a5e0ccaf43bc3d83bc7003326cca9670d6f7c24 Mon Sep 17 00:00:00 2001
From: Filip Andres <filip@andresovi.net>
Date: Fri, 24 Jul 2015 11:38:03 +0200
Subject: [PATCH] Do not install any init scripts
---
scripts/Makefile.in | 5 +-
scripts/regular-install | 132 ------------------------------------------------
2 files changed, 2 insertions(+), 135 deletions(-)
delete mode 100755 scripts/regular-install
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 0b01ca4..a7698ab 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -309,7 +309,7 @@ yappdir = @yappdir@
yawsdir = @yawsdir@
EXTRA_DIST = darwin debian freebsd gentoo netbsd openbsd redhat suse \
gen-yaws gen-yaws-conf gen-yaws-generated Subst \
- regular-install make-release make-upload \
+ make-release make-upload \
rebar-pre-script yaws.conf.template yaws.template
all: all-am
@@ -573,8 +573,7 @@ include @top_srcdir@/include.mk
@MINGW_FALSE@ ETCDIR='$(sysconfdir)' \
@MINGW_FALSE@ BINDIR='$(bindir)' \
@MINGW_FALSE@ LOGDIR='$(logdir)' \
-@MINGW_FALSE@ YAWSDIR='$(ERLANG_INSTALL_LIB_DIR_yaws)' \
-@MINGW_FALSE@ ./regular-install)
+@MINGW_FALSE@ YAWSDIR='$(ERLANG_INSTALL_LIB_DIR_yaws)')
# Local Variables:
# tab-width: 8
diff --git a/scripts/regular-install b/scripts/regular-install
deleted file mode 100755
index b1f24b0..0000000
--- a/scripts/regular-install
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/bin/sh
-
-install -d ${DESTDIR}${ETCDIR}
-install -d ${DESTDIR}${LOGDIR}
-
-# Start by detecting if systemd is used
-(which systemctl && systemctl list-units) >/dev/null 2>&1
-if [ $? = 0 ]; then
- install -d ${DESTDIR}${ETCDIR}/systemd/system/
- sed -e "s;%prefix%;${PREFIX};g" \
- -e "s;%etcdir%;${ETCDIR};g" \
- -e "s;%bindir%;${BINDIR};g" \
- systemd/yaws.service > ${DESTDIR}${ETCDIR}/systemd/system/yaws.service
- exit 0
-fi
-
-# Else, looking at distro-specific files
-os=$( uname -s )
-which lsb_release >/dev/null 2>&1
-if [ $? = 0 ]; then
- os=$( lsb_release -si )
-elif [ -f /etc/os-release ]; then
- . /etc/os-release
- os=${ID}
-elif [ -f /etc/arch-release ]; then
- os="arch"
-elif [ -f /etc/gentoo-release ]; then
- os="gentoo"
-elif [ -f /etc/fedora-release ]; then
- os="fedora"
-elif [ -f /etc/centos-release ]; then
- os="centos"
-elif [ -f /etc/redhat-release ]; then
- os="redhat"
-elif [ -f /etc/debian_version ]; then
- os="debian"
-elif [ -f /etc/SuSE-release ]; then
- os="suse"
-elif [ $os = "Darwin" -a $(id -u) = 0 ]; then
- os="darwin"
-elif [ $os = "FreeBSD" ]; then
- os="freebsd"
-elif [ $os = "NetBSD" ]; then
- os="netbsd"
-else
- os="Unknown"
-fi
-
-case $(printf $os | tr '[:upper:]' '[:lower:]') in
- debian | ubuntu)
- install -d ${DESTDIR}${ETCDIR}/init.d
- sed -e "s;%prefix%;${PREFIX};g" \
- -e "s;%etcdir%;${ETCDIR};g" \
- -e "s;%bindir%;${BINDIR};g" \
- debian/yaws.init > ${DESTDIR}${ETCDIR}/init.d/yaws
- chmod +x ${DESTDIR}${ETCDIR}/init.d/yaws
- ;;
-
- gentoo)
- # seems gentoo don't like to be installed in /usr/local/etc since #
- # /sbin/runscript still reads /etc/conf.d
- install -d ${DESTDIR}${ETCDIR}/init.d
- install -d ${DESTDIR}${ETCDIR}/conf.d
- sed -e "s;%prefix%;${PREFIX};g" \
- -e "s;%etcdir%;${ETCDIR};g" \
- -e "s;%bindir%;${BINDIR};g" \
- gentoo/yaws.init > ${DESTDIR}${ETCDIR}/init.d/yaws
- chmod +x ${DESTDIR}${ETCDIR}/init.d/yaws
- ;;
-
- redhat | fedora | centos)
- install -d ${DESTDIR}${ETCDIR}/init.d
- sed -e "s;%prefix%;${PREFIX};g" \
- -e "s;%etcdir%;${ETCDIR};g" \
- -e "s;%bindir%;${BINDIR};g" \
- redhat/yaws.init > ${DESTDIR}${ETCDIR}/init.d/yaws
- chmod +x ${DESTDIR}${ETCDIR}/init.d/yaws
- ;;
-
- *suse*)
- install -d ${DESTDIR}${ETCDIR}/init.d
- sed -e "s;%prefix%;${PREFIX};g" \
- -e "s;%etcdir%;${ETCDIR};g" \
- -e "s;%bindir%;${BINDIR};g" \
- suse/yaws.init > ${DESTDIR}${ETCDIR}/init.d/yaws
- chmod +x ${DESTDIR}${ETCDIR}/init.d/yaws
- ;;
-
-
- darwin)
- 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%;${PREFIX};g" \
- -e "s;%etcdir%;${ETCDIR};g" \
- -e "s;%bindir%;${BINDIR};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}
- ;;
-
- freebsd)
- install -d ${DESTDIR}${ETCDIR}/rc.d
- sed -e "s;%prefix%;${PREFIX};g" \
- -e "s;%etcdir%;${ETCDIR};g" \
- -e "s;%bindir%;${BINDIR};g" \
- freebsd/yaws > ${DESTDIR}${ETCDIR}/rc.d/yaws
- chmod +x ${DESTDIR}${ETCDIR}/rc.d/yaws
- ;;
-
- netbsd)
- sed -e "s;%prefix%;${PREFIX};g" \
- -e "s;%etcdir%;${ETCDIR};g" \
- -e "s;%bindir%;${BINDIR};g" \
- netbsd/yaws.sh > ${DESTDIR}${ETCDIR}/rc.d/yaws
- chmod +x /etc/rc.d/yaws
- ;;
- *)
- install -d ${DESTDIR}${ETCDIR}
- echo "Don't know how to make /etc/init scripts for this system"
- echo "possibly add ${PREFIX}/bin/yaws --daemon --heart to your /etc/rc.local manually"
- ;;
-esac
-
-
-exit 0
--
2.1.0