summaryrefslogtreecommitdiff
path: root/sys-apps/ifplugd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-apps/ifplugd
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-apps/ifplugd')
-rw-r--r--sys-apps/ifplugd/Manifest12
-rw-r--r--sys-apps/ifplugd/files/ifplugd-0.28-interface.patch13
-rw-r--r--sys-apps/ifplugd/files/ifplugd-0.28-musl.patch19
-rw-r--r--sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff12
-rw-r--r--sys-apps/ifplugd/files/ifplugd-0.28-noip.patch21
-rw-r--r--sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch63
-rw-r--r--sys-apps/ifplugd/files/ifplugd.action55
-rw-r--r--sys-apps/ifplugd/ifplugd-0.28-r10.ebuild48
-rw-r--r--sys-apps/ifplugd/ifplugd-0.28-r9.ebuild70
-rw-r--r--sys-apps/ifplugd/metadata.xml11
10 files changed, 324 insertions, 0 deletions
diff --git a/sys-apps/ifplugd/Manifest b/sys-apps/ifplugd/Manifest
new file mode 100644
index 000000000000..30d4eaaaaa5d
--- /dev/null
+++ b/sys-apps/ifplugd/Manifest
@@ -0,0 +1,12 @@
+AUX ifplugd-0.28-interface.patch 270 SHA256 d441152398c990f57d75bf1af7f1fac811bfccc96918687e3cf7c1ae9c43ad14 SHA512 0b7ed905b3e3b6a10c4101e42caabbc3d875e22b55268a56eda4dff61db72a03ea444490d01d9ca89d699ef30a091717b0c8bc66079dce193f45990c86b489fb WHIRLPOOL f87701211537cea1c3d65fac0fab3591613f1c74c9e0278667d15ca995542c9df088769124050a0bcf5413d26f999d1bb0c5a35f22e03e95fa59d12e173d9e54
+AUX ifplugd-0.28-musl.patch 422 SHA256 f48c563128c4285a84fd22dde112da30230a07169dc6119a0092c66daa2a8630 SHA512 a73baf8022c25fc01adf4bdc0840abf35f8de7846ff3f44f7793b5c9bf7a5940ff1f789fdf522ddc3d3a14ecb56c178ab652a6a92e76ecae1a38af3e7e0121f7 WHIRLPOOL cd9e63e689222329025e418eedd98147fae1aae3977fc386200d1a0cf656ea9f04277f99475eb6cb7072d51b6ac6ba13df85cc5ef7da0807981e68f369a01bfd
+AUX ifplugd-0.28-nlapi.diff 571 SHA256 2ac2db9078a5251281ecf30ab8f3cf0d575bbf177d830ef854981f9b88525d8d SHA512 70e67e9abaaa360fed7ce2b195a5226a090245f06c6d8ebe4efadc71eb376a57fd64da1be1bfa483c92e538a5ef85a4756de9f1c8ef4075a7a6cc163766dca2d WHIRLPOOL a0d4cd0cf3ff9c0781b1a2b631c35325590971868626eba9ed3ca0cdfd5852d95d99fbc5143f3d1b16fa78eb3c2d5b2af4fa52aa2e326daedb0dda17cc6fd6f0
+AUX ifplugd-0.28-noip.patch 707 SHA256 b072728dea9ab0945d257ce28262514282227394aaee9772204c903d2b21a6ee SHA512 229e6ea2831276f4825172ea72be4480df1999cb237512d38fd34b73fe19afd3441df98c3a07e9a83cedaebd5915f7e074d9eb330b22a86bcf2e2a771da834b4 WHIRLPOOL d63fc16f25fe85bfc5c55092da3f75951996f1d1e4607ed38290594efe673bd51d2aa1eef35bc157e27c16306a99ec9250ce335cc6bac2bbec7fcd18efee6d58
+AUX ifplugd-0.28-strictalias.patch 1585 SHA256 88f3824a20c2111ccd8654bacdbfa45b2b3b1ce159d78867f25334cb8a44a523 SHA512 c25d397b27b115741eb531ee6a990ced98e48cb9c0ea6d098104a4d1972bf1d9c2ff805c2522ea90a4af7d70d016af05b757750c1a06b010979d76d845707f29 WHIRLPOOL 7df22fa2787b87997b449020719a33dc2ec77f572ebe27796493e25c6f26cc90865c6c138b52249c29514a3611afb728f7373ffee9cc00ac014240e9e4552fee
+AUX ifplugd.action 891 SHA256 55c88d2c773bc242e81f9fe310cd48999e69543fa8e0b2389c054e8890260015 SHA512 749f503a8e7acc3114af0b795d23e03108040b8df12bae475aa96127d0b135c30382cec6abd0a03147d1f69b545a2c5d2bd8a18c9a9ebe0613e8888ae305f949 WHIRLPOOL ec29178d73f78104e769232f9092065cc9df0de4312f0fc3519d1e3066832e4e5eed0b1adc432d1309d33752428f2373ad35f1552f6b9f158aaf1f94a6b0b3b1
+DIST ifplugd-0.28.tar.gz 142677 SHA256 474754ac4ab32d738cbf2a4a3e87ee0a2c71b9048a38bdcd7df1e4f9fd6541f0 SHA512 c606e456f81f224eba9f8912e11fb76b759c160313d1db3c9035775b8c1ca57ca10c88dfb33318ba02f5c025218a377ca78ee160fc3d9a31ac6e95b92f340d4f WHIRLPOOL c8cb4a2518b4a97974da412f7f975a9abe54374967630f38781b00ce1f1f887a4485dd6efd775f1aee259a2b877bf5570bca72b5acf036a93c0de33a123c5c00
+EBUILD ifplugd-0.28-r10.ebuild 1198 SHA256 3cc49eba825cee6985bedac8b55b85916bc04cedfe32b468202d25267055c94b SHA512 8c3230a32ddd9914fe3ac95c3be8f8f204ab2c5017024649ce7ce19ec79e9195904dd5b3bf1891f423ec600232816a193de97bf155f9df90863fc1ae950ab4e1 WHIRLPOOL ab8e299fa7b9d710a03e47c73e1e0d1b32fb889da8216cf7c779bd141a802d15e35a613e5d29b9784bbd364dd3fb80abd7978b737a804c7ce23dfbb1cac5a7ad
+EBUILD ifplugd-0.28-r9.ebuild 1824 SHA256 937902465d60faff36fbbeb96234efd7ebf0602c1e7075d315a3a0333b24cf55 SHA512 9a66b4e3eaa56709806faedc895fb2b765c7762c54458c02188d616011ac396557bdad91b55275d6bde567d95f1ff429266737ade9b2ba1ed8acfb7d5f0e7144 WHIRLPOOL 16a1422452493f95b331475acea8aa2efdd2b34ee49cd4f86f922a17c1a19395ebea37cd84733ca74c113b8f722acb8591abd8a9602bccf952afa2a1a2aafd24
+MISC ChangeLog 3682 SHA256 bdc7a2ade655e990c4fef6c3c8301a79c0182ba46e6b9cfc3de8a927a345fb79 SHA512 c9258d59b2cf9328614ea0ac8cce6747ebfbef0a9137907e3281a70e396302a86c9a4b68907e3daf92f2833613f5806c69e9033ea7bef8e885ccd2e081df6f73 WHIRLPOOL d4f01059ba68c147a65e3b441d58b5854bf57ca5148b3cfe9dd18bcd741471ea0e4e5008bf794216ef6b7eb5b015cb1b7fa2d8e2fd3972cd8fd5abb2583e4db9
+MISC ChangeLog-2015 9282 SHA256 8eadd6160cc4c8a71c6d68a664dd0c85bd64ff7676c32efb09f83910bd43d179 SHA512 95de45995041d9151500fc37c485fb82ade2f6a7c037fbdb6fa8d5b6713dcbf6e1ea67db1c6f5816001ccfdb38a724aef7a322fe00784b03d71f962a507e6c3a WHIRLPOOL 33816a5280cd6372a85fb165e0c7cb0a48b07e6dc41d04ff7a6623e849280bd5a2e83f828243ceb619775700abaa1cd55f5fe65a196f33149cf3227255422ebc
+MISC metadata.xml 366 SHA256 2e209cb608c3407538124f734d845956dfa1affc257f6a32c86751b3566743e0 SHA512 2c4b526e804b08e6e971e0413b60c0b0684104d2cd2ac810495a6c6b9ec6a2d8ad846beb929b45639f77a707b08edaabb525af8b9ebfab411ad02214ac4bd60f WHIRLPOOL 0b4a67a8a7dc014e12c7195b871638d400031ed4f6b850506456ca80ebbd69428bd0cc9d6d79748d55a55cdc01402648f5748ec6b324ae269a9ee2e6afa69b3f
diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch b/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch
new file mode 100644
index 000000000000..f99f3a26aed7
--- /dev/null
+++ b/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch
@@ -0,0 +1,13 @@
+--- a/src/interface.c
++++ b/src/interface.c
+@@ -22,9 +22,9 @@
+ #include <config.h>
+ #endif
+
++#include <sys/types.h>
+ #include <linux/sockios.h>
+ #include <linux/if_ether.h>
+-#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <linux/if.h>
diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-musl.patch b/sys-apps/ifplugd/files/ifplugd-0.28-musl.patch
new file mode 100644
index 000000000000..ecaaabfe266e
--- /dev/null
+++ b/sys-apps/ifplugd/files/ifplugd-0.28-musl.patch
@@ -0,0 +1,19 @@
+--- a/src/ethtool-local.h
++++ b/src/ethtool-local.h
+@@ -21,10 +21,12 @@
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+-typedef unsigned long long u64;
+-typedef __uint32_t u32;
+-typedef __uint16_t u16;
+-typedef __uint8_t u8;
++#include <stdint.h>
++
++typedef uint64_t u64;
++typedef uint32_t u32;
++typedef uint16_t u16;
++typedef uint8_t u8;
+
+ #include "ethtool-kernel.h"
+
diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff b/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff
new file mode 100644
index 000000000000..a3d128f20ff4
--- /dev/null
+++ b/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff
@@ -0,0 +1,12 @@
+diff -urN src/nlapi.c src/nlapi.c
+--- a/src/nlapi.c
++++ b/src/nlapi.c
+@@ -86,7 +86,7 @@
+ for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {
+ struct callback_info *c;
+
+- if (!NLMSG_OK(p, bytes) || (size_t) bytes < sizeof(struct nlmsghdr) || (size_t) bytes < p->nlmsg_len) {
++ if (!NLMSG_OK(p, (size_t) bytes) || (size_t) bytes < sizeof(struct nlmsghdr) || (size_t) bytes < (size_t) p->nlmsg_len) {
+ daemon_log(LOG_ERR, "NLAPI: Packet too small or truncated!\n");
+ return -1;
+ }
diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch b/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch
new file mode 100644
index 000000000000..5daa4534eb49
--- /dev/null
+++ b/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch
@@ -0,0 +1,21 @@
+[PATCH] Allow ifplugd to run when no TCP/IP is available
+
+This simple patch create AF_LOCAL socket instead of AF_INET so if TCP/IP
+is not linked into kernel it still works.
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+
+---
+
+diff -urNp ifplugd-0.28.org/src/ifplugd.c ifplugd-0.28/src/ifplugd.c
+--- ifplugd-0.28.org/src/ifplugd.c 2005-06-04 22:21:51.000000000 +0300
++++ ifplugd-0.28/src/ifplugd.c 2007-10-30 05:22:53.000000000 +0200
+@@ -409,7 +409,7 @@ void work(void) {
+ break;
+ }
+
+- if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
++ if ((fd = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) {
+ daemon_log(LOG_ERR, "socket(): %s", strerror(errno));
+ goto finish;
+ }
diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch b/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch
new file mode 100644
index 000000000000..ae8292dc17ac
--- /dev/null
+++ b/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch
@@ -0,0 +1,63 @@
+--- a/src/interface.c
++++ b/src/interface.c
+@@ -89,6 +89,10 @@
+
+ interface_status_t interface_detect_beat_mii(int fd, char *iface) {
+ struct ifreq ifr;
++ union {
++ caddr_t *data;
++ unsigned short *usz;
++ } ifd;
+
+ if (interface_auto_up)
+ interface_up(fd, iface);
+@@ -103,7 +107,8 @@
+ return IFSTATUS_ERR;
+ }
+
+- ((unsigned short*) &ifr.ifr_data)[1] = 1;
++ ifd.data = &ifr.ifr_data;
++ *++ifd.usz = 1;
+
+ if (ioctl(fd, SIOCGMIIREG, &ifr) == -1) {
+ if (interface_do_message)
+@@ -112,12 +117,17 @@
+ return IFSTATUS_ERR;
+ }
+
+- return (((unsigned short*) &ifr.ifr_data)[3] & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN;
++ ifd.usz += 2;
++ return (*ifd.usz & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN;
+ }
+
+ interface_status_t interface_detect_beat_priv(int fd, char *iface) {
+ struct ifreq ifr;
+-
++ union {
++ caddr_t *data;
++ unsigned short *usz;
++ } ifd;
++
+ if (interface_auto_up)
+ interface_up(fd, iface);
+
+@@ -131,7 +141,8 @@
+ return IFSTATUS_ERR;
+ }
+
+- ((unsigned short*) &ifr.ifr_data)[1] = 1;
++ ifd.data = &ifr.ifr_data;
++ *++ifd.usz = 1;
+
+ if (ioctl(fd, SIOCDEVPRIVATE+1, &ifr) == -1) {
+ if (interface_do_message)
+@@ -140,7 +151,8 @@
+ return IFSTATUS_ERR;
+ }
+
+- return (((unsigned short*) &ifr.ifr_data)[3] & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN;
++ ifd.usz += 2;
++ return (*ifd.usz & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN;
+ }
+
+ interface_status_t interface_detect_beat_ethtool(int fd, char *iface) {
diff --git a/sys-apps/ifplugd/files/ifplugd.action b/sys-apps/ifplugd/files/ifplugd.action
new file mode 100644
index 000000000000..ba4cfd7d20b9
--- /dev/null
+++ b/sys-apps/ifplugd/files/ifplugd.action
@@ -0,0 +1,55 @@
+#!/bin/sh
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
+# Gentoo-specific ifplugd.action
+#
+# This file gets called by ifplugd when it wants to bring an interface
+# up or down.
+#
+
+if grep -q initng /proc/1/cmdline
+then
+ EXEC="/sbin/ngc"
+ INITNG="yes"
+else
+ EXEC="/etc/init.d/net.$1"
+ INITNG="no"
+fi
+
+case "$2" in
+ up)
+ if [ "${INITNG}" = "yes" ]
+ then
+ ARGS="-u net/$1"
+ else
+ ARGS="--quiet start"
+ fi
+ ;;
+ down)
+ if [ "${INITNG}" = "yes" ]
+ then
+ ARGS="-d net/$1"
+ else
+ ARGS="--quiet stop"
+ fi
+ ;;
+ *)
+ echo "$0: wrong arguments" >&2
+ echo "Call with <interface> <up|down>" >&2
+ exit 1
+ ;;
+esac
+
+export IN_BACKGROUND=true
+
+if [ -x "${EXEC}" ]
+then
+ ${EXEC} ${ARGS}
+ exit 0
+else
+ logger -t ifplugd.action "Error: Couldn't configure $1, no ${EXEC} !"
+ exit 1
+fi
+
+# vim: set ts=4
diff --git a/sys-apps/ifplugd/ifplugd-0.28-r10.ebuild b/sys-apps/ifplugd/ifplugd-0.28-r10.ebuild
new file mode 100644
index 000000000000..9f7114191a90
--- /dev/null
+++ b/sys-apps/ifplugd/ifplugd-0.28-r10.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Brings up/down ethernet ports automatically with cable detection"
+HOMEPAGE="http://0pointer.de/lennart/projects/ifplugd/"
+SRC_URI="http://0pointer.de/lennart/projects/ifplugd/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm hppa ppc x86"
+IUSE="doc selinux"
+
+DEPEND="virtual/pkgconfig
+ doc? ( www-client/lynx )
+ >=dev-libs/libdaemon-0.5"
+RDEPEND=">=dev-libs/libdaemon-0.5
+ >=sys-apps/baselayout-1.12
+ selinux? ( sec-policy/selinux-ifplugd )"
+
+PATCHES=(
+ "${FILESDIR}/${P}-nlapi.diff"
+ "${FILESDIR}/${P}-interface.patch"
+ "${FILESDIR}/${P}-strictalias.patch"
+ "${FILESDIR}/${P}-noip.patch"
+ "${FILESDIR}/${P}-musl.patch"
+ )
+DOCS=( doc/README doc/SUPPORTED_DRIVERS )
+HTML_DOCS=( doc/README.html doc/style.css )
+
+src_configure() {
+ econf \
+ $(use_enable doc lynx) \
+ --with-initdir=/etc/init.d \
+ --disable-xmltoman \
+ --disable-subversion
+}
+
+src_install() {
+ default
+
+ # Remove init.d configuration as we no longer use it
+ rm -rf "${ED}/etc/ifplugd" "${ED}/etc/init.d/${PN}" || die
+
+ exeinto "/etc/${PN}"
+ newexe "${FILESDIR}/${PN}.action" "${PN}.action"
+}
diff --git a/sys-apps/ifplugd/ifplugd-0.28-r9.ebuild b/sys-apps/ifplugd/ifplugd-0.28-r9.ebuild
new file mode 100644
index 000000000000..a3a9bd0112fc
--- /dev/null
+++ b/sys-apps/ifplugd/ifplugd-0.28-r9.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="Brings up/down ethernet ports automatically with cable detection"
+HOMEPAGE="http://0pointer.de/lennart/projects/ifplugd/"
+SRC_URI="http://0pointer.de/lennart/projects/ifplugd/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~arm amd64 hppa ppc x86"
+IUSE="doc selinux"
+
+DEPEND="virtual/pkgconfig
+ doc? ( www-client/lynx )
+ >=dev-libs/libdaemon-0.5"
+RDEPEND=">=dev-libs/libdaemon-0.5
+ >=sys-apps/baselayout-1.12
+ selinux? ( sec-policy/selinux-ifplugd )"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-nlapi.diff"
+ epatch "${FILESDIR}/${P}-interface.patch"
+ epatch "${FILESDIR}/${P}-strictalias.patch"
+ epatch "${FILESDIR}/${P}-noip.patch"
+}
+
+src_configure() {
+ econf \
+ $(use_enable doc lynx) \
+ --with-initdir=/etc/init.d \
+ --disable-xmltoman \
+ --disable-subversion
+}
+
+src_install() {
+ default
+
+ # Remove init.d configuration as we no longer use it
+ rm -rf "${D}/etc/ifplugd" "${D}/etc/init.d/${PN}"
+
+ exeinto "/etc/${PN}"
+ newexe "${FILESDIR}/${PN}.action" "${PN}.action"
+
+ cd "${S}/doc"
+ dodoc README SUPPORTED_DRIVERS
+ use doc && dohtml *.html *.css
+}
+
+pkg_postinst() {
+ # Warn about old init script
+ einfo "baselayout now starts ifplugd automatically on wired interfaces"
+ einfo "If you do not want this behaviour then add !plug to your modules"
+ einfo "in /etc/conf.d/net like so"
+ einfo " modules=( \"!plug\" )"
+
+ if [ -e "${ROOT}/etc/init.d/ifplugd" -o -e "${ROOT}/etc/conf.d/ifplugd" ] ; then
+ echo
+ ewarn "You should stop the ifplugd service now and remove its init"
+ ewarn "script and config file"
+ if [ "${ROOT}" = "/" ] ; then
+ ewarn " /etc/init.d/ifplugd stop"
+ ewarn " rc-update del ifplugd"
+ ewarn " rm -f /etc/{conf,init}.d/ifplugd"
+ fi
+ fi
+}
diff --git a/sys-apps/ifplugd/metadata.xml b/sys-apps/ifplugd/metadata.xml
new file mode 100644
index 000000000000..bb67101bd413
--- /dev/null
+++ b/sys-apps/ifplugd/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<longdescription lang="en">
+ Brings up/down ethernet ports automatically with cable detection
+</longdescription>
+</pkgmetadata>