1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-02 06:03:50 +00:00

- Change the way used to add/remove the shell on /etc/shells,

use pkg-install and pkg-deinstall (both stoled from shells/bash)
  to do it.
- Remove pre-install section, it's not more needed on this version,
  because Makefile is created correctly changing Makefile.PL

PR:		80583
Submitted by:	Renato Botelho (maintainer)
This commit is contained in:
Cheng-Lung Sung 2005-05-04 05:47:17 +00:00
parent b2e30b8793
commit cab771a7f9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=134574
8 changed files with 84 additions and 24 deletions

View File

@ -29,16 +29,7 @@ MAN3= Psh::Completion.3 \
Psh::Strategy.3 \
Psh::StrategyBunch.3
pre-install:
@${PERL} -pi -e "s:/usr/local:${PREFIX}:g" ${WRKSRC}/Makefile;
@${PERL} -pi -e "s:/usr/local/man/man1:${MAN3PREFIX}/man/man1:g" ${WRKSRC}/Makefile;
@${PERL} -pi -e "s:/usr/local/lib/perl5/5.00503/man/man3:${MAN3PREFIX}/man/man3:g" ${WRKSRC}/Makefile;
post-install:
@${ECHO_MSG} "Updating /etc/shells"
@${CP} /etc/shells /etc/shells.bak
@(${GREP} -v ${PREFIX}/bin/psh /etc/shells.bak; \
${ECHO_CMD} ${PREFIX}/bin/psh) > /etc/shells
@${RM} /etc/shells.bak
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>

View File

@ -0,0 +1,22 @@
#!/bin/sh
#
# $FreeBSD$
#
PSH="${PKG_PREFIX-/usr/local}/bin/psh"
SHELLS="${PKG_DESTDIR-}/etc/shells"
case $2 in
DEINSTALL)
if grep -qs "^$PSH\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
TMPSHELLS=`mktemp -t shells`
grep -v "^$PSH\$" "$SHELLS" > "$TMPSHELLS"
cat "$TMPSHELLS" > "$SHELLS"
rm "$TMPSHELLS"
else
echo "Not root, please remove $PSH from $SHELLS manually"
fi
fi
;;
esac

19
shells/perlsh/pkg-install Normal file
View File

@ -0,0 +1,19 @@
#!/bin/sh
#
# $FreeBSD$
#
PSH="${PKG_PREFIX-/usr/local}/bin/psh"
SHELLS="${PKG_DESTDIR-}/etc/shells"
case $2 in
POST-INSTALL)
if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$PSH\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
echo "$PSH" >> "$SHELLS"
else
echo "Not root, please add $PSH to $SHELLS manually"
fi
fi
;;
esac

View File

@ -1,7 +1,5 @@
@comment $FreeBSD$
bin/psh
@exec echo "updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak; echo %D/%F) >/etc/shells; rm -f /etc/shells.bak
@unexec echo "updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak) >/etc/shells; rm -f /etc/shells.bak
share/psh/complete/debian
share/psh/complete/perl
share/psh/complete/standard

View File

@ -29,16 +29,7 @@ MAN3= Psh::Completion.3 \
Psh::Strategy.3 \
Psh::StrategyBunch.3
pre-install:
@${PERL} -pi -e "s:/usr/local:${PREFIX}:g" ${WRKSRC}/Makefile;
@${PERL} -pi -e "s:/usr/local/man/man1:${MAN3PREFIX}/man/man1:g" ${WRKSRC}/Makefile;
@${PERL} -pi -e "s:/usr/local/lib/perl5/5.00503/man/man3:${MAN3PREFIX}/man/man3:g" ${WRKSRC}/Makefile;
post-install:
@${ECHO_MSG} "Updating /etc/shells"
@${CP} /etc/shells /etc/shells.bak
@(${GREP} -v ${PREFIX}/bin/psh /etc/shells.bak; \
${ECHO_CMD} ${PREFIX}/bin/psh) > /etc/shells
@${RM} /etc/shells.bak
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>

22
shells/psh/pkg-deinstall Normal file
View File

@ -0,0 +1,22 @@
#!/bin/sh
#
# $FreeBSD$
#
PSH="${PKG_PREFIX-/usr/local}/bin/psh"
SHELLS="${PKG_DESTDIR-}/etc/shells"
case $2 in
DEINSTALL)
if grep -qs "^$PSH\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
TMPSHELLS=`mktemp -t shells`
grep -v "^$PSH\$" "$SHELLS" > "$TMPSHELLS"
cat "$TMPSHELLS" > "$SHELLS"
rm "$TMPSHELLS"
else
echo "Not root, please remove $PSH from $SHELLS manually"
fi
fi
;;
esac

19
shells/psh/pkg-install Normal file
View File

@ -0,0 +1,19 @@
#!/bin/sh
#
# $FreeBSD$
#
PSH="${PKG_PREFIX-/usr/local}/bin/psh"
SHELLS="${PKG_DESTDIR-}/etc/shells"
case $2 in
POST-INSTALL)
if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$PSH\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
echo "$PSH" >> "$SHELLS"
else
echo "Not root, please add $PSH to $SHELLS manually"
fi
fi
;;
esac

View File

@ -1,7 +1,5 @@
@comment $FreeBSD$
bin/psh
@exec echo "updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak; echo %D/%F) >/etc/shells; rm -f /etc/shells.bak
@unexec echo "updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak) >/etc/shells; rm -f /etc/shells.bak
share/psh/complete/debian
share/psh/complete/perl
share/psh/complete/standard