blob: d15ac765ba28af49ae83b5c3f264ecab7cbc32a9 (
plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# $NetBSD: INSTALL,v 1.6 2022/07/24 07:28:09 nia Exp $
UNAME="@UNAME@"
PKG_ADMIN="@PKG_ADMIN@"
case ${STAGE} in
PRE-INSTALL)
if ${TEST} no = "$($PKG_ADMIN config-var CHECK_OSABI)"; then
exit 0
fi
OS_VERSION=`${UNAME} -r`
PKG_VERSION="${PKGNAME##*-}"
case `${UNAME} -s` in
AIX)
if ${TEST} -f /usr/bin/oslevel ;then
OS_VERSION=`/usr/bin/oslevel | \
sed -e's/\([0-9]*\.[0-9]*\).*/\1/'`
else
OS_VERSION="`${UNAME} -v`.`${UNAME} -r`"
OS_VERSION=`echo "${OS_VERSION}" | \
sed -e's/\([0-9]*\.[0-9]*\).*/\1/'`
fi
;;
DragonFly|FreeBSD|Linux)
OS_VERSION=`echo "${OS_VERSION}" | sed -e's/-.*$//'`
;;
NetBSD)
if [ -f /etc/release ]; then
OS_VERSION=`head -1 /etc/release | \
sed -e "s,^NetBSD ,,g" -e "s,/.*$,,g"`
fi
;;
OSF1)
OS_VERSION=`echo "${OS_VERSION}" | sed -e's/^V//'`
;;
HPUX)
OS_VERSION=`echo "${OS_VERSION}" | sed -e's/^B.//'`
;;
CYGWIN_*)
OS_VERSION=`echo "${OS_VERSION}" | sed -e's/(.*)//'`
;;
esac
if ${TEST} "${OS_VERSION}" != "${PKG_VERSION}" ;then
echo "The Operating System version (${OS_VERSION}) does not match ${PKG_VERSION}"
echo "To force installation of this package, add CHECK_OSABI=no to pkg_install.conf"
exit 1
fi
;;
esac
|