diff --git a/installer/build.sh b/installer/build.sh new file mode 100755 index 0000000..944fda2 --- /dev/null +++ b/installer/build.sh @@ -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 diff --git a/installer/scripts/postinstall b/installer/scripts/postinstall new file mode 100755 index 0000000..692565f --- /dev/null +++ b/installer/scripts/postinstall @@ -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