summaryrefslogtreecommitdiff
path: root/recipes/ca-certificates.recipe
blob: 650293afcd25ca99d60a88e53982b28b409f1dbb (plain)
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
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
import os
import shutil
from cerbero.utils import shell

# Created with tools/certdata2pem on the Mozilla CA list
# https://dxr.mozilla.org/mozilla-central/source/security/nss/lib/ckfw/builtins/certdata.txt

class Recipe(recipe.Recipe):
    name = 'ca-certificates'
    version = '2016-09-22'
    licenses = [License.MPLv2]
    stype = SourceType.CUSTOM
    btype = BuildType.CUSTOM

    can_msvc = True

    files_etc = [
            'etc/ssl/certs/ca-certificates.crt',
            ]

    async def install(self):
        dst_dir = os.path.join(self.config.prefix, 'etc', 'ssl', 'certs')
        if not os.path.exists(dst_dir):
            os.makedirs(dst_dir)
        src_dir = os.path.join(self.recipe_dir(), self.name)
        for f in self.files_etc:
            fname = os.path.basename(f)
            s = os.path.join(src_dir, fname)
            d = os.path.join(dst_dir, fname)
            if os.path.isfile(s):
                shutil.copy(s, d)
            else:
                shell.copy_dir(s, d)