1SUMMARY = "ifupdown: basic ifup and ifdown used by initscripts"
2HOMEPAGE = "https://salsa.debian.org/debian/ifupdown"
3DESCRIPTION = "High level tools to configure network interfaces \
4This package provides the tools ifup and ifdown which may be used to \
5configure (or, respectively, deconfigure) network interfaces, based on \
6the file /etc/network/interfaces."
7LICENSE = "GPL-2.0-only"
8LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
9
10SRC_URI = "git://salsa.debian.org/debian/ifupdown.git;protocol=https;branch=master \
11           file://99_network \
12           file://run-ptest \
13           file://0001-Define-FNM_EXTMATCH-for-musl.patch \
14           file://0001-Makefile-do-not-use-dpkg-for-determining-OS-type.patch \
15           file://0001-ifupdown-skip-wrong-test-case.patch \
16           file://defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch \
17           file://tweak-ptest-script.patch \
18           "
19SRCREV = "369d9d3c13a0c56ad09fd4f13b4a80eb9a94e270"
20
21S = "${WORKDIR}/git"
22
23
24inherit ptest update-alternatives
25
26do_compile () {
27	chmod a+rx *.pl *.sh
28	oe_runmake 'CC=${CC}' "CFLAGS=${CFLAGS} -Wall -W -D'IFUPDOWN_VERSION=\"${PV}\"'"
29}
30
31do_install () {
32	install -d ${D}${mandir}/man8 \
33		  ${D}${mandir}/man5 \
34		  ${D}${base_sbindir}
35
36	# If volatiles are used, then we'll also need /run/network there too.
37	install -d ${D}/etc/default/volatiles
38	install -m 0644 ${UNPACKDIR}/99_network ${D}/etc/default/volatiles
39
40	install -m 0755 ifup ${D}${base_sbindir}/
41	ln ${D}${base_sbindir}/ifup ${D}${base_sbindir}/ifdown
42	install -m 0644 ifup.8 ${D}${mandir}/man8
43	install -m 0644 interfaces.5 ${D}${mandir}/man5
44	cd ${D}${mandir}/man8 && ln -s ifup.8 ifdown.8
45
46	install -d ${D}${sysconfdir}/network/if-pre-up.d
47	install -d ${D}${sysconfdir}/network/if-up.d
48	install -d ${D}${sysconfdir}/network/if-down.d
49	install -d ${D}${sysconfdir}/network/if-post-down.d
50}
51
52do_install_ptest () {
53    install -d ${D}${PTEST_PATH}/tests
54    cp -r ${S}/tests/testbuild-linux ${D}${PTEST_PATH}/tests/
55    cp -r ${S}/tests/linux ${D}${PTEST_PATH}/tests/
56}
57
58ALTERNATIVE_PRIORITY = "100"
59ALTERNATIVE:${PN} = "ifup ifdown"
60
61ALTERNATIVE_LINK_NAME[ifup] = "${base_sbindir}/ifup"
62ALTERNATIVE_LINK_NAME[ifdown] = "${base_sbindir}/ifdown"
63