aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/curl/curl_7.37.1.bb
blob: dc1d6a618fd260809ab2a6aae848b75f0888c1df (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
SUMMARY = "Command line tool and library for client-side URL transfers"
HOMEPAGE = "http://curl.haxx.se/"
BUGTRACKER = "http://curl.haxx.se/mail/list.cgi?list=curl-tracker"
SECTION = "console/network"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;beginline=7;md5=3a34942f4ae3fbf1a303160714e664ac"

DEPENDS = "zlib gnutls"
DEPENDS_class-native = "zlib-native openssl-native"
DEPENDS_class-nativesdk = "nativesdk-zlib nativesdk-openssl"

SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \
           file://pkgconfig_fix.patch \
"

# curl likes to set -g0 in CFLAGS, so we stop it
# from mucking around with debug options
#
SRC_URI += " file://configure_ac.patch"

SRC_URI[md5sum] = "95c627abcf6494f5abe55effe7cd6a57"
SRC_URI[sha256sum] = "c3ef3cd148f3778ddbefb344117d7829db60656efe1031f9e3065fc0faa25136"

inherit autotools pkgconfig binconfig multilib_header

PACKAGECONFIG ??= "gnutls ${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "ipv6", "", d)}"
PACKAGECONFIG_class-native = "ipv6 ssl"
PACKAGECONFIG_class-nativesdk = "ipv6 ssl"
PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
PACKAGECONFIG[ssl] =  "--with-ssl, --without-ssl, ,"
PACKAGECONFIG[gnutls] =  "--with-gnutls=${STAGING_LIBDIR}/../, --without-gnutls, gnutls,"

EXTRA_OECONF = "--with-zlib=${STAGING_LIBDIR}/../ \
                --without-libssh2 \
                --with-random=/dev/urandom \
                --without-libidn \
                --enable-crypto-auth \
                --disable-ldap \
                --disable-ldaps \
                --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
                "

do_configure_prepend() {
	sed -i s:OPT_GNUTLS/bin:OPT_GNUTLS:g ${S}/configure.ac
}

do_install_append() {
	oe_multilib_header curl/curlbuild.h
}

PACKAGES =+ "lib${BPN} lib${BPN}-dev lib${BPN}-staticdev lib${BPN}-doc"

FILES_lib${BPN} = "${libdir}/lib*.so.*"
RRECOMMENDS_lib${BPN} += "ca-certificates"
FILES_lib${BPN}-dev = "${includedir} \
                      ${libdir}/lib*.so \
                      ${libdir}/lib*.la \
                      ${libdir}/pkgconfig \
                      ${datadir}/aclocal \
                      ${bindir}/*-config"
FILES_lib${BPN}-staticdev = "${libdir}/lib*.a"
FILES_lib${BPN}-doc = "${mandir}/man3 \
                      ${mandir}/man1/curl-config.1"

BBCLASSEXTEND = "native nativesdk"
22e } /* Name.Exception */ .highlight .nf { color: #a6e22e } /* Name.Function */ .highlight .nl { color: #f8f8f2 } /* Name.Label */ .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ .highlight .nx { color: #a6e22e } /* Name.Other */ .highlight .py { color: #f8f8f2 } /* Name.Property */ .highlight .nt { color: #f92672 } /* Name.Tag */ .highlight .nv { color: #f8f8f2 } /* Name.Variable */ .highlight .ow { color: #f92672 } /* Operator.Word */ .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */ .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/usr/bin/env python3
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2005 Holger Hans Peter Freyther
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

import optparse, os, sys

# bitbake
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(__file__), 'lib'))
import bb
import bb.parse
from   string import split, join

__version__ = "0.0.2"

class HTMLFormatter:
    """
    Simple class to help to generate some sort of HTML files. It is
    quite inferior solution compared to docbook, gtkdoc, doxygen but it
    should work for now.
    We've a global introduction site (index.html) and then one site for
    the list of keys (alphabetical sorted) and one for the list of groups,
    one site for each key with links to the relations and groups.

        index.html
        all_keys.html
        all_groups.html
        groupNAME.html
        keyNAME.html
    """

    def replace(self, text, *pairs):
        """
        From pydoc... almost identical at least
        """
        while pairs:
            (a, b) = pairs[0]
            text = join(split(text, a), b)
            pairs = pairs[1:]
        return text
    def escape(self, text):
        """
        Escape string to be conform HTML
        """
        return self.replace(text, 
                            ('&', '&'), 
                            ('<', '&lt;' ),
                            ('>', '&gt;' ) )
    def createNavigator(self):
        """
        Create the navgiator
        """
        return """<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="g" href="index.html">Home</a></td>
<td><a accesskey="n" href="all_groups.html">Groups</a></td>
<td><a accesskey="u" href="all_keys.html">Keys</a></td>
</tr></table>
"""

    def relatedKeys(self, item):
        """
        Create HTML to link to foreign keys
        """

        if len(item.related()) == 0:
            return ""

        txt = "<p><b>See also:</b><br>"
        txts = []
        for it in item.related():
            txts.append("""<a href="key%(it)s.html">%(it)s</a>""" % vars() )

        return txt + ",".join(txts)

    def groups(self, item):
        """
        Create HTML to link to related groups
        """

        if len(item.groups()) == 0:
            return ""


        txt = "<p><b>See also:</b><br>"
        txts = []
        for group in item.groups():
            txts.append( """<a href="group%s.html">%s</a> """ % (group, group) )

        return txt + ",".join(txts)


    def createKeySite(self, item):
        """
        Create a site for a key. It contains the header/navigator, a heading,
        the description, links to related keys and to the groups.
        """

        return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Key %s</title></head>
