aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/netcf/netcf_0.2.8.bb
blob: f60bb9f104463630cab3a22f99024c76127fe61f (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
66
67
68
69
70
71
72
73
74
75
SUMMARY = "netcf"
DESCRIPTION = "netcf is a cross-platform network configuration library."
HOMEPAGE = "https://pagure.io/netcf"
SECTION = "libs"
LICENSE = "LGPL-2.1-only"

LIC_FILES_CHKSUM = "file://COPYING;md5=fb919cc88dbe06ec0b0bd50e001ccf1f"

SRCREV = "2c5d4255857531bc09d91dcd02e86545f29004d4"
PV .= "+git${SRCPV}"

SRC_URI = "git://pagure.io/netcf.git;protocol=https;branch=master \
"

UPSTREAM_CHECK_GITTAGREGEX = "release-(?P<pver>(\d+(\.\d+)+))"

DEPENDS += "augeas libnl libxslt libxml2"

do_configure[depends] += "${MLPREFIX}gnulib:do_populate_sysroot"

S = "${WORKDIR}/git"

inherit gettext autotools perlnative pkgconfig systemd

EXTRA_OECONF:append:class-target = " --with-driver=redhat"

PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
PACKAGECONFIG[systemd] = "--with-sysinit=systemd,--with-sysinit=initscripts,"

EXTRA_AUTORECONF += "-I ${S}/gnulib/m4"

do_configure:prepend() {
    currdir=`pwd`
    cd ${S}

    # avoid bootstrap cloning gnulib on every configure
    # the dir starts out empty from the pkg, but unconditionally blow it
    # away so if we reconfigure due to gnulib sysroot sig changes, we will
    # get the newer gnulib content into the build here.
    rm -rf ${S}/.gnulib
    cp -rf ${STAGING_DATADIR}/gnulib ${S}/.gnulib

    # --force to avoid errors on reconfigure e.g if recipes changed we depend on
    # | bootstrap: running: libtoolize --quiet
    # | libtoolize:   error: 'libltdl/COPYING.LIB' exists: use '--force' to overwrite
    # | ...
    ./bootstrap --force --no-git --gnulib-srcdir=.gnulib

    cd $currdir
}

do_install:append() {
    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
       install -d ${D}${systemd_unitdir}/system
       if [ -d "${D}${libdir}/systemd/system" ]; then
           if [ "${systemd_unitdir}" != "${libdir}/systemd" ] ; then 
               mv ${D}${libdir}/systemd/system/* ${D}${systemd_unitdir}/system/
               rm -rf ${D}${libdir}/systemd/
	   fi
       elif [ "${systemd_unitdir}" != "${nonarch_libdir}/systemd" ] ; then 
           mv ${D}${nonarch_libdir}/systemd/system/* ${D}${systemd_unitdir}/system/
           rm -rf ${D}${nonarch_libdir}/systemd/
       fi
    else
       mv ${D}${sysconfdir}/rc.d/init.d/ ${D}${sysconfdir}
       rm -rf ${D}${sysconfdir}/rc.d/
    fi
}

FILES:${PN} += " \
        ${libdir} \
        ${nonarch_libdir} \
        "

SYSTEMD_SERVICE:${PN} = "netcf-transaction.service"