summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGeoffroy Carrier <geoffroy.carrier@koon.fr>2008-06-02 10:27:00 +0200
committerDan McGee <dan@archlinux.org>2011-03-23 05:52:00 +0100
commitee34869e8934fe55562a84c4eac055256b7c42f0 (patch)
tree9bb0d3cd49926298cb4d58fb8aea98ddcae53dce /scripts
parent0ff52b68452046d61c24649ec94886bd74faab45 (diff)
downloadpacman-ee34869e8934fe55562a84c4eac055256b7c42f0.tar.gz
pacman-ee34869e8934fe55562a84c4eac055256b7c42f0.tar.xz
Add GPG signature support to makepkg
This is a rather simple patch to add signing support to makepkg. Add a create_signature() to makepkg, add a 'sign' BUILDENV option in makepkg.conf, and document the changes in the makepkg.conf manpage. Signed-off-by: Geoffroy Carrier <geoffroy.carrier@koon.fr> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index bb7616cf..f28097f6 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1099,6 +1099,25 @@ create_package() {
fi
}
+create_signature() {
+ if [[ $(check_buildenv sign) != "y" ]]; then
+ return
+ fi
+ local ret=0
+ local filename="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
+ msg "$(gettext "Signing package...")"
+ if [ ! $(type -p "gpg") ]; then
+ error "$(gettext "Cannot find the gpg binary! Is gnupg installed?")"
+ exit 1 # $E_MISSING_PROGRAM
+ fi
+ gpg --detach-sign --use-agent $filename || ret=$?
+ if (( ! ret )); then
+ msg2 "$(gettext "Created signature file %s.")" $filename.sig
+ else
+ warning "$(gettext "Failed to sign package file.")"
+ fi
+}
+
create_srcpackage() {
cd "$startdir"
@@ -2115,6 +2134,8 @@ fi
fullver=$(get_full_version $epoch $pkgver $pkgrel)
msg "$(gettext "Finished making: %s")" "$pkgbase $fullver ($(date))"
+create_signature
+
install_package
exit 0 #E_OK