Hi all,

wbx@ just assigned me to continue the info.nfo conversion. Find below
a few comments and more examples from me on that issue, and discuss
it. Phil (n0-1@) plase seat yourself firmly before continuing.


Semantical discussion about info.nfo

The syntactical specification is finished, and it's good. But.

Okay, now, bad news, sorry Phil, but ille “nfotizer” delendum est.
Nothing personal, but it doesn't adhere to our specification – to
first produce only one database from all the info.nfo files, then
spit out the generated files (Config.in, info.mk, *.control, etc.)
and to have the dependencies in only one place (you're using a
SELECT keyword, which breaks this concept, also SYMBOL etc.).

Taking your example (tabs alinged so it's better visible):

=== BEGIN package/radvd/info.nfo
NAME            radvd
VERSION         0.7.3
RELEASE         2
MD5SUM          56ce3f8cbf5966a0d531c21813320423
SOURCES         http://v6web.litech.org/radvd/dist \
                http://download.sourcemage.org/mirror
SOURCENAME      ${PKG_NAME}-${PKG_VERSION}.tar.gz
INIT_NUM        51
SECTION         net
PRIORITY        optional
PKGDEPS         kmod-ipv6
DESC_LINE       IPv6 Routing Advertisement Daemon
DESC_FULL       Routing Advertisement Daemon for IPv6

                http://v6web.litech.org/radvd/
SYMBOL          FWRT_PACKAGE_RADVD
DEFAULT_STATE   n
SELECT          FWRT_PACKAGE_KMOD_IPV6 \
                BUSYBOX_CONFIG_FEATURE_IPV6
=== END package/radvd/info.nfo

In the following examples, I'll leave out
• SOURCENAME because it's the default value anyway
• SECTION, PRIORITY because they're not needed,
  since we do not parse this part of the control
  file anyway (but we _could_ generate package/Control.in
  using that information later)

So now we'll have to do something like this (and yes,
I will visually align the tabs here, in the actual
source file they'll have to be different as per the
syntactical spec):

=== BEGIN package/radvd/info.nfo
NAME            radvd
#BROKEN         no (default; add something else here to disable)
VERSION         0.7.3
RELEASE         2
# the following one is actually default
PKGNAME         ${NAME}-${VERSION}-${RELEASE}
# I also at least want a pseudo-hash named “size”, to
# fight against sourceforge and similarly broken upstreams
HASHES          md5
HASH_md5        56ce3f8cbf5966a0d531c21813320423
SOURCES         http://v6web.litech.org/radvd/dist/ \
                http://download.sourcemage.org/mirror/
# this would be for a second and third distfile, if needed
#DISTFILES      3
#DISTFILE_2     fromthesamesite.tar.gz
#DISTFILE_3     fromanothersite.tar.gz:1
#SOURCES_1      http://someothersite/
#HASH_2_md5     ...
#HASH_3_md5     ...
# if this is missing, the init file is not copied
INITNUM         51
# note I don't use INIT_NUM - I intend INITNUM_foo to be
# used for the "foo" subpackage, for cases like openssl,
# where you build two packages at once

# this is for the postinst file
# if this doesn't exist/default to zero, it's not generated
RCCONF_SYMS     1
RCCONF_1_TAG    radvd package
# SYM defaults to TAG
RCCONF_1_SYM    radvd
# VAL defaults to "NO"
RCCONF_1_VAL    NO
# empty here, otherwise same syntax like PKGDEPS
#BUILDDEPS
# first dependency: on a packet
# kmod-ipv6 is the "NAME" field of said package!
# dependencies are actually Config.in "select" lines
PKGDEPS         kmod-ipv6
# second dependency: on a flavour
                busybox,ipv6
# this is for Config.in and the control file
MENUITEM        radvd
DESCRIPTION     IPv6 Routing Advertisement Daemon
# this is for Config.in only
DEFAULT         n
HELPTEXT        Routing Advertisement Daemon for IPv6

                http://v6web.litech.org/radvd/
=== END package/radvd/info.nfo

You might have noticed I used ${NAME} to substitute one of
the fields from the info.nfo file. Since the specification
says, I quote, “Backslashes (\) have to be escaped by
doubling them (\\).”, I think we can use \${VARIABLE} to
access make variables, and make the ${...} special for the
nfotiser, in order to have some kind of variable/code reuse.


