summaryrefslogtreecommitdiff
path: root/net-misc/wakeonlan
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 /net-misc/wakeonlan
reinit the tree, so we can have metadata
Diffstat (limited to 'net-misc/wakeonlan')
-rw-r--r--net-misc/wakeonlan/Manifest6
-rw-r--r--net-misc/wakeonlan/files/wakeonlan-0.41-ethers-lookup.patch90
-rw-r--r--net-misc/wakeonlan/metadata.xml9
-rw-r--r--net-misc/wakeonlan/wakeonlan-0.41-r2.ebuild26
4 files changed, 131 insertions, 0 deletions
diff --git a/net-misc/wakeonlan/Manifest b/net-misc/wakeonlan/Manifest
new file mode 100644
index 000000000000..841602319f3b
--- /dev/null
+++ b/net-misc/wakeonlan/Manifest
@@ -0,0 +1,6 @@
+AUX wakeonlan-0.41-ethers-lookup.patch 2284 SHA256 091cf1f456e66cf264657ade127cf524b26d1111bc6c0b5c9375cb662d49f20e SHA512 39cdee0f2732f4d09822cbb82e4674e966b1648fbdd84b4a8adaf3b734ea2e8e4b5f0d535f7d70dbf3608c23ddc0761de9c5892a5c6c73613f322dc4e71db3d2 WHIRLPOOL 19c4a260e8eea106aadadd686f75358a91ade956397226bd324dddc538772bec8c999375d7b58d55659ebfbbc34e9153733b5c1dc008e7aa3039b0d37e078400
+DIST wakeonlan-0.41.tar.gz 6028 SHA256 581b1b27a7e810ab72668cce4bd9aa9b3e0cea34b2db24dd1a44c09d63ddda98 SHA512 192ed2ad157e3f5af01632b8f2b727e232448e5a9bff6aec25298fa9913ec38f1036b665b141b5299994c88b1941d9896b6eaa92cfdb44d65db3628f50e3824f WHIRLPOOL ac27332a74a2327dc33914c7e4adaffefcc064a5667baa95ac8e43fffc59b4d2917916c073e93bfcfeb23e5141047b032d3f87b8800e9fba81d956e6f40eef46
+EBUILD wakeonlan-0.41-r2.ebuild 620 SHA256 7e3fee09ac0e999c8e5f6371bec520814e896f6dbca995c55080c370f6b1264f SHA512 44fc89c20ab63a6cde8881b40d8c69a9f744c03fdc877afeda97c68810d3adc3a73e85d338f59ef0da363f70baac896cecce4d7e281d6bb961afc5e5a423870d WHIRLPOOL 10a1c7edc08954c2c47b9666733fdcbdbd4c3bf8e6d1cf66831bc5ad6a8e9de4fe03dc34345767939a6957823203343ec2c51a83f7b48e933070846f0632cbef
+MISC ChangeLog 2231 SHA256 a155e115f6aaeef1394d5f3bcccc23109d3eb94294e80a8a281ea7f3e2c0c0c1 SHA512 d62ae9919ee5c96a5893ba3103e03ec531ec1286be503c9d9e430d8d164b317e0fa74b6a2f17922b266e187be262d8aea00422bbe24b2dd675bf27ff2d32ac13 WHIRLPOOL cb05e75dbc9f61ad9db757ab1d4944e55782d46ec6fc1ee1d3736c6af787338bc62c47ed69a79fbc618978f8231f5909cb12f6c2ad02de561248201e99843ccc
+MISC ChangeLog-2015 3738 SHA256 aa9ea1574923b21279a07114775461f9bbb42dd2800cb864ef59cfe116f745b9 SHA512 f62c4bd55704b32c44dc5d34fa69100d2e85bfb504567dc301d60795ebba1dff16392f1966bd56efbe0748eec238e2789362de9b6579d42e5ea34a8bae294144 WHIRLPOOL 8aa0e366885905b6bdc1fb1af31b923ada51a889632bda52e96efc55085d3e109ece5b0f7f78f3d106c529d0c0bcb0971b6c7b4240261a0d8a97b2b229c74120
+MISC metadata.xml 302 SHA256 8110ab3b5edc3ffc2f0a138ea8aa64a1e18192a76605dcdc5750a7f2fb4f5d84 SHA512 bc8b86a8e7af1b7c3fc543f267642dfd37f7d8e0f17b99e1eba9a508551c4248b6a072da9d9f74f04d68d51d4b815f3ad2cab2717eb0cbb23f3d224dabe98482 WHIRLPOOL c948993e8620a1aa27f1120f54381313b98d6018ea17e30c564f152ba2736f568a0cc524a685bdeb9de676a802aad280bcb8cd9106a3b214f4527bef164191c7
diff --git a/net-misc/wakeonlan/files/wakeonlan-0.41-ethers-lookup.patch b/net-misc/wakeonlan/files/wakeonlan-0.41-ethers-lookup.patch
new file mode 100644
index 000000000000..6cbc355e2854
--- /dev/null
+++ b/net-misc/wakeonlan/files/wakeonlan-0.41-ethers-lookup.patch
@@ -0,0 +1,90 @@
+--- wakeonlan-0.41.orig/wakeonlan
++++ wakeonlan-0.41/wakeonlan
+@@ -5,6 +5,7 @@
+ #########################################################################
+
+ use strict;
++use Net::hostent;
+ use Socket;
+ use Getopt::Std;
+ use vars qw($VERSION $opt_v $opt_h $opt_i $opt_p $opt_f);
+@@ -44,19 +45,64 @@
+
+ sub wake
+ {
+- my $hwaddr = shift;
++ my $host = shift;
+ my $ipaddr = shift || $DEFAULT_IP;
+ my $port = shift || $DEFAULT_PORT;
+
+ my ($raddr, $them, $proto);
+- my ($hwaddr_re, $pkt);
++ my ($hwaddr, $hwaddr_re, $pkt);
+
+- # Validate hardware address (ethernet address)
++ # get the hardware address (ethernet address)
+
+ $hwaddr_re = join(':', ('[0-9A-Fa-f]{1,2}') x 6);
+- if ($hwaddr !~ m/^$hwaddr_re$/) {
+- warn "Invalid hardware address: $hwaddr\n";
+- return undef;
++ if ($host =~ m/^$hwaddr_re$/) {
++ $hwaddr = $host;
++ } else {
++ # $host is not a hardware address, try to resolve it
++ my $ip_re = join('\.', ('([0-9]|[1-9][0-9]|1[0-9]{2}|2([0-4][0-9]|5[0-5]))') x 4);
++ my $ip_addr;
++ if ($host =~ m/^$ip_re$/) {
++ $ip_addr = $host;
++ } else {
++ my $h;
++ unless ($h = gethost($host)) {
++ warn "$host is not a hardware address and I could not resolve it as to an IP address.\n";
++ return undef;
++ }
++ $ip_addr = inet_ntoa($h->addr);
++ }
++ # look up ip in /etc/ethers
++ unless (open (ETHERS, '<', '/etc/ethers')) {
++ warn "$host is not a hardware address and I could not open /etc/ethers.\n";
++ return undef;
++ }
++ while (<ETHERS>) {
++ if (($_ !~ m/^$/) && ($_ !~ m/^#/)) { # ignore comments
++ my ($mac, $ip);
++ ($mac, $ip) = split(' ', $_, 3);
++ if ($ip =~ m/^$ip$/) {
++ if ($ip eq $ip_addr) {
++ $hwaddr = $mac;
++ last;
++ }
++ next;
++ } else {
++ my $h2;
++ unless ($h2 = gethost($ip)) {
++ next;
++ }
++ if (inet_ntoa($h2->addr) eq $ip_addr) {
++ $hwaddr = $mac;
++ last;
++ }
++ }
++ }
++ }
++ close (ETHERS);
++ unless (defined($hwaddr)) {
++ warn "Could not find $host in /etc/ethers\n";
++ return undef;
++ }
+ }
+
+ # Generate magic sequence
+@@ -68,7 +114,7 @@
+
+ # Allocate socket and send packet
+
+- $raddr = gethostbyname($ipaddr);
++ $raddr = gethostbyname($ipaddr)->addr;
+ $them = pack_sockaddr_in($port, $raddr);
+ $proto = getprotobyname('udp');
+
diff --git a/net-misc/wakeonlan/metadata.xml b/net-misc/wakeonlan/metadata.xml
new file mode 100644
index 000000000000..051b645b0f12
--- /dev/null
+++ b/net-misc/wakeonlan/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>axs@gentoo.org</email>
+ <name>Ian Stakenvicius</name>
+ <description>Primary maintainer</description>
+ </maintainer>
+</pkgmetadata>
diff --git a/net-misc/wakeonlan/wakeonlan-0.41-r2.ebuild b/net-misc/wakeonlan/wakeonlan-0.41-r2.ebuild
new file mode 100644
index 000000000000..62de72536991
--- /dev/null
+++ b/net-misc/wakeonlan/wakeonlan-0.41-r2.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils perl-app
+
+DESCRIPTION="Client for Wake-On-LAN"
+HOMEPAGE="http://gsd.di.uminho.pt/jpo/software/wakeonlan/"
+SRC_URI="http://gsd.di.uminho.pt/jpo/software/wakeonlan/downloads/${P}.tar.gz"
+
+LICENSE="Artistic GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc sparc x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+DEPEND="virtual/perl-ExtUtils-MakeMaker"
+
+src_prepare() {
+ epatch "${FILESDIR}"/"${P}"-ethers-lookup.patch
+}
+
+src_install() {
+ perl-module_src_install
+ dodoc examples/lab001.wol
+}