mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-21 04:06:46 +00:00
- Use USERS and GROUPS
- Use pre-su-install to create directories under PREFIX PR: ports/157542 Submitted by: crees (me) Approved by: rene (mentor, implicit)
This commit is contained in:
parent
143e7b3dcd
commit
7a13ece99f
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=277392
@ -21,6 +21,8 @@ DISTDIR= ${MOUNT_PT}/fbsd
|
||||
MOUNT_PT?= /cdrom
|
||||
MOUNT_DEV?= /dev/acd0c
|
||||
|
||||
USERS= wnn
|
||||
|
||||
RESTRICTED= "You should buy from Omron Software Co., Ltd."
|
||||
NO_BUILD= yes
|
||||
IS_INTERACTIVE= yes
|
||||
@ -81,7 +83,7 @@ pre-extract::
|
||||
post-extract:
|
||||
@/sbin/umount ${MOUNT_PT}
|
||||
|
||||
pre-install:
|
||||
pre-su-install:
|
||||
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
||||
|
||||
do-install:
|
||||
|
@ -81,75 +81,6 @@ PRE-INSTALL)
|
||||
fi
|
||||
fi
|
||||
|
||||
## Hack /etc/master.passwd ##
|
||||
# check
|
||||
id_69=`id -u 69 2> /dev/null`
|
||||
id_wnn=`id -u wnn 2> /dev/null`
|
||||
if [ X"$id_wnn" = X69 ];then
|
||||
exit 0
|
||||
elif [ X"$id_69" != X ]; then
|
||||
cat <<EOF
|
||||
|
||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
This system already has an account whose name is not 'wnn' and ID
|
||||
number is 69.
|
||||
|
||||
'`id 69`'
|
||||
|
||||
For Wnn6 in this port or package, ID number of 'wnn' has to be 69.
|
||||
Please try again after you delete the account.
|
||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
EOF
|
||||
exit 1
|
||||
elif [ X"$id_wnn" != X ]; then
|
||||
cat <<EOF
|
||||
|
||||
This system has an 'wnn' account whose ID number is $id_wnn. It seems
|
||||
that Wnn4.2 has been already installed. For Wnn6 in this ports or
|
||||
package, ID number of 'wnn' has to be 69. So we do the following two
|
||||
things:
|
||||
|
||||
1) You should delete the account.
|
||||
|
||||
2) It seems that all of files or directories for Wnn4.2 are in
|
||||
${PKG_PREFIX}/lib/wnn and ${PKG_PREFIX}/bin. You should change these ID
|
||||
number from '$id_wnn' to '69'.
|
||||
|
||||
Notice: After doing 1) and 2), we will create a new 'wnn' account
|
||||
whose ID number is '69'.
|
||||
|
||||
EOF
|
||||
if yesno "Would you like to do the above things automatically" y; then
|
||||
# We need a command 'pw(8)'
|
||||
check_pw
|
||||
pw userdel wnn
|
||||
if [ $? != 0 ]; then
|
||||
echo ""
|
||||
echo "Cannot delete it. Please do it, and try again."
|
||||
exit 1
|
||||
fi
|
||||
find ${PKG_PREFIX}/lib/wnn ${PKG_PREFIX}/bin \
|
||||
-user $id_wnn -exec chown 69 {} \;
|
||||
else
|
||||
echo "Please do those, and try again."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# add an account 'wnn' to this system
|
||||
echo ""
|
||||
echo "You need an account 'wnn' whose ID number is 69"
|
||||
if yesno "Would you like to create it automatically?" y; then
|
||||
# We need a command 'pw(8)'
|
||||
check_pw
|
||||
pw useradd wnn -u 69 -g 7 -h - -d /nonexistent \
|
||||
-s /nonexistent -c Wnn6 || exit
|
||||
else
|
||||
echo "Please create it, and try again."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
POST-INSTALL)
|
||||
|
||||
mkdir -p /usr/local/bin
|
||||
|
Loading…
Reference in New Issue
Block a user