2 # Copyright @ 2012 Felix Paul Kühne <fkuehne at videolan dot org>
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU Lesser General Public License as published by
6 # the Free Software Foundation; either version 2.1 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20 local green="\033[1;32m"
21 local normal="\033[0m"
22 echo "[${green}codesign${normal}] $1"
30 Sign Delete_Preferences.app in the current checkout
35 -g Enable additional magic
40 while getopts "hi:g" OPTION
55 shift $(($OPTIND - 1))
57 if [ "x$1" != "x" ]; then
64 info "Signing the executable"
65 codesign --force --sign "$IDENTITY" $OPTIONS extras/package/macosx/Delete_Preferences.app/Contents/MacOS/applet
67 info "Signing Resources"
68 find extras/package/macosx/Delete_Preferences.app/Contents/Resources/* -type f -exec codesign --force -s "$IDENTITY" $OPTIONS '{}' \;
70 REQUIREMENT="=designated => anchor apple generic and identifier \"org.videolan.vlc\" and ((cert leaf[field.1.2.840.113635.100.6.1.9] exists) or ( certificate 1[field.1.2.840.113635.100.6.2.6] exists and certificate leaf[field.1.2.840.113635.100.6.1.13] exists and certificate leaf[subject.OU] = \"75GAHG3SZQ\" ))"
72 info "Signing the executable"
73 codesign --force --sign "$IDENTITY" $OPTIONS --requirements "$REQUIREMENT" extras/package/macosx/Delete_Preferences.app/Contents/MacOS/applet
75 info "Signing Resources"
76 find extras/package/macosx/Delete_Preferences.app/Contents/Resources/* -type f -exec codesign --force -s "$IDENTITY" $OPTIONS --requirements "$REQUIREMENT" '{}' \;
79 info "all items signed, validating..."
81 info "Validating binary"
82 codesign --verify extras/package/macosx/Delete_Preferences.app/Contents/MacOS/applet
84 info "Validating Resources"
85 find extras/package/macosx/Delete_Preferences.app/Contents/Resources/* -type f -exec codesign --verify '{}' \;
87 info "Validation complete"