<link rel="stylesheet" href="style.css" type="text/css">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
%s
<h2><span class="refentrytitle">%s</span></h2>

<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<p>
%s
</p>
</div>

<div class="refsynopsisdiv">
<h2>Related Keys</h2>
<p>
%s
</p>
</div>

<div class="refsynopsisdiv">
<h2>Groups</h2>
<p>
%s
</p>
</div>


</body>
"""     % (item.name(), self.createNavigator(), item.name(), 
           self.escape(item.description()), self.relatedKeys(item), self.groups(item))

    def createGroupsSite(self, doc):
        """
        Create the Group Overview site
        """

        groups = ""
        sorted_groups = sorted(doc.groups())
        for group in sorted_groups:
            groups += """<a href="group%s.html">%s</a><br>""" % (group, group)

        return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Group overview</title></head>
<link rel="stylesheet" href="style.css" type="text/css">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
%s
<h2>Available Groups</h2>
%s
</body>
""" % (self.createNavigator(), groups)

    def createIndex(self):
        """
        Create the index file
        """

        return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Bitbake Documentation</title></head>
<link rel="stylesheet" href="style.css" type="text/css">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
%s
<h2>Documentation Entrance</h2>
<a href="all_groups.html">All available groups</a><br>
<a href="all_keys.html">All available keys</a><br>
</body>
""" % self.createNavigator()

    def createKeysSite(self, doc):
        """
        Create Overview of all avilable keys
        """
        keys = ""
        sorted_keys = sorted(doc.doc_keys())
        for key in sorted_keys:
            keys += """<a href="key%s.html">%s</a><br>""" % (key, key)

        return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Key overview</title></head>
<link rel="stylesheet" href="style.css" type="text/css">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
%s
<h2>Available Keys</h2>
%s
</body>
""" % (self.createNavigator(), keys)

    def createGroupSite(self, gr, items, _description = None):
        """
        Create a site for a group:
        Group the name of the group, items contain the name of the keys
        inside this group
        """
        groups = ""
        description = ""

        # create a section with the group descriptions
        if _description:
            description  += "<h2 Description of Grozp %s</h2>" % gr
            description  += _description

        items.sort(lambda x, y:cmp(x.name(), y.name()))
        for group in items:
            groups += """<a href="key%s.html">%s</a><br>""" % (group.name(), group.name())

        return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Group %s</title></head>
