[pkg-opensc-commit] [opensc] 177/295: macOS: Use a better Uninstaller
Eric Dorland
eric at moszumanska.debian.org
Sat Jun 24 21:11:29 UTC 2017
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository opensc.
commit 25f785e482abd0b1e53eb9cf1191d7c04bf0c743
Author: Frank Morgner <frankmorgner at gmail.com>
Date: Tue Feb 7 23:12:18 2017 +0100
macOS: Use a better Uninstaller
An apple script converted to an App calls the local
/usr/local/bin/opensc-uninstall
---
MacOSX/Makefile.am | 3 +--
MacOSX/OpenSC_Uninstaller.applescript | 8 ++++++++
MacOSX/build-package.in | 7 +++----
MacOSX/uninstaller-scripts/postinstall | 2 --
4 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/MacOSX/Makefile.am b/MacOSX/Makefile.am
index 4af8d83..c7898ef 100644
--- a/MacOSX/Makefile.am
+++ b/MacOSX/Makefile.am
@@ -7,5 +7,4 @@ EXTRA_DIST = build build-package.in Distribution.xml.in libtool-bundle opensc-un
resources/Welcome.html.in \
scripts \
scripts/postinstall \
- uninstaller-scripts \
- uninstaller-scripts/postinstall
+ OpenSC_Uninstaller.applescript
diff --git a/MacOSX/OpenSC_Uninstaller.applescript b/MacOSX/OpenSC_Uninstaller.applescript
new file mode 100644
index 0000000..e366010
--- /dev/null
+++ b/MacOSX/OpenSC_Uninstaller.applescript
@@ -0,0 +1,8 @@
+tell application "System Events"
+ if exists file "/usr/local/bin/opensc-uninstall" then
+ set result to do shell script "/usr/local/bin/opensc-uninstall" with administrator privileges
+ display alert "Removal complete" message result giving up after 10
+ else
+ display alert "OpenSC is not installed" message "Could not find /usr/local/bin/opensc-uninstall" as critical giving up after 10
+ end if
+end tell
\ No newline at end of file
diff --git a/MacOSX/build-package.in b/MacOSX/build-package.in
index 1b60542..24d71f6 100755
--- a/MacOSX/build-package.in
+++ b/MacOSX/build-package.in
@@ -87,16 +87,15 @@ cp MacOSX/opensc-uninstall target/usr/local/bin
# Build package
pkgbuild --root target --scripts MacOSX/scripts --identifier org.opensc-project.mac --version @PACKAGE_VERSION@ --install-location / OpenSC.pkg
# Build product
-productbuild --distribution MacOSX/Distribution.xml --package-path . --resources MacOSX/resources OpenSC- at PACKAGE_VERSION@.pkg
+productbuild --distribution MacOSX/Distribution.xml --package-path . --resources MacOSX/resources "OpenSC @PACKAGE_VERSION at .pkg"
# Build "uninstaller"
-pkgbuild --nopayload --identifier org.opensc-project.mac.uninstall --scripts MacOSX/uninstaller-scripts Uninstall_OpenSC.pkg
+osacompile -o "OpenSC Uninstaller.app" "MacOSX/OpenSC_Uninstaller.applescript"
# Create .dmg
rm -f OpenSC- at PACKAGE_VERSION@.dmg
-TIMESTAMP=$(date +%Y.%m.%d)
i=0
-while ! hdiutil create -srcfolder Uninstall_OpenSC.pkg -srcfolder OpenSC- at PACKAGE_VERSION@.pkg -volname "OpenSC @PACKAGE_VERSION@ for Mac OS X 10.10+ (${TIMESTAMP})" OpenSC- at PACKAGE_VERSION@.dmg
+while ! hdiutil create -srcfolder "OpenSC @PACKAGE_VERSION at .pkg" -srcfolder "OpenSC Uninstaller.app" -volname "@PACKAGE_NAME@" OpenSC- at PACKAGE_VERSION@.dmg
do
i=$[$i+1]
if [ $i -gt 2 ]
diff --git a/MacOSX/uninstaller-scripts/postinstall b/MacOSX/uninstaller-scripts/postinstall
deleted file mode 100755
index 63ea517..0000000
--- a/MacOSX/uninstaller-scripts/postinstall
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec /usr/local/bin/opensc-uninstall
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/opensc.git
More information about the pkg-opensc-commit
mailing list