feat: pkg installer with postinstall and build script

This commit is contained in:
Oliver Hofmann 2026-06-02 21:06:51 +02:00
parent 183a265d77
commit 49ab635018
2 changed files with 47 additions and 0 deletions

41
installer/build.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
set -e
VERSION="1.0.0"
IDENTIFIER="de.kydriv.driver"
PKG_NAME="kydriv-driver-${VERSION}.pkg"
# Build installer/root from source files
mkdir -p installer/root/Library/Printers/PPDs/Contents/Resources
mkdir -p installer/root/usr/libexec/cups/filter
cp ppd/TA3505ci_AS.ppd \
installer/root/Library/Printers/PPDs/Contents/Resources/
cp filter/kyofilter \
installer/root/usr/libexec/cups/filter/
chmod 755 installer/root/usr/libexec/cups/filter/kyofilter
# Build (unsigned if SIGN_IDENTITY not set)
SIGN_ARGS=()
if [ -n "${SIGN_IDENTITY}" ]; then
SIGN_ARGS=(--sign "${SIGN_IDENTITY}")
fi
pkgbuild \
--root installer/root \
--scripts installer/scripts \
--identifier "${IDENTIFIER}" \
--version "${VERSION}" \
"${SIGN_ARGS[@]}" \
"${PKG_NAME}"
echo ""
echo "Built: ${PKG_NAME}"
if [ -z "${SIGN_IDENTITY}" ]; then
echo ""
echo "To sign: SIGN_IDENTITY='Developer ID Installer: NAME (TEAMID)' bash installer/build.sh"
echo ""
echo "To notarize after signing:"
echo " xcrun notarytool submit ${PKG_NAME} --apple-id YOUR@EMAIL --team-id TEAMID --password APP-PW --wait"
echo " xcrun stapler staple ${PKG_NAME}"
fi

6
installer/scripts/postinstall Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
set -e
chmod 755 /usr/libexec/cups/filter/kyofilter
chown root:wheel /usr/libexec/cups/filter/kyofilter
launchctl kickstart -k system/org.cups.cupsd
exit 0