aboutsummaryrefslogtreecommitdiff
path: root/sysutils/pcbsd-utils/pkg-install
diff options
context:
space:
mode:
authorKris Moore <kmoore@FreeBSD.org>2013-09-27 10:09:15 +0000
committerKris Moore <kmoore@FreeBSD.org>2013-09-27 10:09:15 +0000
commit6dc32dd537a63ff72ac65e54864ac44a60048092 (patch)
tree2f8284fbe4856132266870cd7bc31e7917509d30 /sysutils/pcbsd-utils/pkg-install
parentd94ea62681c09b55d2c38e839eba084755697781 (diff)
Notes
Diffstat (limited to 'sysutils/pcbsd-utils/pkg-install')
-rw-r--r--sysutils/pcbsd-utils/pkg-install30
1 files changed, 30 insertions, 0 deletions
diff --git a/sysutils/pcbsd-utils/pkg-install b/sysutils/pcbsd-utils/pkg-install
new file mode 100644
index 000000000000..f852ec54af4c
--- /dev/null
+++ b/sysutils/pcbsd-utils/pkg-install
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Script to install PBI repo on pkg add
+
+PREFIX=${PKG_PREFIX-/usr/local}
+
+if [ "$2" != "POST-INSTALL" ] ; then
+ exit 0
+fi
+
+# If this is during staging, we can skip for now
+echo $PREFIX | grep -q '/stage/'
+if [ $? -eq 0 ] ; then
+ exit 0
+fi
+
+# If this is a new install, add the PC-BSD master repo
+ls /var/db/pbi/keys/* 2>/dev/null >/dev/null
+if [ $? -ne 0 ] ; then
+ ${PREFIX}/sbin/pbi_addrepo ${PREFIX}/share/pbi-manager/pcbsd.rpo
+fi
+
+# Copy over the wrapper files
+if [ `uname -m` = "amd64" ] ; then
+ cp ${PREFIX}/share/pbi-manager/.pbiwrapper-i386 /usr/pbi/.pbiwrapper-i386
+ cp ${PREFIX}/share/pbi-manager/.pbiwrapper-amd64 /usr/pbi/.pbiwrapper-amd64
+else
+ cp ${PREFIX}/share/pbi-manager/.pbiwrapper-i386 /usr/pbi/.pbiwrapper-i386
+fi
+
+exit 0