Allow OS to define default package locations.

This commit is contained in:
Roy Marples 2008-01-11 10:55:36 +00:00
parent 349f4a81e6
commit 13c552c3ec
18 changed files with 54 additions and 40 deletions

View File

@ -8,8 +8,6 @@ PKG= ${NAME}-${VERSION}
SUBDIR= conf.d doc etc init.d man net runlevels sh src
INSTALL?= install
INSTALLAFTER= _installafter
MK= mk

View File

@ -1,5 +1,25 @@
DIR = /etc/init.d
BIN = $(CONTENTS)
DIR= /etc/init.d
_SRCS!= ls *.in
SRCS?= ${_SRCS}$(shell ls *.in)
OBJS= ${SRCS:.in=}
TOPDIR = ..
include $(TOPDIR)/default.mk
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
VARBASE?= /var
.SUFFIXES: .in
all: ${OBJS}
.in:
sed -e s':@PREFIX@:${PREFIX}:' -e 's:@VARBASE@:${VARBASE}:' $< > $@
install: all
for x in ${OBJS}; do \
${INSTALL} work/$$x ${DESTDIR}${DIR}; \
done
clean:
rm -f ${OBJS}

View File

@ -0,0 +1 @@
PREFIX?= /usr/local

View File

@ -0,0 +1 @@
PREFIX=/usr

View File

@ -0,0 +1 @@
PREFIX?= /usr/pkg

View File

@ -23,9 +23,9 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
command=/usr/local/sbin/avahi-dnsconfd
command=@PREFIX@/sbin/avahi-dnsconfd
command_args="${avahi_dnsconfd_args} -D"
pidfile=/var/run/avahi-dnsconfd.pid
pidfile=@VARBASE@/run/avahi-dnsconfd.pid
name="Avahi DNS Configuration Daemon"
depend() {

4
init.d.misc/avahid → init.d.misc/avahid.in Executable file → Normal file
View File

@ -23,9 +23,9 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
command=/usr/local/sbin/avahi-daemon
command=@PREFIX@%%/sbin/avahi-daemon
command_args="${avahid_args} -D"
pidfile=/var/run/avahi-daemon/pid
pidfile=@VARBASE@/run/avahi-daemon/pid
name="Avahi Service Advertisement Daemon"
depend() {

View File

@ -23,8 +23,8 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
command=/usr/local/bin/dbus-daemon
pidfile=/var/run/dbus/dbus.pid
command=@PREFIX@%%/bin/dbus-daemon
pidfile=@VARBASE@/run/dbus/dbus.pid
command_args="${dbusd_args---system}"
name="Message Bus Daemon"

View File

@ -23,10 +23,10 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
command=/usr/local/sbin/dnsmasq
command=@PREFIX@/sbin/dnsmasq
command_args=${dnsmasq_args}
pidfile=/var/run/dnsmasq.pid
required_files=/usr/local/etc/dnsmasq.conf
pidfile=@VARBASE@/run/dnsmasq.pid
required_files=/etc/dnsmasq.conf
extra_started_commands="reload"

View File

@ -23,8 +23,8 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
command=/usr/local/sbin/hald
pidfile=/var/run/hald/hald.pid
command=@PREFIX@/sbin/hald
pidfile=@VARBASE@/run/hald/hald.pid
command_args="${hald_args}"
name="Hardware Abstraction Layer Daemon"

View File

@ -25,7 +25,7 @@
command=/usr/sbin/named
command_args=${named_args}
pidfile=/var/run/named/pid
pidfile=@VARBASE@/run/named/pid
name="Domain Name server"
extra_started_commands="reload"

22
init.d.misc/openvpn → init.d.misc/openvpn.in Executable file → Normal file
View File

@ -23,21 +23,13 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
if [ -z "${openvpn_dir}" ]; then
if [ -d /usr/local/etc/openvpn ]; then
openvpn_dir=/usr/local/etc/openvpn
else
openvpn_dir=/etc/openvpn
fi
fi
vpn=${SVCNAME#*.}
name="OpenVPN"
[ "${vpn}" != "openvpn" ] && name="${name} (${vpn})"
command=/usr/sbin/openvpn
[ -x ${command} ] || command=/usr/local/sbin/openvpn
command=@PREFIX/sbin/openvpn
pidfile="/var/run/${SVCNAME}.pid"
pidfile=@VARBASE@/run/"${SVCNAME}".pid
openvpn_dir=${openvpn_dir:-@PREFIX@/etc/openvpn}
openvpn_config=${openvpn_config:-${openvpn_dir}/${vpn}.conf}
command_args="${openvpn_args} --daemon --config ${openvpn_config} --writepid ${pidfile}"
required_dirs="${openvpn_dir}"
@ -78,9 +70,11 @@ start_pre() {
eend $?
fi
else
# Hammer the modules home by default
sysctl -a | grep -q '\.tun\.' || kldload if_tun
sysctl -a | grep -q '\.tap\.' || kldload if_tap
if type kldload >/dev/null 2>&1; then
# Hammer the modules home by default
sysctl -a | grep -q '\.tun\.' || kldload if_tun
sysctl -a | grep -q '\.tap\.' || kldload if_tap
fi
fi
# If the config file does not specify the cd option, we do

View File

@ -23,8 +23,8 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
command=/usr/local/sbin/polkitd
pidfile=/var/run/polkitd/polkitd.pid
command=@PREFIX@/sbin/polkitd
pidfile=@VARBASE@/run/polkitd/polkitd.pid
command_args="${polkitd_args}"
name="PolicyKit Daemon"

View File

@ -25,9 +25,9 @@
command=/usr/sbin/sshd
command_args=${sshd_args}
pidfile=/var/run/sshd.pid
pidfile=@VARBASE@/run/sshd.pid
required_files=/etc/ssh/sshd_config
required_dirs=/var/empty
required_dirs=@VARBASE@/empty
depend() {
use logger dns

View File

@ -29,3 +29,6 @@ LIBDL?= ${_LIBDL}$(shell ${_LIBDL_SH})
_LIBKVM_SH= case `uname -s` in *BSD) echo "-lkvm";; *) echo;; esac
_LIBKVM!= ${_LIBKVM_SH}
LIBKVM?= ${_LIBKVM}$(shell ${_LIBKVM_SH})
# Maye as well define INSTALL here as everything uses us
INSTALL?= install

View File

@ -6,8 +6,6 @@ _CONTENTS_SH= ls -1 | grep -v Makefile | xargs
_CONTENTS!= ${_CONTENTS_SH}
CONTENTS= ${_CONTENTS}$(shell ${_CONTENTS_SH})
INSTALL?= install
include ${MK}/os.mk
all:

View File

@ -11,8 +11,6 @@ include ${MK}/os.mk
include Makefile.${OS}
include Makefile.${SUBOS}
INSTALL?= install
all:
install: