summaryrefslogtreecommitdiff
path: root/recipes/gtk-doc-lite.recipe
blob: dbe9885b4740135c96a85e82a2941e78d7c10591 (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
36
37
38
39
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python

class Recipe(recipe.Recipe):
    name = 'gtk-doc-lite'
    version = '1.19'
    stype = SourceType.TARBALL
    tarball_dirname = 'gtk-doc-%(version)s'
    url = 'http://ftp.acc.umu.se/pub/GNOME/sources/gtk-doc/1.19/gtk-doc-1.19.tar.xz'
    # TODO: check license - source files are GPLv2+ and COPYING is GPLv3
    licenses = [License.GPLv2Plus]
    btype = BuildType.CUSTOM

    files_devel = ['bin/gtkdocize', 'share/aclocal/gtk-doc.m4',
                   'share/gtk-doc/data/gtk-doc.make',
                   'share/gtk-doc/data/gtk-doc.notmpl.make']

    def install(self):
        from cerbero.utils import shell
        import shutil
        aclocal_dir = os.path.join(self.config.prefix, 'share', 'aclocal')
        if not os.path.exists(aclocal_dir):
            os.makedirs(aclocal_dir)
        data_dir = os.path.join(self.config.prefix, 'share', 'gtk-doc', 'data')
        if not os.path.exists(data_dir):
            os.makedirs(data_dir)
        shutil.copy(os.path.join(self.build_dir, 'gtk-doc.m4'),
                    os.path.join(aclocal_dir, 'gtk-doc.m4'))
        shutil.copy(os.path.join(self.build_dir, 'gtk-doc.make'),
                    os.path.join(data_dir,  'gtk-doc.make'))
        shutil.copy(os.path.join(self.build_dir, 'gtk-doc.notmpl.make'),
                    os.path.join(data_dir,  'gtk-doc.notmpl.make'))
        gtkdocize = os.path.join(self.config.prefix, 'bin', 'gtkdocize')
        shutil.copy(os.path.join(self.build_dir, 'gtkdocize.in'), gtkdocize)
        replacements = {'@PACKAGE@': 'gtk-doc', '@VERSION@': self.version,
                        '@prefix@': self.config.prefix,
                        '@datarootdir@': '${prefix}/share',
                        '@datadir@': '${datarootdir}'}
        shell.replace(gtkdocize, replacements)
        shell.call('chmod +x gtkdocize', os.path.join(self.config.prefix, 'bin'))