source: src-sh/port-files/pkg-install @ a7429d5

releng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since a7429d5 was a7429d5, checked in by Kris Moore <kris@…>, 9 months ago

Add a cool new system callback function to PBIs on 10.x and beyond

This allows PBIs, which run in a container, to use the pbisyscmd, openwith
or xdg-open, and "talk" to applications on the outside of the container.

The use-case for this would be a application like Thunderbird, which may
want to use the "xdg-open" command to open a PDF file with something else
on the system.

It could be used by other apps, such as terminal emulators to run a shell on the system,
even though the GUI is run in the container

  • Property mode set to 100644
File size: 1.4 KB
Line 
1#!/bin/sh
2# Script to install PBI repo on pkg add
3
4PREFIX=${PKG_PREFIX-/usr/local}
5
6if [ "$2" != "POST-INSTALL" ] ; then
7   exit 0
8fi
9
10# If this is during staging, we can skip for now
11echo $PREFIX | grep -q '/stage/'
12if [ $? -eq 0 ] ; then
13   exit 0
14fi
15
16# If this is a new install, add the PC-BSD master repo
17ls /var/db/pbi/keys/* 2>/dev/null >/dev/null
18if [ $? -ne 0 ] ; then
19        ${PREFIX}/sbin/pbi_addrepo ${PREFIX}/share/pbi-manager/pcbsd.rpo
20fi
21
22# Copy over the wrapper files
23if [ `uname -m` = "amd64" ] ; then
24  cp ${PREFIX}/share/pbi-manager/.pbiwrapper-i386 /usr/pbi/.pbiwrapper-i386
25  cp ${PREFIX}/share/pbi-manager/.pbiwrapper-amd64 /usr/pbi/.pbiwrapper-amd64
26else
27  cp ${PREFIX}/share/pbi-manager/.pbiwrapper-i386 /usr/pbi/.pbiwrapper-i386
28fi
29
30# If on FreeBSD > 10, install the PBI mounting files
31if [ -e "${PREFIX}/share/pbi-manager/.pbime" ] ; then
32   install -o root -g wheel -m 4751 ${PREFIX}/share/pbi-manager/.pbime /usr/pbi/.pbime
33   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbimount /usr/pbi/.pbimount
34   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.ldconfig /usr/pbi/.ldconfig
35   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbisyscmd /usr/pbi/.pbisyscmd
36   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbisyslisten /usr/pbi/.pbisyslisten
37   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.mount_nullfs /usr/pbi/.mount_nullfs
38fi
39
40exit 0
Note: See TracBrowser for help on using the repository browser.