blob: 4263810028654e6aab7358c8a6384adf0f417373 [file] [log] [blame]
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001# Class for signing package feeds
2#
3# Related configuration variables that will be used after this class is
4# iherited:
5# PACKAGE_FEED_PASSPHRASE_FILE
6# Path to a file containing the passphrase of the signing key.
7# PACKAGE_FEED_GPG_NAME
8# Name of the key to sign with. May be key id or key name.
9# GPG_BIN
10# Optional variable for specifying the gpg binary/wrapper to use for
11# signing.
12# GPG_PATH
13# Optional variable for specifying the gnupg "home" directory:
14#
15inherit sanity
16
17PACKAGE_FEED_SIGN = '1'
18
19python () {
20 # Check sanity of configuration
21 for var in ('PACKAGE_FEED_GPG_NAME', 'PACKAGE_FEED_GPG_PASSPHRASE_FILE'):
22 if not d.getVar(var, True):
23 raise_sanity_error("You need to define %s in the config" % var, d)
24
25 # Set expected location of the public key
26 d.setVar('PACKAGE_FEED_GPG_PUBKEY',
27 os.path.join(d.getVar('STAGING_ETCDIR_NATIVE'),
28 'PACKAGE-FEED-GPG-PUBKEY'))
29}
30
31do_package_index[depends] += "signing-keys:do_export_public_keys"