-
Notifications
You must be signed in to change notification settings - Fork 2
/
libmacgpg-free.pkg.recipe
146 lines (144 loc) · 4 KB
/
libmacgpg-free.pkg.recipe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?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>Description</key>
<string>Downloads the latest version of Libmacgpg-free and packages it for installation.</string>
<key>Identifier</key>
<string>com.github.jelockwood.recipes.pkg.libmacgpg-free</string>
<key>Input</key>
<dict>
<key>DISABLE_CODE_SIGNATURE_VERIFICATION</key>
<true/>
<key>NAME</key>
<string>libmacgpg-free</string>
<key>VENDOR</key>
<string>macgpg</string>
<key>SOFTWARETITLE</key>
<string>libmacgpg-free installer</string>
<key>NAMEWITHOUTSPACES</key>
<string>libmacgpginstaller</string>
</dict>
<key>MinimumVersion</key>
<string>1.0.0</string>
<key>ParentRecipe</key>
<string>com.github.jelockwood.recipes.download.libmacgpg-free</string>
<key>Process</key>
<array>
<dict>
<key>Processor</key>
<string>PkgRootCreator</string>
<key>Arguments</key>
<dict>
<key>pkgroot</key>
<string>%RECIPE_CACHE_DIR%/Scripts</string>
<key>pkgdirs</key>
<dict/>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>PkgRootCreator</string>
<key>Arguments</key>
<dict>
<key>pkgroot</key>
<string>%RECIPE_CACHE_DIR%/pkgroot</string>
<key>pkgdirs</key>
<dict/>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>GitHubReleasesInfoProvider</string>
<key>Arguments</key>
<dict>
<key>github_repo</key>
<string>macgpg/libmacgpg-free</string>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>Copier</string>
<key>Arguments</key>
<dict>
<key>source_path</key>
<string>%RECIPE_CACHE_DIR%/Downloads/org.gpgtools.Libmacgpg</string>
<key>destination_path</key>
<string>%RECIPE_CACHE_DIR%/Scripts/org.gpgtools.Libmacgpg</string>
<key>overwrite</key>
<true/>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>FileCreator</string>
<key>Arguments</key>
<dict>
<key>file_content</key>
<string>#!/bin/bash
# Determine working directory
install_dir=`dirname $0`
# Install Libmacgpg-free unattended-ly using the pkg from the resources directory
if [ -d "/Library/Application Support/GPGTools/org.gpgtools.Libmacgpg.xpc/Contents/MacOS" ]
then
/usr/bin/logger -is "GPGTools directory exists"
/bin/cp "$install_dir/org.gpgtools.Libmacgpg" "/Library/Application Support/GPGTools/org.gpgtools.Libmacgpg.xpc/Contents/MacOS/" 2> >(/usr/bin/logger -is)
/bin/chmod 755 "/Library/Application Support/GPGTools/org.gpgtools.Libmacgpg.xpc/Contents/MacOS/org.gpgtools.Libmacgpg" 2> >(/usr/bin/logger -is)
/bin/launchctl stop org.gpgtools.Libmacgpg.xpc 2> >(/usr/bin/logger -is)
processid=`/bin/ps -ef | awk '$NF~"org.gpgtools.Libmacgpg" {print $2}'`
if [ ! -z "$processid" ]
then
/usr/bin/logger -is "\$processid is NOT empty"
/usr/bin/killall org.gpgtools.Libmacgpg 2> >(/usr/bin/logger -is)
fi
/bin/launchctl start org.gpgtools.Libmacgpg.xpc 2> >(/usr/bin/logger -is)
else
/usr/bin/logger -is "GPGTools directory not exist"
exit 1
fi
exit 0
</string>
<key>file_mode</key>
<string>0755</string>
<key>file_path</key>
<string>%RECIPE_CACHE_DIR%/Scripts/postinstall</string>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>PkgCreator</string>
<key>Arguments</key>
<dict>
<key>pkg_request</key>
<dict>
<key>chown</key>
<array/>
<key>id</key>
<string>com.jelockwood.libmacgpg-free.pkg</string>
<key>pkgname</key>
<string>%NAME%-%version%</string>
<key>pkgroot</key>
<string>%RECIPE_CACHE_DIR%/pkgroot</string>
<key>pkgtype</key>
<string>flat</string>
<key>scripts</key>
<string>Scripts</string>
<key>version</key>
<string>%version%</string>
</dict>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>PathDeleter</string>
<key>Arguments</key>
<dict>
<key>path_list</key>
<array>
<string>%RECIPE_CACHE_DIR%/Scripts</string>
</array>
</dict>
</dict>
</array>
</dict>
</plist>