From d36d1a00a1bc6a8214ad3cbdb8eb9783a5b7e07c Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 11 Aug 2017 23:38:27 +0100 Subject: [PATCH] Add GPGTools nightly (#4271) * Add GPGTools nightly * gpgtools-beta conflicts with gpgtools-nightly * Update gpgtools-beta.rb * Update gpgtools-nightly.rb --- Casks/gpgtools-beta.rb | 2 +- Casks/gpgtools-nightly.rb | 75 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 Casks/gpgtools-nightly.rb diff --git a/Casks/gpgtools-beta.rb b/Casks/gpgtools-beta.rb index 721c27c88..c82b7d753 100644 --- a/Casks/gpgtools-beta.rb +++ b/Casks/gpgtools-beta.rb @@ -9,7 +9,7 @@ cask 'gpgtools-beta' do key_url: 'https://gpgtools.org/GPGTools-00D026C4.asc' auto_updates true - conflicts_with cask: 'gpgtools' + conflicts_with cask: ['gpgtools', 'gpgtools-nightly'] pkg 'Install.pkg' diff --git a/Casks/gpgtools-nightly.rb b/Casks/gpgtools-nightly.rb new file mode 100644 index 000000000..11610427a --- /dev/null +++ b/Casks/gpgtools-nightly.rb @@ -0,0 +1,75 @@ +cask 'gpgtools-nightly' do + version :latest + sha256 :no_check + + url do + require 'open-uri' + html = open('https://releases.gpgtools.org/nightlies/').read + html.match(%r{})[1] + end + name 'GPG Suite Nightly' + homepage 'https://gpgtools.org/' + gpg "#{url}.sig", + key_url: 'https://gpgtools.org/GPGTools-00D026C4.asc' + + auto_updates true + conflicts_with cask: ['gpgtools', 'gpgtools-beta'] + + pkg 'Install.pkg' + + uninstall_postflight do + ['gpg', 'gpg2', 'gpg-agent'].map { |exec_name| "/usr/local/bin/#{exec_name}" }.each do |exec| + File.rm(exec) if File.exist?(exec) && File.readlink(exec).include?('MacGPG2') + end + end + + uninstall script: { + executable: "#{staged_path}/Uninstall.app/Contents/Resources/GPG Suite Uninstaller.app/Contents/Resources/uninstall.sh", + sudo: true, + }, + pkgutil: 'org.gpgtools.*', + quit: [ + 'com.apple.mail', + 'org.gpgtools.gpgkeychainaccess', + 'org.gpgtools.gpgkeychain', + 'org.gpgtools.gpgservices', + # TODO: add "killall -kill gpg-agent" + ], + launchctl: [ + 'org.gpgtools.Libmacgpg.xpc', + 'org.gpgtools.gpgmail.patch-uuid-user', + 'org.gpgtools.macgpg2.fix', + 'org.gpgtools.macgpg2.shutdown-gpg-agent', + 'org.gpgtools.macgpg2.updater', + 'org.gpgtools.macgpg2.gpg-agent', + ], + delete: [ + '/Library/Services/GPGServices.service', + '/Library/Mail/Bundles/GPGMail.mailbundle', + '/Network/Library/Mail/Bundles/GPGMail.mailbundle', + '/usr/local/MacGPG2', + '/private/etc/paths.d/MacGPG2', + '/private/etc/manpaths.d/MacGPG2', + '/private/tmp/gpg-agent', + '/Library/PreferencePanes/GPGPreferences.prefPane', + '/Library/Application Support/GPGTools', + '/Library/Frameworks/Libmacgpg.framework', + ] + + zap delete: [ + '~/Library/Services/GPGServices.service', + '~/Library/Mail/Bundles/GPGMail.mailbundle', + '~/Library/PreferencePanes/GPGPreferences.prefPane', + '~/Library/LaunchAgents/org.gpgtools.*', + '~/Library/Preferences/org.gpgtools.*', + '~/Library/Containers/com.apple.mail/Data/Library/Preferences/org.gpgtools.*', + '~/Library/Application Support/GPGTools', + '~/Library/Frameworks/Libmacgpg.framework', + '~/Containers/com.apple.mail/Data/Library/Frameworks/Libmacgpg.framework', + '~/Library/Caches/org.gpgtools.gpg*', + ] + + caveats do + files_in_usr_local + end +end