Allow OS to define default package locations.
This commit is contained in:
parent
349f4a81e6
commit
13c552c3ec
2
Makefile
2
Makefile
@ -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
|
||||
|
@ -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}
|
||||
|
1
init.d.misc/Makefile.FreeBSD
Normal file
1
init.d.misc/Makefile.FreeBSD
Normal file
@ -0,0 +1 @@
|
||||
PREFIX?= /usr/local
|
1
init.d.misc/Makefile.Linux
Normal file
1
init.d.misc/Makefile.Linux
Normal file
@ -0,0 +1 @@
|
||||
PREFIX=/usr
|
1
init.d.misc/Makefile.NetBSD
Normal file
1
init.d.misc/Makefile.NetBSD
Normal file
@ -0,0 +1 @@
|
||||
PREFIX?= /usr/pkg
|
4
init.d.misc/avahi-dnsconfd → init.d.misc/avahi-dnsconfd.in
Executable file → Normal file
4
init.d.misc/avahi-dnsconfd → init.d.misc/avahi-dnsconfd.in
Executable file → Normal 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
4
init.d.misc/avahid → init.d.misc/avahid.in
Executable file → Normal 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() {
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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
22
init.d.misc/openvpn → init.d.misc/openvpn.in
Executable file → Normal 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
|
@ -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"
|
||||
|
@ -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
|
3
mk/os.mk
3
mk/os.mk
@ -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
|
||||
|
@ -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:
|
||||
|
@ -11,8 +11,6 @@ include ${MK}/os.mk
|
||||
include Makefile.${OS}
|
||||
include Makefile.${SUBOS}
|
||||
|
||||
INSTALL?= install
|
||||
|
||||
all:
|
||||
|
||||
install:
|
||||
|
Loading…
Reference in New Issue
Block a user