2004-08-31 Greg Troxel <gdt@poblano.ir.bbn.com>
* Rename scripts to *.sh.in, and use autoconf-style substitution
for prefix and localstatedir.
diff --git a/pkgsrc/ChangeLog b/pkgsrc/ChangeLog
new file mode 100644
index 0000000..79ade41
--- /dev/null
+++ b/pkgsrc/ChangeLog
@@ -0,0 +1,15 @@
+2004-08-31 Greg Troxel <gdt@poblano.ir.bbn.com>
+
+ * Rename scripts to *.sh.in, and use autoconf-style substitution
+ for prefix and localstatedir.
+
+2004-08-31 Greg Troxel <gdt@poblano.ir.bbn.com>
+
+ * Makefile.am: Only put pkgsrc dir in SUBDIRS if we should install
+ rc.d files. (Note that pkgsrc is always in DIST_SUBDIRS.)
+
+ * configure.ac (pkgsrcdir): add new --enable-pkgsrcrcdir to give a
+ directory into which www.pkgsrc.org-style rc.d files are
+ installed.
+
+
diff --git a/pkgsrc/Makefile.am b/pkgsrc/Makefile.am
index 4db92ab..622fbf0 100644
--- a/pkgsrc/Makefile.am
+++ b/pkgsrc/Makefile.am
@@ -1 +1,3 @@
-EXTRA_DIST = bgpd.sh ospf6d.sh ospfd.sh ripd.sh ripngd.sh zebra.sh
+rcdir=@pkgsrcrcdir@
+
+rc_SCRIPTS = bgpd.sh ospf6d.sh ospfd.sh ripd.sh ripngd.sh zebra.sh
diff --git a/pkgsrc/bgpd.sh b/pkgsrc/bgpd.sh.in
similarity index 75%
rename from pkgsrc/bgpd.sh
rename to pkgsrc/bgpd.sh.in
index b150e9f..d234b54 100644
--- a/pkgsrc/bgpd.sh
+++ b/pkgsrc/bgpd.sh.in
@@ -6,7 +6,7 @@
# REQUIRE: zebra
##
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@prefix@/sbin:@prefix@/bin
export PATH
if [ -f /etc/rc.subr ]
@@ -16,12 +16,12 @@
name="bgpd"
rcvar=$name
-required_files="@PKG_SYSCONFDIR@/${name}.conf"
-command="@PREFIX@/sbin/${name}"
+required_files="@sysconfdir@/${name}.conf"
+command="@prefix@/sbin/${name}"
command_args="-d"
start_precmd="zebra_precmd"
-socket_dir=/var/run/zebra
+socket_dir=@localstatedir@
pidfile="${socket_dir}/${name}.pid"
zebra_precmd()
diff --git a/pkgsrc/ospf6d.sh b/pkgsrc/ospf6d.sh.in
similarity index 75%
rename from pkgsrc/ospf6d.sh
rename to pkgsrc/ospf6d.sh.in
index b008823..3fbdb81 100644
--- a/pkgsrc/ospf6d.sh
+++ b/pkgsrc/ospf6d.sh.in
@@ -6,7 +6,7 @@
# REQUIRE: zebra
##
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@prefix@/sbin:@prefix@/bin
export PATH
if [ -f /etc/rc.subr ]
@@ -16,12 +16,12 @@
name="ospf6d"
rcvar=$name
-required_files="@PKG_SYSCONFDIR@/${name}.conf"
-command="@PREFIX@/sbin/${name}"
+required_files="@sysconfdir@/${name}.conf"
+command="@prefix@/sbin/${name}"
command_args="-d"
start_precmd="zebra_precmd"
-socket_dir=/var/run/zebra
+socket_dir=@localstatedir@
pidfile="${socket_dir}/${name}.pid"
zebra_precmd()
diff --git a/pkgsrc/ospfd.sh b/pkgsrc/ospfd.sh.in
similarity index 75%
rename from pkgsrc/ospfd.sh
rename to pkgsrc/ospfd.sh.in
index c852211..daa2252 100644
--- a/pkgsrc/ospfd.sh
+++ b/pkgsrc/ospfd.sh.in
@@ -6,7 +6,7 @@
# REQUIRE: zebra
##
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@prefix@/sbin:@prefix@/bin
export PATH
if [ -f /etc/rc.subr ]
@@ -16,12 +16,12 @@
name="ospfd"
rcvar=$name
-required_files="@PKG_SYSCONFDIR@/${name}.conf"
-command="@PREFIX@/sbin/${name}"
+required_files="@sysconfdir@/${name}.conf"
+command="@prefix@/sbin/${name}"
command_args="-d"
start_precmd="zebra_precmd"
-socket_dir=/var/run/zebra
+socket_dir=@localstatedir@
pidfile="${socket_dir}/${name}.pid"
zebra_precmd()
diff --git a/pkgsrc/ripd.sh b/pkgsrc/ripd.sh.in
similarity index 75%
rename from pkgsrc/ripd.sh
rename to pkgsrc/ripd.sh.in
index 6ba86c4..3157541 100644
--- a/pkgsrc/ripd.sh
+++ b/pkgsrc/ripd.sh.in
@@ -6,7 +6,7 @@
# REQUIRE: zebra
##
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@prefix@/sbin:@prefix@/bin
export PATH
if [ -f /etc/rc.subr ]
@@ -16,12 +16,12 @@
name="ripd"
rcvar=$name
-required_files="@PKG_SYSCONFDIR@/${name}.conf"
-command="@PREFIX@/sbin/${name}"
+required_files="@sysconfdir@/${name}.conf"
+command="@prefix@/sbin/${name}"
command_args="-d"
start_precmd="zebra_precmd"
-socket_dir=/var/run/zebra
+socket_dir=@localstatedir@
pidfile="${socket_dir}/${name}.pid"
zebra_precmd()
diff --git a/pkgsrc/ripngd.sh b/pkgsrc/ripngd.sh.in
similarity index 75%
rename from pkgsrc/ripngd.sh
rename to pkgsrc/ripngd.sh.in
index ff45b4e..d06ac90 100644
--- a/pkgsrc/ripngd.sh
+++ b/pkgsrc/ripngd.sh.in
@@ -6,7 +6,7 @@
# REQUIRE: zebra
##
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@prefix@/sbin:@prefix@/bin
export PATH
if [ -f /etc/rc.subr ]
@@ -16,12 +16,12 @@
name="ripngd"
rcvar=$name
-required_files="@PKG_SYSCONFDIR@/${name}.conf"
-command="@PREFIX@/sbin/${name}"
+required_files="@sysconfdir@/${name}.conf"
+command="@prefix@/sbin/${name}"
command_args="-d"
start_precmd="zebra_precmd"
-socket_dir=/var/run/zebra
+socket_dir=@localstatedir@
pidfile="${socket_dir}/${name}.pid"
zebra_precmd()
diff --git a/pkgsrc/zebra.sh b/pkgsrc/zebra.sh.in
similarity index 81%
rename from pkgsrc/zebra.sh
rename to pkgsrc/zebra.sh.in
index e4750f7..c2f12a7 100644
--- a/pkgsrc/zebra.sh
+++ b/pkgsrc/zebra.sh.in
@@ -6,7 +6,7 @@
# REQUIRE: NETWORKING
##
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@prefix@/sbin:@prefix@/bin
export PATH
if [ -f /etc/rc.subr ]
@@ -16,13 +16,13 @@
name="zebra"
rcvar=$name
-required_files="@PKG_SYSCONFDIR@/${name}.conf"
-command="@PREFIX@/sbin/${name}"
+required_files="@sysconfdir@/${name}.conf"
+command="@prefix@/sbin/${name}"
command_args="-d"
start_precmd="zebra_precmd"
stop_postcmd="zebra_postcmd"
-socket_dir=/var/run/zebra
+socket_dir=@localstatedir@
pidfile="${socket_dir}/${name}.pid"
zebra_precmd()