pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/32285 (pkgsrc installation of shells/standalone-tcsh is messed up)
The following reply was made to PR pkg/32285; it has been noted by GNATS.
From: Hauke Fath <hf%spg.tu-darmstadt.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: agc%NetBSD.org@localhost, gnats-admin%NetBSD.org@localhost,
Hauke Fath <hf%spg.tu-darmstadt.de@localhost>
Subject: Re: pkg/32285 (pkgsrc installation of shells/standalone-tcsh is
messed up)
Date: Mon, 12 Dec 2005 14:12:16 +0100
Am 12.12.2005 um 11:57 Uhr +0000 schrieb agc%NetBSD.org@localhost:
>Can you look at the standalone-tcsh-* entry in ${PKG_DBDIR}
>please, and add it to the PR?
Here goes (filenames inserted):
#
# +BUILD_INFO
#
_PLIST_IGNORE_FILES=
_DISTFILES=tcsh-6.14.00.tar.gz
_PATCHFILES=
PKG_SYSCONFBASEDIR=/etc
PKG_SYSCONFDIR=/etc
PKGPATH=shells/standalone-tcsh
OPSYS=NetBSD
OS_VERSION=3.0_RC3
MACHINE_ARCH=i386
MACHINE_GNU_ARCH=i386
CPPFLAGS=
CFLAGS=-O2
FFLAGS=-O
LDFLAGS= -Wl,-R/usr/pkg/lib -static
CONFIGURE_ENV=CC=cc CFLAGS=-O2 CPPFLAGS= CXX=c++ CXXFLAGS=-O2
COMPILER_RPATH_FLAG=-Wl,-R F77=f77 FC=f77 FFLAGS=-O LANG=C
LC_COLLATE=C LC_CTYPE=C LC_MESSAGES=C LC_MONETARY=C LC_NUMERIC=C
LC_TIME=C LDFLAGS=-Wl,-R/usr/pkg/lib\ -static LINKER_RPATH_FLAG=-R
PATH=/usr/src/pkgsrc/shells/standalone-tcsh/work/.wrapper/bin:/usr/src/pkgsrc/shells/standalone-tcsh/work/.buildlink/bin:/usr/src/pkgsrc/shells/standalone-tcsh/work/.gcc/bin:/usr/src/pkgsrc/shells/standalone-tcsh/work/.tools/bin:/usr/pkg/bin:/home/hf/bin:/sbin:/usr/sbin:/usr/pkg/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/usr/pkg/bin:/usr/X11R6/bin:/usr/pkg/java/sun-1.3.1/bin:/misc/matlab/bin:/usr/pkg/java/sun-1.4/bin:/usr/pkg/bin:/usr/X11R6/bin
PREFIX=/ PKG_SYSCONFDIR=/etc CONFIG_SHELL=/bin/sh LIBS=
install_sh=/usr/bin/install
INSTALL_INFO=/usr/src/pkgsrc/shells/standalone-tcsh/work/.tools/bin/install-info
MAKEINFO=/usr/src/pkgsrc/shells/standalone-tcsh/work/.tools/bin/makeinfo
AWK=/usr/bin/awk CHMOD=/bin/chmod CMP=/usr/bin/cmp CP=/bin/cp
DIFF=/usr/bin/diff ECHO=echo ac_cv_path_ECHO=echo
EGREP=/usr/bin/egrep ac_cv_path_EGREP=/usr/bin/egrep
SETENV=/usr/bin/env ENV_PROG=/usr/bin/env ac_cv_path_ENV=/usr/bin/env
FALSE=false ac_cv_path_FALSE=false FIND=/usr/bin/find
GREP=/usr/bin/grep ac_cv_path_GREP=/usr/bin/grep
HOSTNAME=/bin/hostname LN=/bin/ln LS=/bin/ls MKDIR=/bin/mkdir
MV=/bin/mv RM=/bin/rm RMDIR=/bin/rmdir SED=/usr/bin/sed
SORT=/usr/bin/sort TAR=/bin/tar TEST=test ac_cv_path_TEST=test
TOUCH=/usr/bin/touch TR=/usr/bin/tr TRUE=true ac_cv_path_TRUE=true
PKG_CONFIG=
PKG_CONFIG_LIBDIR=/usr/src/pkgsrc/shells/standalone-tcsh/work/.buildlink/lib/pkgconfig
PKG_CONFIG_LOG=/usr/src/pkgsrc/shells/standalone-tcsh/work/.pkg-config.log
MAKE=make WRAPPER_DEBUG=yes WRAPPER_UPDATE_CACHE=yes
CONFIGURE_ARGS=--prefix=/ --host=i386--netbsdelf --mandir=//man
--prefix=/ --bindir=/bin --mandir=/usr/share/man
OBJECT_FMT=ELF
LICENSE=
RESTRICTED=
NO_SRC_ON_FTP=
NO_SRC_ON_CDROM=
NO_BIN_ON_FTP=
NO_BIN_ON_CDROM=
CC_VERSION=gcc-3.3.3
_PKGTOOLS_VER=20051122
#
# +BUILD_VERSION
#
shells/standalone-tcsh/Makefile:# $NetBSD: Makefile,v 1.18 2005/12/05
23:55:19 rillig Exp $
shells/standalone-tcsh/Makefile:# $NetBSD: Makefile,v 1.18 2005/12/05
23:55:19 rillig Exp $
shells/standalone-tcsh/PLIST:@comment $NetBSD: PLIST,v 1.4 2004/01/11
23:06:54 grant Exp $
shells/standalone-tcsh/../../shells/tcsh/patches/patch-aa:$NetBSD:
patch-aa,v 1.8 2004/05/19 17:42:35 kim Exp $
shells/standalone-tcsh/../../shells/tcsh/patches/patch-ab:$NetBSD:
patch-ab,v 1.9 2005/09/20 14:18:02 tron Exp $
shells/standalone-tcsh/../../shells/tcsh/patches/patch-ac:$NetBSD:
patch-ac,v 1.9 2005/11/10 22:54:09 joerg Exp $
shells/standalone-tcsh/../../shells/tcsh/patches/patch-ad:$NetBSD:
patch-ad,v 1.9 2005/07/14 23:58:37 grant Exp $
shells/standalone-tcsh/../../shells/tcsh/patches/patch-ae:$NetBSD:
patch-ae,v 1.7 2005/11/10 23:04:10 joerg Exp $
shells/standalone-tcsh/../../shells/tcsh/patches/patch-ap:$NetBSD:
patch-ap,v 1.1 2005/03/29 04:38:10 kim Exp $
#
# +COMMENT
#
Standalone version of the Extended C-shell
#
# +CONTENTS
#
#
# +DEINSTALL
#
#!/bin/sh
#
# start of header
#
# $NetBSD: header,v 1.34 2005/08/19 22:24:10 jlam Exp $
PKGNAME=$1
STAGE=$2
AWK="/usr/bin/awk"
BASENAME="/usr/bin/basename"
CAT="/bin/cat"
CHGRP="/usr/bin/chgrp"
CHMOD="/bin/chmod"
CHOWN="/usr/sbin/chown"
CMP="/usr/bin/cmp"
CP="/bin/cp"
DIRNAME="/usr/bin/dirname"
ECHO="echo"
ECHO_N="echo -n"
EGREP="/usr/bin/egrep"
EXPR="/bin/expr"
FALSE="false"
FIND="/usr/bin/find"
GREP="/usr/bin/grep"
GTAR=""
HEAD="/usr/bin/head"
ID="/usr/bin/id"
LINKFARM="/usr/sbin/linkfarm"
LN="/bin/ln"
LS="/bin/ls"
MKDIR="/bin/mkdir -p"
MV="/bin/mv"
PERL5="/usr/pkg/bin/perl"
PKG_ADMIN="/usr/sbin/pkg_admin"
PKG_INFO="/usr/sbin/pkg_info"
PWD_CMD="/bin/pwd"
RM="/bin/rm"
RMDIR="/bin/rmdir"
SED="/usr/bin/sed"
SETENV="/usr/bin/env"
SH="/bin/sh"
SORT="/usr/bin/sort"
SU="/usr/bin/su"
TEST="test"
TOUCH="/usr/bin/touch"
TR="/usr/bin/tr"
TRUE="true"
XARGS="/usr/bin/xargs"
: ${PKG_METADATA_DIR=`${PWD_CMD}`}
PKGBASE="standalone-tcsh"
LOCALBASE="/usr/pkg"
X11BASE="/usr/X11R6"
DEPOTBASE="/usr/pkg/packages"
PREFIX="/"
case ${PKG_PREFIX} in
${LOCALBASE}/*) VIEW="${PKG_PREFIX#${LOCALBASE}/}" ;;
*) VIEW="" ;;
esac
PKG_SYSCONFBASE="/etc"
PKG_SYSCONFDEPOTBASE=""
PKG_SYSCONFBASEDIR="/etc"
PKG_SYSCONFDIR="/etc"
CONF_DEPENDS=""
case ${VIEW} in
"") PKG_SYSCONFVIEWBASE="${PKG_SYSCONFBASE}" ;;
*) PKG_SYSCONFVIEWBASE="${PKG_SYSCONFBASE}/${VIEW}" ;;
esac
CONF_IGNORE_FILES="*[~#] *.OLD *.orig *,v .pkgsrc */.pkgsrc"
PKG_INSTALLATION_TYPE="overwrite"
case "${PKG_CONFIG:-YES}" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
_PKG_CONFIG=yes
;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
_PKG_CONFIG=yes
;;
esac
# end of header
# start of deinstall-pre
#
# $NetBSD: deinstall-pre,v 1.1 2003/11/23 07:14:43 jlam Exp $
# Ensure that the VIEW-DEINSTALL action is called for overwrite packages.
# This is here to ensure that it's the first DEINSTALL action (before
# any DEINSTALL_EXTRA_TMPL DEINSTALL actions).
#
case ${STAGE} in
DEINSTALL)
if [ "${PKG_INSTALLATION_TYPE}" = "overwrite" ]; then
${SETENV} PKG_PREFIX="${PKG_PREFIX}" \
$0 ${PKGNAME} VIEW-DEINSTALL
fi
;;
esac
# end of deinstall-pre
# -*- sh -*-
# start of deinstall
#
# $NetBSD: deinstall,v 1.36 2005/08/19 22:24:10 jlam Exp $
case ${STAGE} in
VIEW-DEINSTALL)
case ${_PKG_CONFIG} in
yes)
case ${PKG_SYSCONFDEPOTBASE} in
"")
${TEST} ! -x ./+FILES ||
./+FILES VIEW-REMOVE ${PREFIX} ${PKG_PREFIX}
;;
*)
${SETENV} PLIST_IGNORE_FILES="${CONF_IGNORE_FILES}" \
${LINKFARM} -D -t
${PKG_SYSCONFVIEWBASE} -d ${PKG_SYSCONFDEPOTBASE} ${PKGNAME}
${RMDIR} -p ${PKG_SYSCONFVIEWBASE}
2>/dev/null || ${TRUE}
;;
esac
;;
esac
#
# Remove shells from /etc/shells.
#
${TEST} ! -x ./+SHELL ||
./+SHELL REMOVE ${PKG_METADATA_DIR}
${TEST} ! -x ./+SHELL ||
./+SHELL CHECK-REMOVE ${PKG_METADATA_DIR}
;;
DEINSTALL)
# Remove configuration files if they don't differ from the default
# config file.
#
${TEST} ! -x ./+FILES ||
./+FILES REMOVE ${PKG_METADATA_DIR}
${TEST} ! -x ./+RCD_SCRIPTS ||
./+RCD_SCRIPTS REMOVE ${PKG_METADATA_DIR}
;;
POST-DEINSTALL)
if [ "${PKG_INSTALLATION_TYPE}" = "pkgviews" -a \
"${_PKG_CONFIG}" = "yes" -a -n "${CONF_DEPENDS}" ]; then
if [ -h ${PKG_SYSCONFDIR} ]; then
${RM} -f ${PKG_SYSCONFDIR}
fi
${RMDIR} -p `${DIRNAME} ${PKG_SYSCONFDIR}`
2>/dev/null || ${TRUE}
fi
#
# Remove empty directories and unused users/groups.
#
${TEST} ! -x ./+DIRS ||
./+DIRS REMOVE ${PKG_METADATA_DIR}
${TEST} ! -x ./+USERGROUP ||
./+USERGROUP REMOVE ${PKG_METADATA_DIR}
#
# Check for any existing bits after we're finished de-installing.
#
${TEST} ! -x ./+USERGROUP ||
./+USERGROUP CHECK-REMOVE ${PKG_METADATA_DIR}
${TEST} ! -x ./+FILES ||
./+FILES CHECK-REMOVE ${PKG_METADATA_DIR}
${TEST} ! -x ./+RCD_SCRIPTS ||
./+RCD_SCRIPTS CHECK-REMOVE ${PKG_METADATA_DIR}
${TEST} ! -x ./+DIRS ||
./+DIRS CHECK-REMOVE ${PKG_METADATA_DIR}
;;
esac
# end of deinstall
# start of footer
#
# $NetBSD: footer,v 1.1 2001/11/19 16:18:44 jlam Exp $
exit 0
# end of footer
#
# +DESC
#
TCSH is an extended C-shell with many useful features like
filename completion, history editing, etc.
This version installs a statically-linked version of tcsh into
/bin, for use as a standalone shell.
Homepage:
http://www.tcsh.org/
#
# +INSTALL
#
#!/bin/sh
#
# start of header
#
# $NetBSD: header,v 1.34 2005/08/19 22:24:10 jlam Exp $
PKGNAME=$1
STAGE=$2
AWK="/usr/bin/awk"
BASENAME="/usr/bin/basename"
CAT="/bin/cat"
CHGRP="/usr/bin/chgrp"
CHMOD="/bin/chmod"
CHOWN="/usr/sbin/chown"
CMP="/usr/bin/cmp"
CP="/bin/cp"
DIRNAME="/usr/bin/dirname"
ECHO="echo"
ECHO_N="echo -n"
EGREP="/usr/bin/egrep"
EXPR="/bin/expr"
FALSE="false"
FIND="/usr/bin/find"
GREP="/usr/bin/grep"
GTAR=""
HEAD="/usr/bin/head"
ID="/usr/bin/id"
LINKFARM="/usr/sbin/linkfarm"
LN="/bin/ln"
LS="/bin/ls"
MKDIR="/bin/mkdir -p"
MV="/bin/mv"
PERL5="/usr/pkg/bin/perl"
PKG_ADMIN="/usr/sbin/pkg_admin"
PKG_INFO="/usr/sbin/pkg_info"
PWD_CMD="/bin/pwd"
RM="/bin/rm"
RMDIR="/bin/rmdir"
SED="/usr/bin/sed"
SETENV="/usr/bin/env"
SH="/bin/sh"
SORT="/usr/bin/sort"
SU="/usr/bin/su"
TEST="test"
TOUCH="/usr/bin/touch"
TR="/usr/bin/tr"
TRUE="true"
XARGS="/usr/bin/xargs"
: ${PKG_METADATA_DIR=`${PWD_CMD}`}
PKGBASE="standalone-tcsh"
LOCALBASE="/usr/pkg"
X11BASE="/usr/X11R6"
DEPOTBASE="/usr/pkg/packages"
PREFIX="/"
case ${PKG_PREFIX} in
${LOCALBASE}/*) VIEW="${PKG_PREFIX#${LOCALBASE}/}" ;;
*) VIEW="" ;;
esac
PKG_SYSCONFBASE="/etc"
PKG_SYSCONFDEPOTBASE=""
PKG_SYSCONFBASEDIR="/etc"
PKG_SYSCONFDIR="/etc"
CONF_DEPENDS=""
case ${VIEW} in
"") PKG_SYSCONFVIEWBASE="${PKG_SYSCONFBASE}" ;;
*) PKG_SYSCONFVIEWBASE="${PKG_SYSCONFBASE}/${VIEW}" ;;
esac
CONF_IGNORE_FILES="*[~#] *.OLD *.orig *,v .pkgsrc */.pkgsrc"
PKG_INSTALLATION_TYPE="overwrite"
case "${PKG_CONFIG:-YES}" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
_PKG_CONFIG=yes
;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
_PKG_CONFIG=yes
;;
esac
# end of header
# start of install-shell
#
# Generate a +SHELL script that handles shell registration.
#
case ${STAGE} in
PRE-INSTALL|UNPACK)
${CAT} > ./+SHELL << 'EOF_SHELL'
#!/bin/sh
#
# $NetBSD: shell,v 1.4 2005/09/20 04:23:49 jlam Exp $
#
# +SHELL - shell registration script
#
# Usage: ./+SHELL ADD|REMOVE [metadatadir]
# ./+SHELL CHECK-ADD|CHECK-REMOVE [metadatadir]
#
# This script supports two actions, ADD and REMOVE, that will add or
# remove shell paths from the shell database in /etc/shells. The
# CHECK-ADD action will check whether shell paths provided by the
# package are missing from the shell database, and print an informative
# message noting those shell paths. The CHECK-REMOVE action will check
# whether shell paths provided by the package are still present in the
# shell database, and print an informative message noting those shell
# paths. The CHECK-ADD and CHECK-REMOVE actions return non-zero if
# they detect either missing or existing paths, respectively.
#
# Lines starting with "# SHELL: " are data read by this script that
# name the shell paths that should be added or removed from the shell
# database. If the path is relative, then it is taken to be relative
# to ${PKG_PREFIX}.
#
# # SHELL: bin/pdksh
#
CAT="/bin/cat"
CP="/bin/cp"
ECHO="echo"
GREP="/usr/bin/grep"
PWD_CMD="/bin/pwd"
RM="/bin/rm"
SED="/usr/bin/sed"
SORT="/usr/bin/sort"
TEST="test"
TRUE="true"
TOUCH="/usr/bin/touch"
SELF=$0
ACTION=$1
PKG_METADATA_DIR="${2-`${PWD_CMD}`}"
: ${PKG_PREFIX=/}
: ${PKGNAME=${PKG_METADATA_DIR##*/}}
case "${PKG_REGISTER_SHELLS:-YES}" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
_PKG_REGISTER_SHELLS=yes
;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
_PKG_REGISTER_SHELLS=no
;;
esac
exitcode=0
case $ACTION in
ADD)
${SED} -n "/^\# SHELL: /{s/^\# SHELL: //;p;}" ${SELF} | ${SORT} -u |
{ while read shell; do
case ${_PKG_REGISTER_SHELLS} in
no) continue ;;
esac
case $shell in
/*) continue ;;
*) if [ ${PKG_PREFIX} = / ] ; then
shell="/$shell"
else
shell="${PKG_PREFIX}/$shell"
fi ;;
esac
${TEST} -f "$shell" || continue
shelldb="/etc/shells"
${TEST} -f "$shelldb" || continue
if ${TEST} -f "$shelldb" && \
${GREP} "^$shell" $shelldb >/dev/null; then
:
else
case "$printed_header" in
yes) ;;
*) printed_header=yes
${ECHO}
"==========================================================================="
${ECHO} "Adding shells from
${PKGNAME} to $shelldb:"
${ECHO} ""
;;
esac
${ECHO} " $shell"
${TOUCH} $shelldb
${CP} $shelldb $shelldb.pkgsrc."$$"
{ ${CAT} $shelldb.pkgsrc."$$"; ${ECHO}
"$shell"; } > $shelldb
${RM} $shelldb.pkgsrc."$$"
fi
done
case "$printed_header" in
yes) ${ECHO} ""
${ECHO}
"==========================================================================="
;;
esac; }
;;
REMOVE)
${SED} -n "/^\# SHELL: /{s/^\# SHELL: //;p;}" ${SELF} | ${SORT} -u |
{ while read shell; do
case ${_PKG_REGISTER_SHELLS} in
no) continue ;;
esac
case $shell in
/*) continue ;;
*) if [ ${PKG_PREFIX} = / ] ; then
shell="/$shell"
else
shell="${PKG_PREFIX}/$shell"
fi ;;
esac
${TEST} -f "$shell" || continue
shelldb="/etc/shells"
if ${TEST} -f "$shelldb" && \
${GREP} "^$shell" $shelldb >/dev/null; then
case "$printed_header" in
yes) ;;
*) printed_header=yes
${ECHO}
"==========================================================================="
${ECHO} "Removing shells from
${PKGNAME} to $shelldb:"
${ECHO} ""
;;
esac
${ECHO} " $shell"
${TOUCH} $shelldb
${CP} $shelldb $shelldb.pkgsrc."$$"
{ ${GREP} -v "^$shell" $shelldb.pkgsrc."$$"
|| ${TRUE}; } > $shelldb
${RM} $shelldb.pkgsrc."$$"
fi
done
case "$printed_header" in
yes) ${ECHO} ""
${ECHO}
"==========================================================================="
;;
esac; }
;;
CHECK-ADD)
${SED} -n "/^\# SHELL: /{s/^\# SHELL: //;p;}" ${SELF} | ${SORT} -u |
{ while read shell; do
case $shell in
/*) continue ;;
*) if [ ${PKG_PREFIX} = / ] ; then
shell="/$shell"
else
shell="${PKG_PREFIX}/$shell"
fi ;;
esac
${TEST} -f "$shell" || continue
shelldb="/etc/shells"
if ${TEST} -f "$shelldb" && \
${GREP} "^$shell" $shelldb >/dev/null; then
:
else
case "$printed_header" in
yes) ;;
*) printed_header=yes
${ECHO}
"==========================================================================="
${ECHO} "The following lines can be
added to $shelldb:"
${ECHO} ""
;;
esac
${ECHO} " $shell"
fi
done
case "$printed_header" in
yes) ${ECHO} ""
${ECHO}
"==========================================================================="
exit 1
;;
esac; }
${TEST} $? -eq 0 || exitcode=1
;;
CHECK-REMOVE)
${SED} -n "/^\# SHELL: /{s/^\# SHELL: //;p;}" ${SELF} | ${SORT} -u |
{ while read shell; do
case $shell in
/*) continue ;;
*) if [ ${PKG_PREFIX} = / ] ; then
shell="/$shell"
else
shell="${PKG_PREFIX}/$shell"
fi ;;
esac
${TEST} -f "$shell" || continue
shelldb="/etc/shells"
if ${TEST} -f "$shelldb" && \
${GREP} "^$shell" $shelldb >/dev/null; then
case "$printed_header" in
yes) ;;
*) printed_header=yes
${ECHO}
"==========================================================================="
${ECHO} "The following lines can be
removed from $shelldb:"
${ECHO} ""
;;
esac
${ECHO} " $shell"
fi
done
case "$printed_header" in
yes) ${ECHO} ""
${ECHO}
"==========================================================================="
exit 1
;;
esac; }
${TEST} $? -eq 0 || exitcode=1
;;
*)
${ECHO} "Usage: ./+SHELL ADD|REMOVE [metadatadir]"
${ECHO} " ./+SHELL CHECK-ADD|CHECK-REMOVE [metadatadir]"
;;
esac
exit $exitcode
# SHELL: bin/tcsh
EOF_SHELL
${CHMOD} +x ./+SHELL
;;
esac
# end of install-shell
# -*- sh -*-
# start of install
#
# $NetBSD: install,v 1.41 2005/08/19 22:24:10 jlam Exp $
case ${STAGE} in
PRE-INSTALL)
#
# Require that necessary users and groups exist or else fail the
# installation of the package.
#
${TEST} ! -x ./+USERGROUP ||
{ ./+USERGROUP ADD ${PKG_METADATA_DIR}
if ./+USERGROUP CHECK-ADD ${PKG_METADATA_DIR}; then
:
else
exit 1
fi; }
#
# Create package directories at pre-install time.
#
if [ "${PKG_INSTALLATION_TYPE}" = "pkgviews" -a \
"${_PKG_CONFIG}" = "yes" -a -n "${CONF_DEPENDS}" ]; then
pkg=`${PKG_ADMIN} -b -d ${DEPOTBASE} -s "" lsbest
"${CONF_DEPENDS}"`
sysconfdir=`${PKG_INFO} -B -K ${DEPOTBASE} $pkg | \
${AWK} '/^PKG_SYSCONFDIR=/ { \
gsub("^PKG_SYSCONFDIR=[ ]*", ""); \
print; \
}' \
`
if [ -d $sysconfdir -a ! -d ${PKG_SYSCONFDIR} ]; then
${MKDIR} -p `${DIRNAME} ${PKG_SYSCONFDIR}`
${LN} -sf $sysconfdir ${PKG_SYSCONFDIR}
fi
fi
${TEST} ! -x ./+DIRS ||
./+DIRS ADD ${PKG_METADATA_DIR}
;;
POST-INSTALL)
#
# Copy configuration/support files into place.
#
${TEST} ! -x ./+FILES ||
./+FILES ADD ${PKG_METADATA_DIR}
${TEST} ! -x ./+RCD_SCRIPTS ||
./+RCD_SCRIPTS ADD ${PKG_METADATA_DIR}
#
# Set special permissions on any files/directories that need them.
#
${TEST} ! -x ./+PERMS ||
./+PERMS ${PKG_METADATA_DIR}
# Check for any missing bits after we're finished installing.
#
${TEST} ! -x ./+DIRS ||
./+DIRS CHECK-ADD ${PKG_METADATA_DIR}
${TEST} ! -x ./+FILES ||
./+FILES CHECK-ADD ${PKG_METADATA_DIR}
${TEST} ! -x ./+RCD_SCRIPTS ||
./+RCD_SCRIPTS CHECK-ADD ${PKG_METADATA_DIR}
;;
VIEW-INSTALL)
#
# Register shells in /etc/shells.
#
${TEST} ! -x ./+SHELL ||
./+SHELL ADD ${PKG_METADATA_DIR}
${TEST} ! -x ./+SHELL ||
./+SHELL CHECK-ADD ${PKG_METADATA_DIR}
# If ${PKG_SYSCONFBASE} points outside of ${PREFIX}, then add the
# package config files to the proper view.
#
if [ "${_PKG_CONFIG}" = "yes" -a -n "${PKG_SYSCONFDEPOTBASE}" ]; then
${SETENV} PLIST_IGNORE_FILES="${CONF_IGNORE_FILES}" \
${LINKFARM} -t ${PKG_SYSCONFVIEWBASE} -d
${PKG_SYSCONFDEPOTBASE} ${PKGNAME}
fi
;;
esac
# end of install
# start of install-post
#
# $NetBSD: install-post,v 1.1 2003/11/23 07:14:43 jlam Exp $
# Ensure that the VIEW-INSTALL action is called for overwrite packages.
# This is here to ensure that it's the final POST-INSTALL action (after
# any INSTALL_EXTRA_TMPL POST-INSTALL actions).
#
case ${STAGE} in
POST-INSTALL)
if [ "${PKG_INSTALLATION_TYPE}" = "overwrite" ]; then
${SETENV} PKG_PREFIX="${PKG_PREFIX}" \
$0 ${PKGNAME} VIEW-INSTALL
fi
;;
esac
# end of install-post
# start of footer
#
# $NetBSD: footer,v 1.1 2001/11/19 16:18:44 jlam Exp $
exit 0
# end of footer
#
# +SHELL
#
#!/bin/sh
#
# $NetBSD: shell,v 1.4 2005/09/20 04:23:49 jlam Exp $
#
# +SHELL - shell registration script
#
# Usage: ./+SHELL ADD|REMOVE [metadatadir]
# ./+SHELL CHECK-ADD|CHECK-REMOVE [metadatadir]
#
# This script supports two actions, ADD and REMOVE, that will add or
# remove shell paths from the shell database in /etc/shells. The
# CHECK-ADD action will check whether shell paths provided by the
# package are missing from the shell database, and print an informative
# message noting those shell paths. The CHECK-REMOVE action will check
# whether shell paths provided by the package are still present in the
# shell database, and print an informative message noting those shell
# paths. The CHECK-ADD and CHECK-REMOVE actions return non-zero if
# they detect either missing or existing paths, respectively.
#
# Lines starting with "# SHELL: " are data read by this script that
# name the shell paths that should be added or removed from the shell
# database. If the path is relative, then it is taken to be relative
# to ${PKG_PREFIX}.
#
# # SHELL: bin/pdksh
#
CAT="/bin/cat"
CP="/bin/cp"
ECHO="echo"
GREP="/usr/bin/grep"
PWD_CMD="/bin/pwd"
RM="/bin/rm"
SED="/usr/bin/sed"
SORT="/usr/bin/sort"
TEST="test"
TRUE="true"
TOUCH="/usr/bin/touch"
SELF=$0
ACTION=$1
PKG_METADATA_DIR="${2-`${PWD_CMD}`}"
: ${PKG_PREFIX=/}
: ${PKGNAME=${PKG_METADATA_DIR##*/}}
case "${PKG_REGISTER_SHELLS:-YES}" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
_PKG_REGISTER_SHELLS=yes
;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
_PKG_REGISTER_SHELLS=no
;;
esac
exitcode=0
case $ACTION in
ADD)
${SED} -n "/^\# SHELL: /{s/^\# SHELL: //;p;}" ${SELF} | ${SORT} -u |
{ while read shell; do
case ${_PKG_REGISTER_SHELLS} in
no) continue ;;
esac
case $shell in
/*) continue ;;
*) if [ ${PKG_PREFIX} = / ] ; then
shell="/$shell"
else
shell="${PKG_PREFIX}/$shell"
fi ;;
esac
${TEST} -f "$shell" || continue
shelldb="/etc/shells"
${TEST} -f "$shelldb" || continue
if ${TEST} -f "$shelldb" && \
${GREP} "^$shell" $shelldb >/dev/null; then
:
else
case "$printed_header" in
yes) ;;
*) printed_header=yes
${ECHO}
"==========================================================================="
${ECHO} "Adding shells from
${PKGNAME} to $shelldb:"
${ECHO} ""
;;
esac
${ECHO} " $shell"
${TOUCH} $shelldb
${CP} $shelldb $shelldb.pkgsrc."$$"
{ ${CAT} $shelldb.pkgsrc."$$"; ${ECHO}
"$shell"; } > $shelldb
${RM} $shelldb.pkgsrc."$$"
fi
done
case "$printed_header" in
yes) ${ECHO} ""
${ECHO}
"==========================================================================="
;;
esac; }
;;
REMOVE)
${SED} -n "/^\# SHELL: /{s/^\# SHELL: //;p;}" ${SELF} | ${SORT} -u |
{ while read shell; do
case ${_PKG_REGISTER_SHELLS} in
no) continue ;;
esac
case $shell in
/*) continue ;;
*) if [ ${PKG_PREFIX} = / ] ; then
shell="/$shell"
else
shell="${PKG_PREFIX}/$shell"
fi ;;
esac
${TEST} -f "$shell" || continue
shelldb="/etc/shells"
if ${TEST} -f "$shelldb" && \
${GREP} "^$shell" $shelldb >/dev/null; then
case "$printed_header" in
yes) ;;
*) printed_header=yes
${ECHO}
"==========================================================================="
${ECHO} "Removing shells from
${PKGNAME} to $shelldb:"
${ECHO} ""
;;
esac
${ECHO} " $shell"
${TOUCH} $shelldb
${CP} $shelldb $shelldb.pkgsrc."$$"
{ ${GREP} -v "^$shell" $shelldb.pkgsrc."$$"
|| ${TRUE}; } > $shelldb
${RM} $shelldb.pkgsrc."$$"
fi
done
case "$printed_header" in
yes) ${ECHO} ""
${ECHO}
"==========================================================================="
;;
esac; }
;;
CHECK-ADD)
${SED} -n "/^\# SHELL: /{s/^\# SHELL: //;p;}" ${SELF} | ${SORT} -u |
{ while read shell; do
case $shell in
/*) continue ;;
*) if [ ${PKG_PREFIX} = / ] ; then
shell="/$shell"
else
shell="${PKG_PREFIX}/$shell"
fi ;;
esac
${TEST} -f "$shell" || continue
shelldb="/etc/shells"
if ${TEST} -f "$shelldb" && \
${GREP} "^$shell" $shelldb >/dev/null; then
:
else
case "$printed_header" in
yes) ;;
*) printed_header=yes
${ECHO}
"==========================================================================="
${ECHO} "The following lines can be
added to $shelldb:"
${ECHO} ""
;;
esac
${ECHO} " $shell"
fi
done
case "$printed_header" in
yes) ${ECHO} ""
${ECHO}
"==========================================================================="
exit 1
;;
esac; }
${TEST} $? -eq 0 || exitcode=1
;;
CHECK-REMOVE)
${SED} -n "/^\# SHELL: /{s/^\# SHELL: //;p;}" ${SELF} | ${SORT} -u |
{ while read shell; do
case $shell in
/*) continue ;;
*) if [ ${PKG_PREFIX} = / ] ; then
shell="/$shell"
else
shell="${PKG_PREFIX}/$shell"
fi ;;
esac
${TEST} -f "$shell" || continue
shelldb="/etc/shells"
if ${TEST} -f "$shelldb" && \
${GREP} "^$shell" $shelldb >/dev/null; then
case "$printed_header" in
yes) ;;
*) printed_header=yes
${ECHO}
"==========================================================================="
${ECHO} "The following lines can be
removed from $shelldb:"
${ECHO} ""
;;
esac
${ECHO} " $shell"
fi
done
case "$printed_header" in
yes) ${ECHO} ""
${ECHO}
"==========================================================================="
exit 1
;;
esac; }
${TEST} $? -eq 0 || exitcode=1
;;
*)
${ECHO} "Usage: ./+SHELL ADD|REMOVE [metadatadir]"
${ECHO} " ./+SHELL CHECK-ADD|CHECK-REMOVE [metadatadir]"
;;
esac
exit $exitcode
# SHELL: bin/tcsh
#
# +SIZE_ALL
#
1389585
#
# +SIZE_PKG
#
1389585
--
/~\ The ASCII Ribbon Campaign Hauke Fath
\ / No HTML/RTF in email Institut für Nachrichtentechnik
X No Word docs in email TU Darmstadt
/ \ Respect for open standards Ruf +49-6151-16-3281
Home |
Main Index |
Thread Index |
Old Index