aboutsummaryrefslogtreecommitdiff
path: root/security/openvpn/files/pkg-req.in
blob: 15c8242d8724e0fc3f04c2a84f4d419f49f68d9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
set -e

rcvers() {
	# determine if we have "old" or "new" (rcorder integration) scheme
	# for %%PREFIX%%/etc/rc.d/* files
	if test $1 -ge 700007 || test $1 -lt 700000 -a $1 -ge 600101 ; then
		echo 2
	else
		echo 1
	fi
}

if [ "$2" = INSTALL ] ; then
	# check if the base system is new enough for us,
	# which should only matter for package installs.
	buildrc=$(rcvers %%OSVERSION%%)
	execrc=$(rcvers $(sysctl -n kern.osreldate) )
	if test $buildrc -gt $execrc ; then
		cat <<EOF

Error:   this package, $1, was compiled for a newer FreeBSD
======   version that uses different boot scripts.
         Therefore, the rc.d script WILL NOT WORK.
         Please update your ports tree and install security/openvpn from there.

EOF
		exit 1
	fi
fi