Add new package: hping (#18311)
* Add new package: hping * Update var/spack/repos/builtin/packages/hping/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> * Update var/spack/repos/builtin/packages/hping/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> * Update package.py Fix flake8 errors Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
parent
128731ec74
commit
6d39e6ebea
26
var/spack/repos/builtin/packages/hping/bpf.patch
Normal file
26
var/spack/repos/builtin/packages/hping/bpf.patch
Normal file
@ -0,0 +1,26 @@
|
||||
diff --git a/libpcap_stuff.c b/libpcap_stuff.c
|
||||
index 26f9993..aaa0d40 100644
|
||||
--- a/libpcap_stuff.c
|
||||
+++ b/libpcap_stuff.c
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/ioctl.h>
|
||||
-#include <net/bpf.h>
|
||||
+#include <pcap-bpf.h>
|
||||
#include <pcap.h>
|
||||
|
||||
#include "globals.h"
|
||||
diff --git a/script.c b/script.c
|
||||
index 124370c..6c5fb1e 100644
|
||||
--- a/script.c
|
||||
+++ b/script.c
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <sched.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
-#include <net/bpf.h>
|
||||
+#include <pcap-bpf.h>
|
||||
#include <pcap.h>
|
||||
|
||||
#include "release.h"
|
40
var/spack/repos/builtin/packages/hping/package.py
Normal file
40
var/spack/repos/builtin/packages/hping/package.py
Normal file
@ -0,0 +1,40 @@
|
||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack import *
|
||||
|
||||
|
||||
class Hping(AutotoolsPackage):
|
||||
"""hping is a command-line oriented TCP/IP packet assembler/analyzer."""
|
||||
|
||||
homepage = "http://www.hping.org"
|
||||
git = "https://github.com/antirez/hping.git"
|
||||
|
||||
version('master', commit='3547c7691742c6eaa31f8402e0ccbb81387c1b99')
|
||||
|
||||
patch('bpf.patch', sha256='99b9f91a308ffca306f69ccdb285e289ee3d280ec47ec7229e3a7669cca512f2')
|
||||
|
||||
depends_on('libpcap')
|
||||
depends_on('tcl')
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
env.set('TCLSH', self.spec['tcl'].prefix.bin.tclsh)
|
||||
|
||||
@run_before('configure')
|
||||
def filter_before_configure(self):
|
||||
makefileIn = FileFilter('Makefile.in')
|
||||
makefileIn.filter(r'/usr/sbin', self.prefix.sbin)
|
||||
configure = FileFilter('configure')
|
||||
configure.filter(r'/usr/local/include/tcl\${TCL_VER}',
|
||||
self.spec['tcl'].prefix.include)
|
||||
configure.filter(r'/usr/local/lib/',
|
||||
self.spec['tcl'].libs.directories[0])
|
||||
|
||||
def install(self, spec, prefix):
|
||||
mkdirp(prefix.sbin)
|
||||
make('install')
|
||||
|
||||
def setup_run_environment(self, env):
|
||||
env.prepend_path('PATH', self.prefix.sbin)
|
Loading…
Reference in New Issue
Block a user