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 SUBDIR= conf.d doc etc init.d man net runlevels sh src
INSTALL?= install
INSTALLAFTER= _installafter INSTALLAFTER= _installafter
MK= mk MK= mk

View File

@ -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}

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 # 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
View 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() {

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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
View 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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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: