OpenPAM/mkpkgng.in

63 lines
1.4 KiB
Plaintext
Raw Normal View History

#!/bin/sh
#
# $Id$
#
srcdir="@abs_top_srcdir@"
builddir="@abs_top_builddir@"
pkgabi=$(pkg -vv | awk '$1 == "ABI:" { print $2 }')
error() {
echo "$@" 1>&2
exit 1
}
if which gmake >/dev/null ; then
make=gmake
else
make=make
fi
tmproot=$(mktemp -d)
[ -n "$tmproot" -a -d "$tmproot" ] || error "unable to create temporary directory"
trap "echo deleting temporary directory ; rm -rf '$tmproot'" EXIT
set -e
$make install DESTDIR="$tmproot"
manifest="$tmproot/+MANIFEST"
cat >"$manifest" <<EOF
name: @PACKAGE@
version: @PACKAGE_VERSION@
origin: local/openpam
comment: BSD-licensed PAM implementation
arch: $pkgabi
www: @PACKAGE_URL@
maintainer: @PACKAGE_BUGREPORT@
prefix: @prefix@
desc:
OpenPAM is an open source PAM library that focuses on simplicity,
correctness, and cleanliness.
OpenPAM aims to gather the best features of Solaris PAM, XSSO and
Linux-PAM, plus some innovations of its own. In areas where these
implementations disagree, OpenPAM tries to remain compatible with
Solaris, at the expense of XSSO conformance and Linux-PAM
compatibility.
categories: local, security
EOF
(
echo "files:"
find "$tmproot" -type f | while read file ; do
[ "$file" = "$manifest" ] && continue
mode=$(stat -f%p "$file" | cut -c 3-)
file="${file#$tmproot}"
echo " $file: { uname: root, gname: wheel, perm: $mode }"
done
)>>"$manifest"
pkg create -r "$tmproot" -m "$tmproot" -o "$builddir"