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
|
SUBDIR= conf.d doc etc init.d man net runlevels sh src
|
||||||
|
|
||||||
INSTALL?= install
|
|
||||||
|
|
||||||
INSTALLAFTER= _installafter
|
INSTALLAFTER= _installafter
|
||||||
|
|
||||||
MK= mk
|
MK= mk
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
DIR = /etc/init.d
|
DIR= /etc/init.d
|
||||||
BIN = $(CONTENTS)
|
_SRCS!= ls *.in
|
||||||
|
SRCS?= ${_SRCS}$(shell ls *.in)
|
||||||
|
OBJS= ${SRCS:.in=}
|
||||||
|
|
||||||
TOPDIR = ..
|
MK= ../mk
|
||||||
include $(TOPDIR)/default.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
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
# SUCH DAMAGE.
|
# SUCH DAMAGE.
|
||||||
|
|
||||||
command=/usr/local/sbin/avahi-dnsconfd
|
command=@PREFIX@/sbin/avahi-dnsconfd
|
||||||
command_args="${avahi_dnsconfd_args} -D"
|
command_args="${avahi_dnsconfd_args} -D"
|
||||||
pidfile=/var/run/avahi-dnsconfd.pid
|
pidfile=@VARBASE@/run/avahi-dnsconfd.pid
|
||||||
name="Avahi DNS Configuration Daemon"
|
name="Avahi DNS Configuration Daemon"
|
||||||
|
|
||||||
depend() {
|
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
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
# SUCH DAMAGE.
|
# SUCH DAMAGE.
|
||||||
|
|
||||||
command=/usr/local/sbin/avahi-daemon
|
command=@PREFIX@%%/sbin/avahi-daemon
|
||||||
command_args="${avahid_args} -D"
|
command_args="${avahid_args} -D"
|
||||||
pidfile=/var/run/avahi-daemon/pid
|
pidfile=@VARBASE@/run/avahi-daemon/pid
|
||||||
name="Avahi Service Advertisement Daemon"
|
name="Avahi Service Advertisement Daemon"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
@ -23,8 +23,8 @@
|
|||||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
# SUCH DAMAGE.
|
# SUCH DAMAGE.
|
||||||
|
|
||||||
command=/usr/local/bin/dbus-daemon
|
command=@PREFIX@%%/bin/dbus-daemon
|
||||||
pidfile=/var/run/dbus/dbus.pid
|
pidfile=@VARBASE@/run/dbus/dbus.pid
|
||||||
command_args="${dbusd_args---system}"
|
command_args="${dbusd_args---system}"
|
||||||
name="Message Bus Daemon"
|
name="Message Bus Daemon"
|
||||||
|
|
@ -23,10 +23,10 @@
|
|||||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
# SUCH DAMAGE.
|
# SUCH DAMAGE.
|
||||||
|
|
||||||
command=/usr/local/sbin/dnsmasq
|
command=@PREFIX@/sbin/dnsmasq
|
||||||
command_args=${dnsmasq_args}
|
command_args=${dnsmasq_args}
|
||||||
pidfile=/var/run/dnsmasq.pid
|
pidfile=@VARBASE@/run/dnsmasq.pid
|
||||||
required_files=/usr/local/etc/dnsmasq.conf
|
required_files=/etc/dnsmasq.conf
|
||||||
|
|
||||||
extra_started_commands="reload"
|
extra_started_commands="reload"
|
||||||
|
|
@ -23,8 +23,8 @@
|
|||||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
# SUCH DAMAGE.
|
# SUCH DAMAGE.
|
||||||
|
|
||||||
command=/usr/local/sbin/hald
|
command=@PREFIX@/sbin/hald
|
||||||
pidfile=/var/run/hald/hald.pid
|
pidfile=@VARBASE@/run/hald/hald.pid
|
||||||
command_args="${hald_args}"
|
command_args="${hald_args}"
|
||||||
name="Hardware Abstraction Layer Daemon"
|
name="Hardware Abstraction Layer Daemon"
|
||||||
|
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
command=/usr/sbin/named
|
command=/usr/sbin/named
|
||||||
command_args=${named_args}
|
command_args=${named_args}
|
||||||
pidfile=/var/run/named/pid
|
pidfile=@VARBASE@/run/named/pid
|
||||||
name="Domain Name server"
|
name="Domain Name server"
|
||||||
extra_started_commands="reload"
|
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
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
# SUCH DAMAGE.
|
# 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#*.}
|
vpn=${SVCNAME#*.}
|
||||||
name="OpenVPN"
|
name="OpenVPN"
|
||||||
[ "${vpn}" != "openvpn" ] && name="${name} (${vpn})"
|
[ "${vpn}" != "openvpn" ] && name="${name} (${vpn})"
|
||||||
command=/usr/sbin/openvpn
|
command=@PREFIX/sbin/openvpn
|
||||||
[ -x ${command} ] || command=/usr/local/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}
|
openvpn_config=${openvpn_config:-${openvpn_dir}/${vpn}.conf}
|
||||||
command_args="${openvpn_args} --daemon --config ${openvpn_config} --writepid ${pidfile}"
|
command_args="${openvpn_args} --daemon --config ${openvpn_config} --writepid ${pidfile}"
|
||||||
required_dirs="${openvpn_dir}"
|
required_dirs="${openvpn_dir}"
|
||||||
@ -78,9 +70,11 @@ start_pre() {
|
|||||||
eend $?
|
eend $?
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Hammer the modules home by default
|
if type kldload >/dev/null 2>&1; then
|
||||||
sysctl -a | grep -q '\.tun\.' || kldload if_tun
|
# Hammer the modules home by default
|
||||||
sysctl -a | grep -q '\.tap\.' || kldload if_tap
|
sysctl -a | grep -q '\.tun\.' || kldload if_tun
|
||||||
|
sysctl -a | grep -q '\.tap\.' || kldload if_tap
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the config file does not specify the cd option, we do
|
# 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
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
# SUCH DAMAGE.
|
# SUCH DAMAGE.
|
||||||
|
|
||||||
command=/usr/local/sbin/polkitd
|
command=@PREFIX@/sbin/polkitd
|
||||||
pidfile=/var/run/polkitd/polkitd.pid
|
pidfile=@VARBASE@/run/polkitd/polkitd.pid
|
||||||
command_args="${polkitd_args}"
|
command_args="${polkitd_args}"
|
||||||
name="PolicyKit Daemon"
|
name="PolicyKit Daemon"
|
||||||
|
|
@ -25,9 +25,9 @@
|
|||||||
|
|
||||||
command=/usr/sbin/sshd
|
command=/usr/sbin/sshd
|
||||||
command_args=${sshd_args}
|
command_args=${sshd_args}
|
||||||
pidfile=/var/run/sshd.pid
|
pidfile=@VARBASE@/run/sshd.pid
|
||||||
required_files=/etc/ssh/sshd_config
|
required_files=/etc/ssh/sshd_config
|
||||||
required_dirs=/var/empty
|
required_dirs=@VARBASE@/empty
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
use logger dns
|
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_SH= case `uname -s` in *BSD) echo "-lkvm";; *) echo;; esac
|
||||||
_LIBKVM!= ${_LIBKVM_SH}
|
_LIBKVM!= ${_LIBKVM_SH}
|
||||||
LIBKVM?= ${_LIBKVM}$(shell ${_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_SH}
|
||||||
CONTENTS= ${_CONTENTS}$(shell ${_CONTENTS_SH})
|
CONTENTS= ${_CONTENTS}$(shell ${_CONTENTS_SH})
|
||||||
|
|
||||||
INSTALL?= install
|
|
||||||
|
|
||||||
include ${MK}/os.mk
|
include ${MK}/os.mk
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
@ -11,8 +11,6 @@ include ${MK}/os.mk
|
|||||||
include Makefile.${OS}
|
include Makefile.${OS}
|
||||||
include Makefile.${SUBOS}
|
include Makefile.${SUBOS}
|
||||||
|
|
||||||
INSTALL?= install
|
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
Loading…
Reference in New Issue
Block a user