summaryrefslogtreecommitdiff
path: root/recipes/ca-certificates.recipe
blob: 63bcbcae4498ff5d1bcba21d2d6ad0e1e602e547 (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
# -*- 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://mxr.mozilla.org/mozilla-central/source/security/nss/lib/ckfw/builtins/certdata.txt

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

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

    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.config.recipes_dir, 'ca-certificates')
        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)