Skip to content

Draft: macOS Build system updates #2274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 107 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
df45bf7
OSX: do not change into subdir as under pkgbuild this is a flat hiera…
tallpsmith Jan 7, 2025
72b68ac
Migrate to use pkgbuild syntax and expected output (file, not directory)
tallpsmith Jan 8, 2025
a7dfe5d
hdiutil internet-enabled has been removed a while back
tallpsmith Jan 8, 2025
558f268
migrate to pkgbuild from Package Maker and (for now) set the install-…
tallpsmith Jan 8, 2025
c1a6323
minor hack to remove a file that (i think) is Linux specific and won'…
tallpsmith Jan 8, 2025
936d322
missed it by _that_ much - didn't pickup the directory doesn't have t…
tallpsmith Jan 8, 2025
15d112f
Use debug for postinstall install-pcp for debugging
tallpsmith Jan 8, 2025
374cbef
Ensure PMNS directories are created for Darwin
tallpsmith Jan 10, 2025
78e1786
Use a CP instead of a MV because at least one file is a symlink and t…
tallpsmith Jan 10, 2025
d52bc29
Enable local file gather logs for easier debugging
tallpsmith Jan 10, 2025
14be6ff
correct env var syntax silly mistake.
tallpsmith Jan 10, 2025
0fc0c03
Remove QA/testsuite files from the resulting pkg, they're not useful …
tallpsmith Jan 10, 2025
958f077
Remap PCP library references of the binaries so they can find them in…
tallpsmith Jan 11, 2025
57fd808
Also remap /usr/local/bin files (that are linked to libpcp)
tallpsmith Jan 11, 2025
8dba554
Ensure the Summary PMDA makefile creates the parent directory (/etc/p…
tallpsmith Jan 11, 2025
9a803d5
Ensure the Summary PMDA makefile creates the parent directory (/etc/p…
tallpsmith Jan 11, 2025
db745b9
In cases of a clean install, the destination file didn't exist, so th…
tallpsmith Jan 11, 2025
bcd2935
stupid typo...
tallpsmith Jan 11, 2025
cf4adf0
On macOS, both var & etc directories are symlinked off root to be dee…
tallpsmith Jan 11, 2025
cf0e7d7
postflight is not supported under pkgbuild/productbuild
tallpsmith Jan 12, 2025
2ee2376
postflight is not supported under pkgbuild/productbuild
tallpsmith Jan 12, 2025
86b3d6d
remove debug logging during installation.
tallpsmith Jan 12, 2025
5c1ea62
Remove the legacy StartupItems bits no longer used by macOS and repla…
tallpsmith Jan 12, 2025
4a5189f
Remove the legacy StartupItems bits no longer used by macOS and repla…
tallpsmith Jan 12, 2025
a7f508c
Add version number to the pkgbuild (and in the correct location this …
tallpsmith Jan 12, 2025
6569bd6
Run as root, do not 'keepalive' because this is the start script whic…
tallpsmith Jan 12, 2025
1206c8c
Change the launchctl daemon entry point to /etc/init.d/pmcd (because …
tallpsmith Jan 12, 2025
5827ccc
Document QT dependency stuff needed to get pmdumptext to work
tallpsmith Jan 13, 2025
643c646
Add the python site-packages into the directories to scan for libpcp …
tallpsmith Jan 13, 2025
01ca3f5
When macOS detected and Xcode looks install, automatically set the re…
tallpsmith Jan 20, 2025
0e42311
OldSKOOL logging to try to bisect where this memory problem is.
tallpsmith Jan 20, 2025
964a061
OldSKOOL logging to try to bisect where this memory problem is.
tallpsmith Jan 20, 2025
5bc24de
OldSKOOL logging to try to bisect where this memory problem is.
tallpsmith Jan 20, 2025
2fb2a61
Add initial macOS CI Github workflow based on my workings locally.
tallpsmith Aug 9, 2025
b43a99d
Show what XCode is installed and automatically dump the PCP build log…
tallpsmith Aug 9, 2025
999830d
Use Github failure condition to dump the PCP build logs
tallpsmith Aug 9, 2025
e372be9
Grok picked up that it was the emdash copy/pasted from an Obsidian fi…
tallpsmith Aug 10, 2025
9fc3f73
Error during python running due to missing setuptools, attempted forc…
tallpsmith Aug 10, 2025
f74da0c
Python fiddling.
tallpsmith Aug 10, 2025
7831ba5
Remove building python stuff for now, based on Nathan's suggestion
tallpsmith Aug 10, 2025
bcc5b0e
Remove building python stuff for now, based on Nathan's suggestion
tallpsmith Aug 10, 2025
a28b74e
whoops, accidentally removed some other needed installations.
tallpsmith Aug 10, 2025
2d972ee
whoops, accidentally removed some other needed installations.
tallpsmith Aug 10, 2025
c2c4480
Python fiddling.
tallpsmith Aug 10, 2025
03eb039
Merge remote-tracking branch 'tallpsmith/osxbuild' into osxbuild
tallpsmith Aug 10, 2025
11aa5cd
remove pip update/install just in case that's not needed.
tallpsmith Aug 10, 2025
f074b0e
Bloomin' hate python
tallpsmith Aug 10, 2025
f860786
Remove extraneous python check step because it was done differently e…
tallpsmith Aug 10, 2025
46d1fd9
OSX: do not change into subdir as under pkgbuild this is a flat hiera…
tallpsmith Jan 7, 2025
69c3bd9
Migrate to use pkgbuild syntax and expected output (file, not directory)
tallpsmith Jan 8, 2025
1e7ba1e
hdiutil internet-enabled has been removed a while back
tallpsmith Jan 8, 2025
89d1764
migrate to pkgbuild from Package Maker and (for now) set the install-…
tallpsmith Jan 8, 2025
5649f54
minor hack to remove a file that (i think) is Linux specific and won'…
tallpsmith Jan 8, 2025
2bc6217
missed it by _that_ much - didn't pickup the directory doesn't have t…
tallpsmith Jan 8, 2025
8e78756
Use debug for postinstall install-pcp for debugging
tallpsmith Jan 8, 2025
1da51be
Ensure PMNS directories are created for Darwin
tallpsmith Jan 10, 2025
967f049
Use a CP instead of a MV because at least one file is a symlink and t…
tallpsmith Jan 10, 2025
34ea1b2
Enable local file gather logs for easier debugging
tallpsmith Jan 10, 2025
ab02d74
correct env var syntax silly mistake.
tallpsmith Jan 10, 2025
ee40002
Remove QA/testsuite files from the resulting pkg, they're not useful …
tallpsmith Jan 10, 2025
78b0939
Remap PCP library references of the binaries so they can find them in…
tallpsmith Jan 11, 2025
a0a924f
Also remap /usr/local/bin files (that are linked to libpcp)
tallpsmith Jan 11, 2025
8b17dc0
In cases of a clean install, the destination file didn't exist, so th…
tallpsmith Jan 11, 2025
feb8058
stupid typo...
tallpsmith Jan 11, 2025
4a87705
On macOS, both var & etc directories are symlinked off root to be dee…
tallpsmith Jan 11, 2025
461cefa
postflight is not supported under pkgbuild/productbuild
tallpsmith Jan 12, 2025
7bd46e5
postflight is not supported under pkgbuild/productbuild
tallpsmith Jan 12, 2025
c612e28
remove debug logging during installation.
tallpsmith Jan 12, 2025
8ece390
Remove the legacy StartupItems bits no longer used by macOS and repla…
tallpsmith Jan 12, 2025
b3f6a3d
Remove the legacy StartupItems bits no longer used by macOS and repla…
tallpsmith Jan 12, 2025
9311912
Add version number to the pkgbuild (and in the correct location this …
tallpsmith Jan 12, 2025
f500e87
Run as root, do not 'keepalive' because this is the start script whic…
tallpsmith Jan 12, 2025
e54131e
Change the launchctl daemon entry point to /etc/init.d/pmcd (because …
tallpsmith Jan 12, 2025
06f354e
Document QT dependency stuff needed to get pmdumptext to work
tallpsmith Jan 13, 2025
a424545
Add the python site-packages into the directories to scan for libpcp …
tallpsmith Jan 13, 2025
2dc858e
When macOS detected and Xcode looks install, automatically set the re…
tallpsmith Jan 20, 2025
0fca2ab
OldSKOOL logging to try to bisect where this memory problem is.
tallpsmith Jan 20, 2025
83b71f0
OldSKOOL logging to try to bisect where this memory problem is.
tallpsmith Jan 20, 2025
b88660b
OldSKOOL logging to try to bisect where this memory problem is.
tallpsmith Jan 20, 2025
a81a172
Add initial macOS CI Github workflow based on my workings locally.
tallpsmith Aug 9, 2025
b5b2e81
Show what XCode is installed and automatically dump the PCP build log…
tallpsmith Aug 9, 2025
2c45390
Use Github failure condition to dump the PCP build logs
tallpsmith Aug 9, 2025
b717afb
Grok picked up that it was the emdash copy/pasted from an Obsidian fi…
tallpsmith Aug 10, 2025
789a663
Error during python running due to missing setuptools, attempted forc…
tallpsmith Aug 10, 2025
ddd4f7c
Python fiddling.
tallpsmith Aug 10, 2025
b9cbb2d
Python fiddling.
tallpsmith Aug 10, 2025
4d01bcb
Remove building python stuff for now, based on Nathan's suggestion
tallpsmith Aug 10, 2025
039dd23
Remove building python stuff for now, based on Nathan's suggestion
tallpsmith Aug 10, 2025
cdeb5c5
whoops, accidentally removed some other needed installations.
tallpsmith Aug 10, 2025
7cf1116
whoops, accidentally removed some other needed installations.
tallpsmith Aug 10, 2025
51c483b
remove pip update/install just in case that's not needed.
tallpsmith Aug 10, 2025
77c8186
Bloomin' hate python
tallpsmith Aug 10, 2025
6984620
Remove extraneous python check step because it was done differently e…
tallpsmith Aug 10, 2025
b4b091f
Merge branch 'osxbuild' of github.com:tallpsmith/pcp into osxbuild
tallpsmith Aug 11, 2025
83fefd2
Merge branch 'performancecopilot:main' into osxbuild
tallpsmith Aug 12, 2025
7cddc4a
Trying out Nathan's symlink fix that's certainly looks better than my…
tallpsmith Aug 12, 2025
c520649
Revert "Trying out Nathan's symlink fix that's certainly looks better…
tallpsmith Aug 20, 2025
22fc92c
In improved way to find the python header files (but still relying on…
tallpsmith Aug 20, 2025
a0b530c
Do not require specific Python3 version and Rely on python3 resolving…
tallpsmith Aug 20, 2025
4c5ae4b
USe better method to locate the homebrew Python3 Site Packages needed…
tallpsmith Aug 20, 2025
41252a1
Remove hideous OLDSKOOL logging statements that appeared to make ever…
tallpsmith Aug 20, 2025
45bd695
Remove hideous OLDSKOOL logging statements that appeared to make ever…
tallpsmith Aug 20, 2025
03c4e7a
Use Nathan's method to re-link the libraries to where they'll live du…
tallpsmith Aug 20, 2025
8a3d8fa
Nathan's suggested correction of the LINKER_MAKERULE to deal with tho…
tallpsmith Aug 21, 2025
e3f798b
Make sure pmcd is started after postinstall
tallpsmith Aug 21, 2025
d388a16
Updates to INSTALL.md instructions and add qmake env for macOS so tha…
tallpsmith Aug 21, 2025
7751298
pmnsmerge etc don't seem to perform the centralised linking logic so …
tallpsmith Aug 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: macOS CI
on: [push]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Update Homebrew
run: brew update
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install and verify setuptools
id: install-setuptools
run: |
python3 --version
pip3 --version
pip3 install --upgrade pip setuptools wheel
python3 -c "import setuptools; print(setuptools.__version__)"
- name: Install Homebrew deps
id: install-deps
run: |
brew install gnu-tar pkg-config autoconf qt qt-creator
- name: Build on macOS
id: Build
run: |
xcodebuild -version
export PKGBUILD=`which pkgbuild`
export QMAKE=`which qmake`
./Makepkgs -verbose
- name: Debug on failure
if: failure() && steps.Build.conclusion == 'failure'
run: |
cat /Users/runner/work/pcp/pcp/Logs/pcp
- name: Debug on Python installation failure
if: failure() && steps.install-python.conclusion == 'failure'
run: |
echo "Python 3.13 installation failed. Collecting debug info..."
brew --version
brew config
brew doctor
ls -la /usr/local/bin | grep python
df -h
brew list
- name: Debug on dependency installation failure
if: failure() && steps.install-deps.conclusion == 'failure'
run: |
echo "Dependency installation failed. Collecting debug info..."
brew --version
brew config
brew doctor
ls -la /usr/local/bin | grep python
df -h
brew list
16 changes: 16 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ optional" or "QA optional".
The pcp package uses autoconf/configure and expects a GNU build
environment (your platform must at least have gmake).

```
# MacOS - use Homebrew and ensure the following packages are installed
brew install gnu-tar pkg-config python3 python-setuptools autoconf qt qt-creator
```

---

### 2. Building PCP binaries
If you just want to build a .rpm, .deb, .dmg, .msi[*] and/or
tar file, use the "Makepkgs" script in the top level directory.
This will configure and build the package for your platform and leave
Expand All @@ -241,6 +249,14 @@ $ dpkg -i *.deb
$ cd pcp-<version>/build/rpm
$ sudo rpm -U `ls -1 *.rpm | sed -e '/\.src\.rpm$/d'`
```
**MacOS DMG install**
```
$ cd pcp-<version>/build/mac
$ open *.dmg

<A Finder window should open showing the .pkg you can double click to run the installer>
```

**tarball install** (where we don't have native packaging working yet)
```
$ cd pcp-<version>/build/tar
Expand Down
10 changes: 8 additions & 2 deletions Makepkgs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ fi
configenv=''
if $dodeb
then
# On Debian-based platforms, the debian/rules file already captures
# On Debian-based platforms, the debian/rules file already captures
# most of the required configure settings in $(configure_paths) and
# $(configure_tools)
#
Expand Down Expand Up @@ -271,7 +271,13 @@ then
# On Mac OS X platforms, we install away from /usr/bin, /usr/lib
# and so on because of security requirements in recent versions.
#
configopts="--sysconfdir=/etc --localstatedir=/var --prefix=/usr/local"
configopts="--sysconfdir=/etc --localstatedir=/var --prefix=/usr/local"
if [ -x /usr/bin/pkgbuild ]; then
echo "MacOS build system detected. Using pkgbuild"
export PKGBUILD=/usr/bin/pkgbuild
export QMAKE=`which qmake`
fi

elif [ $target = netbsd ]
then
# Try to mimic where pkgsrc/pkgin places things
Expand Down
2 changes: 1 addition & 1 deletion build/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pack_pcp :
if test ! -z "$(TAR)"; then \
echo === tar === && $(MAKE) -j 1 -C tar $@ || exit $$?; \
fi; \
if test ! -z "$(PACKAGE_MAKER)"; then \
if test ! -z "$(PKGBUILD)"; then \
echo === mac === && $(MAKE) -j 1 -C mac $@ || exit $$?; \
fi; \
if test ! -z "$(MKINSTALLP)"; then \
Expand Down
27 changes: 13 additions & 14 deletions build/mac/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pack_pcp : extrabits
PACKAGE_MAJOR=${PACKAGE_MAJOR} \
PACKAGE_MINOR=${PACKAGE_MINOR} \
PACKAGE_BUILD=${PACKAGE_BUILD} \
./build-installer $(PACKAGE_MAKER) $(HDIUTIL) \
./build-installer $(PKGBUILD) $(HDIUTIL) \
$$DIST_ROOT ${PACKAGE_NAME} idb

idb: $(DIST_MANIFEST)
Expand All @@ -41,6 +41,9 @@ idb: $(DIST_MANIFEST)
# make source relative to DIST_ROOT
# ensure that a symlink has a full path for the source (no change needed
# if source is already a full path)
# Remove a linux-specific directory/file that isn't useful and isn't allowed in /usr/lib anyway (tmpfiles.d)
# Get rid of the QA & Testsuite stuff is as they're not useful resources for the Mac installation (it's not a source-bundle) and some files don't correctly come across anyway
# - this also speeds up the install and trims down the archive
# append the installer scripts
@echo Making idb...
@echo "# Version 1" > idb
Expand All @@ -66,27 +69,23 @@ idb: $(DIST_MANIFEST)
printf "%s %s %s %s %s %s replace\n", $$1, $$2, $$3, $$4, $$6, $$5 ; \
} \
' $$DIST_MANIFEST \
| sed -e 's# '$$WA'/# #g' -e 's# /# #g' >> idb
| sed -e 's# '$$WA'/# #g' -e 's# /# #g' | \
grep -v "usr/lib/tmpfiles.d" | \
$(PCP_AWK_PROG) ' \
$$6 !~ /^qa/ && $$5 !~ /testsuite/ {print} \
' >> idb
@(bdir=`echo $(PCP_BINADM_DIR) | cut -c2-`; \
echo "f 644 root wheel $$bdir/idb idb replace"; \
echo "f 755 root wheel $$bdir/install-pcp install-pcp replace"; \
echo "f 755 root wheel $$bdir/uninstall-pcp uninstall-pcp replace") >> idb
@echo "f 644 root wheel Library/StartupItems/pcp/StartupParameters.plist StartupParameters.plist replace" >> idb
@echo "d 755 root wheel Library/StartupItems/pcp/Resources . replace" >> idb
@echo "d 755 root wheel Library/StartupItems/pcp/Resources/English.lproj . replace" >> idb
@echo "f 644 root wheel Library/StartupItems/pcp/Resources/English.lproj/Localizable.strings English.lproj/Localizable.strings replace" >> idb
@echo "s 0 root wheel Library/StartupItems/pcp/pmcd etc/init.d/pmcd replace" >> idb
@echo "s 0 root wheel Library/StartupItems/pcp/pmie etc/init.d/pmie replace" >> idb
@echo "s 0 root wheel Library/StartupItems/pcp/pmproxy etc/init.d/pmproxy replace" >> idb
@echo "s 0 root wheel Library/StartupItems/pcp/pmlogger etc/init.d/pmlogger replace" >> idb
@echo "f 644 root wheel Library/LaunchDaemons/io.pcp.pmcd.plist io.pcp.pmcd.plist replace" >> idb
@echo idb created

extrabits: idb
DIST_MANIFEST= $(INSTALL) -m 755 idb install-pcp uninstall-pcp \
$(PCP_BINADM_DIR)
DIST_MANIFEST= $(INSTALL) -m 644 StartupParameters.plist \
Library/StartupItems/pcp/StartupParameters.plist
DIST_MANIFEST= $(INSTALL) -m 644 English.lproj/Localizable.strings \
Library/StartupItems/pcp/Resources/English.lproj/Localizable.strings
DIST_MANIFEST= $(INSTALL) -m 644 io.pcp.pmcd.plist \
Library/LaunchDaemons/io.pcp.pmcd.plist


include $(BUILDRULES)
25 changes: 0 additions & 25 deletions build/mac/StartupParameters.plist

This file was deleted.

25 changes: 12 additions & 13 deletions build/mac/build-installer
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [ ! -x "$1" -o ! -x "$2" -o ! -d "$3" -o -z "$4" -o ! -f "$5" ]; then
if [ ! -x "$1" ]; then
echo PackageMaker not executable
echo pkgbuild not executable
fi
if [ ! -x "$2" ]; then
echo hdiutil not executable
Expand All @@ -22,7 +22,7 @@ fi

IFDIR="installer-files"
IRDIR="installer-resources"
PKGMKR=$1
PKGBUILD=$1
HDIUTIL=$2
DIST_ROOT=$3
PACKAGE=$4-$PACKAGE_VERSION-$PACKAGE_BUILD
Expand Down Expand Up @@ -60,7 +60,7 @@ echo "Gathering files from the source tree using install-pcp"
_do rm -rf $IFDIR
_do mkdir $IFDIR
cd $IFDIR
_do ../install-pcp -R $DIST_ROOT -c $IDB
_do ../install-pcp -v -R $DIST_ROOT -c $IDB
cd $HERE

pwd
Expand All @@ -87,19 +87,19 @@ for f in installer-info installer-description; do
< $f > $nf || exit 1
done

echo "Launching PackageMaker..."
echo "Launching pkgbuild..."

_do rm -rf $PKG

# PackageMaker returns non-zero value even if it succeeds.
# PackageMaker must be run by the user logged into the localhost desktop.
#
_run $PKGMKR -build -p $HERE/$PKG \
-f $HERE/installer-files -r $HERE/installer-resources \
-i $HERE/info -d $HERE/description &
wait
# create custom 'flatenned' directory to use for pkgbuild
pkgroot=`mktemp -d /tmp/macos-pkg.XXXXXXXXX`
cp -RP installer-files/* $pkgroot/
cp -RP installer-resources/* $pkgroot/

if [ ! -d $HERE/$PKG ]
# pkgbuild must be run by the user logged into the localhost desktop.
_run $PKGBUILD --identifier io.pcp.performancecopilot --version $PACKAGE_VERSION --nopayload --scripts $pkgroot $HERE/$PKG

if [ ! -s $HERE/$PKG ]
then
echo "$prog: Package generation failed"
exit 1
Expand All @@ -114,7 +114,6 @@ _do mv $PKG $PACKAGE
_do $HDIUTIL makehybrid -quiet -o $PACKAGE.tmp $PACKAGE \
-hfs-openfolder dmg.tmp/$DMG -hfs
_do $HDIUTIL convert -quiet $TEMPDMG -format UDRO -o $DMG
_do $HDIUTIL internet-enable -quiet -yes $DMG

if [ ! -f $HERE/$DMG ]
then
Expand Down
4 changes: 2 additions & 2 deletions build/mac/install-pcp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ _install_file()
then
_warn "Unable to remove existing $target, continuing"
fi
if _cmd $MV $source $target
if _cmd $CP $source $target
then
installed=true
else
Expand Down Expand Up @@ -409,7 +409,7 @@ _install_file()
then
_error "$target exists but is a directory"
else
if _cmd $MV $source $target
if _cmd $CP $source $target
then
installed=true
else
Expand Down
19 changes: 0 additions & 19 deletions build/mac/installer-resources/postflight
Original file line number Diff line number Diff line change
@@ -1,19 +0,0 @@
#!/bin/sh
#
# Copyright (c) 2003-2004 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#

/Library/StartupItems/pcp/pmcd start
/Library/StartupItems/pcp/pmlogger start

exit 0
7 changes: 5 additions & 2 deletions build/mac/installer-resources/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ then
exit
fi

cd $2

if ./install-pcp -i -l /var/log/pcp_inst.log idb
then
:
Expand Down Expand Up @@ -102,4 +100,9 @@ do
[ -d "$dir" ] && rm -rf "$dir"
done

# Ensure pmcd is loaded...
launchctl bootstrap system /Library/LaunchDaemons/io.pcp.pmcd.plist
# ...and then started by launchctl - it would get picked up by a reboot, but this leaves pmcd running after install
launchctl kickstart -p -k system/io.pcp.pmcd

status=0
29 changes: 29 additions & 0 deletions build/mac/io.pcp.pmcd.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>io.pcp.pmcd</string>
<key>ProgramArguments</key>
<array>
<string>/etc/init.d/pmcd</string>
<string>start</string>
</array>
<key>Disabled</key>
<false/>
<key>UserName</key>
<string>root</string>
<key>UserGroup</key>
<string>wheel</string>
<key>KeepAlive</key>
<false/>
<key>ThrottleInterval</key>
<integer>30</integer>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/pmcd.job.err</string>
<key>StandardOutPath</key>
<string>/tmp/pmcd.job.out</string>
</dict>
</plist>
Loading