Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/net-tools/files/, sys-apps/net-tools/
Date: Wed, 22 Jan 2014 17:10:05
Message-Id: 1390405952.281dbc321e9f8fc7df4f01dca364ef6c7a3533fe.blueness@gentoo
1 commit: 281dbc321e9f8fc7df4f01dca364ef6c7a3533fe
2 Author: layman <layman <AT> localhost>
3 AuthorDate: Tue Jan 21 22:24:15 2014 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 22 15:52:32 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=281dbc32
7
8 sys-apps/net-tools: fix assumption about headers
9
10 Package-Manager: portage-2.2.7
11 RepoMan-Options: --force
12
13 ---
14 .../files/net-tools-fix-header-assumptions.patch | 93 ++++++++++++++++++++
15 sys-apps/net-tools/metadata.xml | 8 ++
16 .../net-tools-1.60_p20120127084908-r99.ebuild | 98 ++++++++++++++++++++++
17 3 files changed, 199 insertions(+)
18
19 diff --git a/sys-apps/net-tools/files/net-tools-fix-header-assumptions.patch b/sys-apps/net-tools/files/net-tools-fix-header-assumptions.patch
20 new file mode 100644
21 index 0000000..f56dffc
22 --- /dev/null
23 +++ b/sys-apps/net-tools/files/net-tools-fix-header-assumptions.patch
24 @@ -0,0 +1,93 @@
25 +diff -Naur net-tools-1.60_p20120127084908.orig/lib/inet6_gr.c net-tools-1.60_p20120127084908/lib/inet6_gr.c
26 +--- net-tools-1.60_p20120127084908.orig/lib/inet6_gr.c 2012-01-27 08:49:08.000000000 +0000
27 ++++ net-tools-1.60_p20120127084908/lib/inet6_gr.c 2014-01-21 19:18:50.557199377 +0000
28 +@@ -23,9 +23,6 @@
29 + #include <string.h>
30 + #include <stdio.h>
31 + #include <unistd.h>
32 +-#ifndef __GLIBC__
33 +-#include <netinet6/ipv6_route.h> /* glibc doesn't have this */
34 +-#endif
35 + #include "version.h"
36 + #include "net-support.h"
37 + #include "pathnames.h"
38 +diff -Naur net-tools-1.60_p20120127084908.orig/lib/inet6_sr.c net-tools-1.60_p20120127084908/lib/inet6_sr.c
39 +--- net-tools-1.60_p20120127084908.orig/lib/inet6_sr.c 2012-01-27 08:49:08.000000000 +0000
40 ++++ net-tools-1.60_p20120127084908/lib/inet6_sr.c 2014-01-21 19:19:23.307201208 +0000
41 +@@ -23,11 +23,7 @@
42 + #include <string.h>
43 + #include <stdio.h>
44 + #include <unistd.h>
45 +-#ifdef __GLIBC__
46 + #include <net/route.h>
47 +-#else
48 +-#include <netinet6/ipv6_route.h> /* glibc does not have this */
49 +-#endif
50 + #include "version.h"
51 + #include "net-support.h"
52 + #include "pathnames.h"
53 +diff -Naur net-tools-1.60_p20120127084908.orig/lib/inet_sr.c net-tools-1.60_p20120127084908/lib/inet_sr.c
54 +--- net-tools-1.60_p20120127084908.orig/lib/inet_sr.c 2012-01-27 08:49:08.000000000 +0000
55 ++++ net-tools-1.60_p20120127084908/lib/inet_sr.c 2014-01-21 20:41:59.223478324 +0000
56 +@@ -26,6 +26,7 @@
57 + #include <string.h>
58 + #include <stdio.h>
59 + #include <unistd.h>
60 ++#include <asm-generic/param.h>
61 + #include "version.h"
62 + #include "net-support.h"
63 + #include "pathnames.h"
64 +diff -Naur net-tools-1.60_p20120127084908.orig/lib/util-ank.c net-tools-1.60_p20120127084908/lib/util-ank.c
65 +--- net-tools-1.60_p20120127084908.orig/lib/util-ank.c 2012-01-27 08:49:08.000000000 +0000
66 ++++ net-tools-1.60_p20120127084908/lib/util-ank.c 2014-01-21 20:42:56.876481548 +0000
67 +@@ -25,6 +25,7 @@
68 + #include <netdb.h>
69 + #include <arpa/inet.h>
70 + #include <resolv.h>
71 ++#include <limits.h>
72 +
73 + #include "intl.h"
74 + #include "util-ank.h"
75 +diff -Naur net-tools-1.60_p20120127084908.orig/mii-tool.c net-tools-1.60_p20120127084908/mii-tool.c
76 +--- net-tools-1.60_p20120127084908.orig/mii-tool.c 2012-01-27 08:49:08.000000000 +0000
77 ++++ net-tools-1.60_p20120127084908/mii-tool.c 2014-01-21 20:54:31.563520392 +0000
78 +@@ -47,10 +47,6 @@
79 + #include <net/if.h>
80 + #include <linux/sockios.h>
81 +
82 +-#ifndef __GLIBC__
83 +-#include <linux/if_arp.h>
84 +-#include <linux/if_ether.h>
85 +-#endif
86 + #include <linux/mii.h>
87 + #include <linux/sockios.h>
88 + #include "version.h"
89 +diff -Naur net-tools-1.60_p20120127084908.orig/netstat.c net-tools-1.60_p20120127084908/netstat.c
90 +--- net-tools-1.60_p20120127084908.orig/netstat.c 2012-01-27 08:49:08.000000000 +0000
91 ++++ net-tools-1.60_p20120127084908/netstat.c 2014-01-21 20:43:34.023483625 +0000
92 +@@ -88,6 +88,7 @@
93 + #include <sys/stat.h>
94 + #include <net/if.h>
95 + #include <dirent.h>
96 ++#include <asm-generic/param.h>
97 +
98 + #if HAVE_SELINUX
99 + #include <selinux/selinux.h>
100 +diff -Naur net-tools-1.60_p20120127084908.orig/slattach.c net-tools-1.60_p20120127084908/slattach.c
101 +--- net-tools-1.60_p20120127084908.orig/slattach.c 2012-01-27 08:49:08.000000000 +0000
102 ++++ net-tools-1.60_p20120127084908/slattach.c 2014-01-21 20:44:46.953487703 +0000
103 +@@ -45,14 +45,7 @@
104 + #include <unistd.h>
105 + #include <getopt.h>
106 + #include <linux/if_slip.h>
107 +-
108 +-#if defined(__GLIBC__)
109 +-#if __GLIBC__ == 2 && __GLIBC_MINOR__ == 0
110 +-# include <termbits.h>
111 +-#else
112 + # include <termios.h>
113 +-#endif
114 +-#endif
115 +
116 + #include "pathnames.h"
117 + #include "net-support.h"
118
119 diff --git a/sys-apps/net-tools/metadata.xml b/sys-apps/net-tools/metadata.xml
120 new file mode 100644
121 index 0000000..0c72e81
122 --- /dev/null
123 +++ b/sys-apps/net-tools/metadata.xml
124 @@ -0,0 +1,8 @@
125 +<?xml version="1.0" encoding="UTF-8"?>
126 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
127 +<pkgmetadata>
128 +<herd>base-system</herd>
129 +<use>
130 + <flag name='old-output'>use old ifconfig output style (useful for when new output breaks scripts)</flag>
131 +</use>
132 +</pkgmetadata>
133
134 diff --git a/sys-apps/net-tools/net-tools-1.60_p20120127084908-r99.ebuild b/sys-apps/net-tools/net-tools-1.60_p20120127084908-r99.ebuild
135 new file mode 100644
136 index 0000000..01c1324
137 --- /dev/null
138 +++ b/sys-apps/net-tools/net-tools-1.60_p20120127084908-r99.ebuild
139 @@ -0,0 +1,98 @@
140 +# Copyright 1999-2014 Gentoo Foundation
141 +# Distributed under the terms of the GNU General Public License v2
142 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/net-tools/net-tools-1.60_p20120127084908.ebuild,v 1.16 2014/01/18 03:28:51 vapier Exp $
143 +
144 +EAPI="3"
145 +
146 +inherit flag-o-matic toolchain-funcs eutils
147 +
148 +if [[ ${PV} == "9999" ]] ; then
149 + EGIT_REPO_URI="git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools"
150 + inherit git-2
151 + KEYWORDS=""
152 +else
153 + PATCH_VER="1"
154 + SRC_URI="mirror://gentoo/${P}.tar.xz
155 + mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz"
156 + KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
157 +fi
158 +
159 +DESCRIPTION="Standard Linux networking tools"
160 +HOMEPAGE="http://net-tools.sourceforge.net/"
161 +
162 +LICENSE="GPL-2"
163 +SLOT="0"
164 +IUSE="nls old-output static"
165 +
166 +RDEPEND="!<sys-apps/openrc-0.9.9.3"
167 +DEPEND="${RDEPEND}
168 + app-arch/xz-utils"
169 +
170 +maint_pkg_create() {
171 + cd /usr/local/src/net-tools
172 + #git-update
173 + local stamp=$(date --date="$(git log -n1 --pretty=format:%ci master)" -u +%Y%m%d%H%M%S)
174 + local pv="${PV/_p*}_p${stamp}"; pv=${pv/9999/1.60}
175 + local p="${PN}-${pv}"
176 + git archive --prefix="nt/" master | tar xf - -C "${T}"
177 + pushd "${T}" >/dev/null
178 + pushd nt >/dev/null
179 + sed -i "/^RELEASE/s:=.*:=${pv}:" Makefile || die
180 + emake dist >/dev/null
181 + popd >/dev/null
182 + zcat ${p}.tar.gz | xz > ${p}.tar.xz
183 + rm -f ${p}.tar.gz
184 + popd >/dev/null
185 +
186 + local patches="${p}-patches-${PATCH_VER:-1}"
187 + local d="${T}/${patches}"
188 + mkdir "${d}"
189 + git format-patch -o "${d}" master..gentoo > /dev/null
190 + echo "From http://git.overlays.gentoo.org/gitweb/?p=proj/net-tools.git" > "${d}"/README
191 + tar cf - -C "${T}" ${d##*/} | xz > "${T}"/${patches}.tar.xz
192 + rm -rf "${d}"
193 +
194 + du -b "${T}"/*.tar.xz
195 +}
196 +
197 +pkg_setup() { [[ -n ${VAPIER_LOVES_YOU} ]] && maint_pkg_create ; }
198 +
199 +set_opt() {
200 + local opt=$1 ans
201 + shift
202 + ans=$("$@" && echo y || echo n)
203 + einfo "Setting option ${opt} to ${ans}"
204 + sed -i \
205 + -e "/^bool.* ${opt} /s:[yn]$:${ans}:" \
206 + config.in || die
207 +}
208 +
209 +src_prepare() {
210 + epatch "${FILESDIR}"/${PN}-fix-header-assumptions.patch
211 + if [[ -n ${PATCH_VER} ]] ; then
212 + use old-output || EPATCH_EXCLUDE="0001-revert-621a2f376334f8097604b9fee5783e0f1141e66d-for-.patch"
213 + EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch "${WORKDIR}"/${P}-patches-${PATCH_VER}
214 + fi
215 +}
216 +
217 +src_configure() {
218 + set_opt I18N use nls
219 + set_opt HAVE_HWIB has_version '>=sys-kernel/linux-headers-2.6'
220 + set_opt HAVE_HWTR has_version '<sys-kernel/linux-headers-3.5'
221 + set_opt HAVE_HWSTRIP has_version '<sys-kernel/linux-headers-3.6'
222 + if use static ; then
223 + append-flags -static
224 + append-ldflags -static
225 + fi
226 + tc-export AR CC
227 + yes "" | ./configure.sh config.in || die
228 +}
229 +
230 +src_install() {
231 + emake DESTDIR="${ED}" install || die
232 + dodoc README README.ipv6 TODO
233 +}
234 +
235 +pkg_postinst() {
236 + einfo "etherwake and such have been split into net-misc/ethercard-diag"
237 +}