#!/bin/sh
#
# $NetBSD: header,v 1.3 2014/12/30 15:13:20 wiz Exp $

SELF="$0"
PKGNAME="$1"
STAGE="$2"
shift 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="mv -f"
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"

CURDIR=`${PWD_CMD}`
: ${PKG_METADATA_DIR=${CURDIR}}
PKGBASE="py311-impacket"

LOCALBASE="/usr/pkg"
X11BASE="/usr/X11R7"
PREFIX="/usr/pkg"

PKG_SYSCONFBASE="/usr/pkg/etc"
PKG_SYSCONFBASEDIR="/usr/pkg/etc"
PKG_SYSCONFDIR="/usr/pkg/etc"
CONF_DEPENDS=""

CONF_IGNORE_FILES="*[~#] *.OLD *.orig *,v .pkgsrc */.pkgsrc"

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

# $NetBSD: install,v 1.5 2017/06/14 16:23:09 prlw1 Exp $

case ${STAGE} in
PRE-INSTALL)
	#
	# Unpack the helper scriptlets.
	#
	${SH} ${SELF} ${PKGNAME} UNPACK
	#
	# 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; }
	${TEST} ! -x ./+DIRS ||
		./+DIRS ADD ${PKG_METADATA_DIR}
	${TEST} ! -x ./+DIRS ||
		./+DIRS PERMS ${PKG_METADATA_DIR}
        ;;

POST-INSTALL)
	#
	# Rebuild the system run-time library search path database.
	#
	${TEST} ! -x ./+SHLIBS ||
		./+SHLIBS ADD ${PKG_METADATA_DIR}
	#
	# Copy configuration/support files into place.
	#
        ${TEST} ! -x ./+FILES ||
		./+FILES ADD ${PKG_METADATA_DIR}
        ${TEST} ! -x ./+FILES ||
		./+FILES PERMS ${PKG_METADATA_DIR}
	#
	# Set special permissions on any files/directories that need them.
	#
	${TEST} ! -x ./+PERMS ||
		./+PERMS ${PKG_METADATA_DIR}
	#
	# Update any fonts databases.
	#
	${TEST} ! -x ./+FONTS ||
		./+FONTS ${PKG_METADATA_DIR}

	#
	# Update any icon theme caches.
	#
	${TEST} ! -x ./+ICON_THEMES ||
		./+ICON_THEMES UPDATE ${PKG_METADATA_DIR}

	# Check for any missing bits after we're finished installing.
	#
	${TEST} ! -x ./+DIRS ||
		./+DIRS CHECK-ADD ${PKG_METADATA_DIR}
	${TEST} ! -x ./+DIRS ||
		./+DIRS CHECK-PERMS ${PKG_METADATA_DIR}
	${TEST} ! -x ./+FILES ||
		./+FILES CHECK-ADD ${PKG_METADATA_DIR}
	${TEST} ! -x ./+FILES ||
		./+FILES CHECK-PERMS ${PKG_METADATA_DIR}

	#
	# Register shells in /etc/shells.
	#
	${TEST} ! -x ./+SHELL ||
		./+SHELL ADD ${PKG_METADATA_DIR}
	${TEST} ! -x ./+SHELL ||
		./+SHELL CHECK-ADD ${PKG_METADATA_DIR}
	#
	# Register info files.
	#
	${TEST} ! -x ./+INFO_FILES ||
		./+INFO_FILES ADD ${PKG_METADATA_DIR}

  #
  # Register package into ocaml-findlib.
  #
  ${TEST} ! -x ./+OCAML_FINDLIB_REGISTER ||
    ./+OCAML_FINDLIB_REGISTER ADD ${PKG_METADATA_DIR}
	;;
esac