Okay, now for something more heavy-weight.

=== BEGIN package/busybox/info.nfo
NAME                    busybox
VERSION                 1.4.1
RELEASE                 10
HASHES                  md5
HASH_md5                5728403bce309cdabcffa414e2e64052
SOURCES                 http://www.busybox.net/downloads/
INITNUM                 60
MENUITEM                busybox
DESCRIPTION             The Swiss Army Knife
HELPTEXT                The Swiss Army Knife of embedded Linux.  It slices, it
                        dices, it makes Julian Fries.

                        http://busybox.net/
DEFAULT                 y

# only a few, to demonstrate
# by default, main (without _foo) and SUBPACKAGES are tristate,
# flavours are boolean and (usually) have no MENUITEM entry
FLAVOURS                gzip ipv6 syslogd circlogbuf
DESCRIPTION_gzip        gzip
HELPTEXT_gzip           The gzip applet for busybox
DEFAULT_gzip            y
DESCRIPTION_ipv6        Enable IPv6 support
HELPTEXT_ipv6           Enable IPv6 support in busybox.
                        This adds IPv6 support in the networking applets.
DEFAULT_ipv6            n
DESCRIPTION_syslogd     syslogd
HELPTEXT_syslogd        The syslogd utility is used to record logs of all the
                        blah...
DEFAULT_syslogd         y
DESCRIPTION_circlogbuf  Circular Buffer support
HELPTEXT_circlogbuf     When you enable this feature, the syslogd utility will
                        blah...
DEFAULT_circlogbuf      y
# a Config.in "depends" line
MENUDEP_circlogbuf      syslogd

# of course, there's *so* much missing here
=== END package/busybox/info.nfo

All configuration symbols are autogenerated, although busybox
does make a case for an option to manually select them, and
because I propose to first make an SQLite database out of ALL
info.nfo files AT ONCE before writing out the first byte of
any generated file, it doesn't matter, since we can get the
configuration symbols from the database. So we'd use something
like this:
CSYM_ipv6               BUSYBOX_CONFIG_FEATURE_IPV6

But for normal packages, we don't FREEWRT_PACKAGE_foo or
FREEWRT_COMPILE_bar any more, we'll just let the nfo system
deal with that.

We also need a CITEM_foo (bool, tristate, int, string) in case
we'll have to override the defaults.

----

I already spoke of subpackages.

Let me make an example for it using OpenSSL, which as of now
has a FWRT_COMPILE and two FWRT_PACKAGEs.

=== BEGIN package/openssl/info.nfo
NAME                    openssl
VERSION                 0.9.8d
RELEASE                 2
HASHES                  md5
HASH_md5                8ed1853538e1d05a1f5ada61ebf8bffa
SOURCES                 http://www.openssl.org/source/ #...
# this one is actually missing at the moment, I think, but
# because it has a "zlib-dynamic" option, we'll need it
# btw, PKGDEPS are both build and run time
PKGDEPS                 libz
MENUITEM                libopenssl # or just openssl? I like just openssl better
DESCRIPTION             Open source SSL (Secure Socket Layer) libraries
DEFAULT                 n
HELPTEXT                The OpenSSL Project is a collaborative effort to 
develop a robust,
                        blah...
SUBPACKAGES             tool
NAME_tool               openssltool
PKGNAME_tool            openssl-util-${VERSION}-${RELEASE}
PKGDEPS_tool            openssl
MENUITEM_tool           openssl-util
DESCRIPTION_tool        OpenSSL command line tool
DEFAULT_tool            n
HELPTEXT_tool           ...
=== END package/radvd/info.nfo


How about that?

bye,
//mirabile
-- 
I believe no one can invent an algorithm. One just happens to hit upon it
when God enlightens him. Or only God invents algorithms, we merely copy them.
If you don't believe in God, just consider God as Nature if you won't deny
existence.              -- Coywolf Qi Hunt
_______________________________________________
freewrt-developers mailing list
[email protected]
https://www.freewrt.org/lists/listinfo/freewrt-developers

Reply via email to