xref: /openbmc/openbmc/meta-openembedded/meta-oe/recipes-core/meta/distro-feed-configs.bb (revision 03514f1996efa799e50da744818ba331c2e893b6)
1SUMMARY = "Configuration files for online package repositories aka feeds"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4
5DISTRO_FEED_PREFIX ?= "remote"
6DISTRO_FEED_URI ?= "http://my-distribution.example/remote-feed/"
7DISTRO_FEED_ARCHS ?= "all ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}"
8
9do_compile() {
10    mkdir -p ${S}/${sysconfdir}/opkg
11    for feed in ${DISTRO_FEED_ARCHS}; do
12        echo "src/gz ${DISTRO_FEED_PREFIX}-${feed} ${DISTRO_FEED_URI}/${feed}" > ${S}/${sysconfdir}/opkg/${feed}-feed.conf
13    done
14}
15do_install () {
16    install -d ${D}${sysconfdir}/opkg
17    install -m 0644 ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/
18}
19
20PACKAGE_ARCH = "${MACHINE_ARCH}"
21
22#def distro_feed_configs(d):
23#    import bb
24#    parchs = d.getVar("PACKAGE_EXTRA_ARCHS").split()
25#    march = d.getVar("MACHINE_ARCH").split()
26#    archs = [ "all" ] + parchs + march
27#    confs = [ ( "${sysconfdir}/opkg/%s-feed.conf" % feed ) for feed in archs ]
28#    return " ".join( confs )
29#
30#CONFFILES:${PN} += '${@distro_feed_configs(d)}'
31
32CONFFILES:${PN} += '${@ " ".join( [ ( "${sysconfdir}/opkg/%s-feed.conf" % feed ) for feed in "all ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}".split() ] ) }'
33