if test ${STAGE} = "POST-INSTALL"; then
/bin/cat >./+ALTERNATIVES <<EOF
bin/Get-GPPPassword.py /usr/pkg/bin/Get-GPPPassword-3.11.py
bin/GetADComputers.py /usr/pkg/bin/GetADComputers-3.11.py
bin/GetADUsers.py /usr/pkg/bin/GetADUsers-3.11.py
bin/GetLAPSPassword.py /usr/pkg/bin/GetLAPSPassword-3.11.py
bin/GetNPUsers.py /usr/pkg/bin/GetNPUsers-3.11.py
bin/GetUserSPNs.py /usr/pkg/bin/GetUserSPNs-3.11.py
bin/addcomputer.py /usr/pkg/bin/addcomputer-3.11.py
bin/atexec.py /usr/pkg/bin/atexec-3.11.py
bin/dacledit.py /usr/pkg/bin/dacledit-3.11.py
bin/dcomexec.py /usr/pkg/bin/dcomexec-3.11.py
bin/describeTicket.py /usr/pkg/bin/describeTicket-3.11.py
bin/dpapi.py /usr/pkg/bin/dpapi-3.11.py
bin/esentutl.py /usr/pkg/bin/esentutl-3.11.py
bin/exchanger.py /usr/pkg/bin/exchanger-3.11.py
bin/findDelegation.py /usr/pkg/bin/findDelegation-3.11.py
bin/getArch.py /usr/pkg/bin/getArch-3.11.py
bin/getPac.py /usr/pkg/bin/getPac-3.11.py
bin/getST.py /usr/pkg/bin/getST-3.11.py
bin/getTGT.py /usr/pkg/bin/getTGT-3.11.py
bin/goldenPac.py /usr/pkg/bin/goldenPac-3.11.py
bin/karmaSMB.py /usr/pkg/bin/karmaSMB-3.11.py
bin/kintercept.py /usr/pkg/bin/kintercept-3.11.py
bin/lookupsid.py /usr/pkg/bin/lookupsid-3.11.py
bin/mimikatz.py /usr/pkg/bin/mimikatz-3.11.py
bin/mqtt_check.py /usr/pkg/bin/mqtt_check-3.11.py
bin/mssqlclient.py /usr/pkg/bin/mssqlclient-3.11.py
bin/mssqlinstance.py /usr/pkg/bin/mssqlinstance-3.11.py
bin/netview.py /usr/pkg/bin/netview-3.11.py
bin/ntfs-read.py /usr/pkg/bin/ntfs-read-3.11.py
bin/ntlmrelayx.py /usr/pkg/bin/ntlmrelayx-3.11.py
bin/owneredit.py /usr/pkg/bin/owneredit-3.11.py
bin/ping.py /usr/pkg/bin/ping-3.11.py
bin/ping6.py /usr/pkg/bin/ping6-3.11.py
bin/psexec.py /usr/pkg/bin/psexec-3.11.py
bin/raiseChild.py /usr/pkg/bin/raiseChild-3.11.py
bin/rbcd.py /usr/pkg/bin/rbcd-3.11.py
bin/rdp_check.py /usr/pkg/bin/rdp_check-3.11.py
bin/reg.py /usr/pkg/bin/reg-3.11.py
bin/registry-read.py /usr/pkg/bin/registry-read-3.11.py
bin/rpcdump.py /usr/pkg/bin/rpcdump-3.11.py
bin/rpcmap.py /usr/pkg/bin/rpcmap-3.11.py
bin/sambaPipe.py /usr/pkg/bin/sambaPipe-3.11.py
bin/samrdump.py /usr/pkg/bin/samrdump-3.11.py
bin/secretsdump.py /usr/pkg/bin/secretsdump-3.11.py
bin/services.py /usr/pkg/bin/services-3.11.py
bin/smbclient.py /usr/pkg/bin/smbclient-3.11.py
bin/smbexec.py /usr/pkg/bin/smbexec-3.11.py
bin/smbserver.py /usr/pkg/bin/smbserver-3.11.py
bin/sniff.py /usr/pkg/bin/sniff-3.11.py
bin/sniffer.py /usr/pkg/bin/sniffer-3.11.py
bin/split.py /usr/pkg/bin/split-3.11.py
bin/ticketConverter.py /usr/pkg/bin/ticketConverter-3.11.py
bin/ticketer.py /usr/pkg/bin/ticketer-3.11.py
bin/wmiexec.py /usr/pkg/bin/wmiexec-3.11.py
bin/wmipersist.py /usr/pkg/bin/wmipersist-3.11.py
bin/wmiquery.py /usr/pkg/bin/wmiquery-3.11.py
EOF
if test -x /usr/pkg/sbin/pkg_alternatives; then
/usr/pkg/sbin/pkg_alternatives -gs register ./+ALTERNATIVES
fi
fi
# $NetBSD: footer,v 1.1 2006/05/21 23:50:15 jlam Exp $

exit 0