<link rel="stylesheet" href="style.css" type="text/css">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
%s
%s
<div class="refsynopsisdiv">
<h2>Keys in Group %s</h2>
<pre class="synopsis">
%s
</pre>
</div>
</body>
""" % (gr, self.createNavigator(), description, gr, groups)



    def createCSS(self):
        """
        Create the CSS file
        """
        return """.synopsis, .classsynopsis
{
  background: #eeeeee;
  border: solid 1px #aaaaaa;
  padding: 0.5em;
}
.programlisting
{
  background: #eeeeff;
  border: solid 1px #aaaaff;
  padding: 0.5em;
}
.variablelist
{
  padding: 4px;
  margin-left: 3em;
}
.variablelist td:first-child
{
  vertical-align: top;
}
table.navigation
{
  background: #ffeeee;
  border: solid 1px #ffaaaa;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}
.navigation a
{
  color: #770000;
}
.navigation a:visited
{
  color: #550000;
}
.navigation .title
{
  font-size: 200%;
}
div.refnamediv
{
  margin-top: 2em;
}
div.gallery-float
{
  float: left;
  padding: 10px;
}
div.gallery-float img
{
  border-style: none;
}
div.gallery-spacer
{
  clear: both;
}
a
{
  text-decoration: none;
}
a:hover
{
  text-decoration: underline;
  color: #FF0000;
}
"""



class DocumentationItem:
    """
    A class to hold information about a configuration
    item. It contains the key name, description, a list of related names,
    and the group this item is contained in.
    """

    def __init__(self):
        self._groups  = []
        self._related = []
        self._name    = ""
        self._desc    = ""

    def groups(self):
        return self._groups

    def name(self):
        return self._name

    def description(self):
        return self._desc

    def related(self):
        return self._related

    def setName(self, name):
        self._name = name

    def setDescription(self, desc):
        self._desc = desc

    def addGroup(self, group):
        self._groups.append(group)

    def addRelation(self, relation):
        self._related.append(relation)

    def sort(self):
        self._related.sort()
        self._groups.sort()


class Documentation:
    """
    Holds the documentation... with mappings from key to items...
    """

    def __init__(self):
        self.__keys   = {}
        self.__groups = {}

    def insert_doc_item(self, item):
        """
        Insert the Doc Item into the internal list
        of representation
        """
        item.sort()
        self.__keys[item.name()] = item

        for group in item.groups():
            if not group in self.__groups:
                self.__groups[group] = []
            self.__groups[group].append(item)
            self.__groups[group].sort()


    def doc_item(self, key):
        """
        Return the DocumentationInstance describing the key
        """
        try:
            return self.__keys[key]
        except KeyError:
            return None

    def doc_keys(self):
        """
        Return the documented KEYS (names)
        """
        return self.__keys.keys()

    def groups(self):
        """
        Return the names of available groups
        """
        return self.__groups.keys()

    def group_content(self, group_name):
        """
        Return a list of keys/names that are in a specefic
        group or the empty list
        """
        try:
            return self.__groups[group_name]
        except KeyError:
            return []


def parse_cmdline(args):
    """
    Parse the CMD line and return the result as a n-tuple
    """

    parser = optparse.OptionParser( version = "Bitbake Documentation Tool Core version %s, %%prog version %s" % (bb.__version__, __version__))
    usage  = """%prog [options]

Create a set of html pages (documentation) for a bitbake.conf....
"""

    # Add the needed options
    parser.add_option( "-c", "--config", help = "Use the specified configuration file as source",
                       action = "store", dest = "config", default = os.path.join("conf", "documentation.conf") )

    parser.add_option( "-o", "--output", help = "Output directory for html files",
                       action = "store", dest = "output", default = "html/" )

    parser.add_option( "-D",  "--debug", help = "Increase the debug level",
                       action = "count", dest = "debug", default = 0 )

    parser.add_option( "-v", "--verbose", help = "output more chit-char to the terminal",
                       action = "store_true", dest = "verbose", default = False )

    options, args = parser.parse_args( sys.argv )
 
    bb.msg.init_msgconfig(options.verbose, options.debug)

    return options.config, options.output

def main():
    """
    The main Method
    """

    (config_file, output_dir) = parse_cmdline( sys.argv )

    # right to let us load the file now
    try:
        documentation = bb.parse.handle( config_file, bb.data.init() )
    except IOError:
        bb.fatal( "Unable to open %s" % config_file )
    except bb.parse.ParseError:
        bb.fatal( "Unable to parse %s" % config_file )

    if isinstance(documentation, dict):
        documentation = documentation[""]

    # Assuming we've the file loaded now, we will initialize the 'tree'
    doc = Documentation()

    # defined states
    state_begin = 0
    state_see   = 1
    state_group = 2

    for key in bb.data.keys(documentation):
        data   = documentation.getVarFlag(key, "doc", False)
        if not data:
            continue

        # The Documentation now starts
        doc_ins = DocumentationItem()
        doc_ins.setName(key)


        tokens = data.split(' ')
        state = state_begin
        string= ""
        for token in tokens:
            token = token.strip(',')

            if not state == state_see and token == "@see":
                state = state_see
                continue
            elif not state == state_group and token  == "@group":
                state = state_group
                continue

            if state == state_begin:
                string += " %s" % token
            elif state == state_see:
                doc_ins.addRelation(token)
            elif state == state_group:
                doc_ins.addGroup(token)

        # set the description
        doc_ins.setDescription(string)
        doc.insert_doc_item(doc_ins)

    # let us create the HTML now
    bb.utils.mkdirhier(output_dir)
    os.chdir(output_dir)

    # Let us create the sites now. We do it in the following order
    # Start with the index.html. It will point to sites explaining all
    # keys and groups
    html_slave = HTMLFormatter()

    f = file('style.css', 'w')
    print >> f, html_slave.createCSS()

    f = file('index.html', 'w')
    print >> f, html_slave.createIndex()

    f = file('all_groups.html', 'w')
    print >> f, html_slave.createGroupsSite(doc)

    f = file('all_keys.html', 'w')
    print >> f, html_slave.createKeysSite(doc)

    # now for each group create the site
    for group in doc.groups():
        f = file('group%s.html' % group, 'w')
        print >> f, html_slave.createGroupSite(group, doc.group_content(group))

    # now for the keys
    for key in doc.doc_keys():
        f = file('key%s.html' % doc.doc_item(key).name(), 'w')
        print >> f, html_slave.createKeySite(doc.doc_item(key))


if __name__ == "__main__":
    main()