diff options
-rw-r--r-- | .SRCINFO | 32 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile.patch | 58 | ||||
-rw-r--r-- | PKGBUILD | 131 |
4 files changed, 222 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..44bf98f78899 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,32 @@ +pkgbase = solar_capture + pkgdesc = A set of tools for capturing, timestamping, processing, and injecting network traffic. + pkgver = 1.3.1.11 + pkgrel = 1 + url = http://www.solarflare.com/SolarCapture-Packet-Capture-Software + arch = x86_64 + license = custom + makedepends = rpmextract + makedepends = openonload + makedepends = python2 + makedepends = libaio + makedepends = libpcap + makedepends = findutils + depends = openonload + depends = sfptpd + depends = libpcap + depends = python2 + depends = libaio + options = !libtool + options = !strip + options = !makeflags + options = !buildflags + options = staticlibs + source = http://127.0.0.1/SF-111817-DH-9_(SF-112972-LS-2)_SolarCapture_SDK.zip + source = http://127.0.0.1/SF-111817-DH-9_(SF-112974-LS-2)_SolarCapture_Live_Pro_RPMs.zip + source = http://127.0.0.1/SF-111817-DH-9_(SF-108469-CD-9)_SolarCapture_User_Guide.pdf + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + +pkgname = solar_capture + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..5da107ea9a0f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SF-* diff --git a/Makefile.patch b/Makefile.patch new file mode 100644 index 000000000000..d7c70c10fdd2 --- /dev/null +++ b/Makefile.patch @@ -0,0 +1,58 @@ +--- Makefile.orig 2014-06-25 09:49:27.890282195 -0400 ++++ Makefile 2014-06-25 09:55:08.418251742 -0400 +@@ -34,6 +34,17 @@ + # SC_VER_EXTRA is used for things like release candidates, and is written + # by the packaging script. It does not contribute to the library + # versioning, so releases must never set SC_VER_EXTRA. ++# ++# SC_INCLUDE is used to specify a custom header file path (for package ++# maintainers). ++# ++# SC_LIBRARY is used to specify a custom library path (for package ++# maintainers). ++# ++# SC_PYTHON is used to specify a custom python 2.x binary path. ++# SC_PYTHON_CONFIG is used to specify a custom python 2.x -config ++# binary path. ++ + + SC_VER_MAJ := 1 + SC_VER_MIN := 2 +@@ -70,10 +81,16 @@ SC_BUILD := $(shell /bin/pwd) + SC_LIB := lib + SC_LIB_DBG := lib/debug + SC_INC := -Iinclude ++ifdef SC_INCLUDE ++SC_INC += -I$(SC_INCLUDE) ++endif + ifndef SC_RPM_BUILD + SC_LINK := -L$(SC_LIB) -Wl,-rpath,$(SC_BUILD)/$(SC_LIB) \ + -Wl,--enable-new-dtags + endif ++ifdef SC_LIBRARY ++SC_LINK += -L$(SC_LIBRARY) ++endif + SC_LINK += -lsolarcapture$(SC_VER_MAJ) + + CWARNINGS := -Wall -Wundef -Wstrict-prototypes -Wpointer-arith \ +@@ -120,10 +137,17 @@ BUILTIN_OBJS := components/sc_writer.o + CORE_DBG_OBJS := $(patsubst %.o,%.dbg.o,$(CORE_OBJS)) + BUILTIN_DBG_OBJS:= $(patsubst %.o,%.dbg.o,$(BUILTIN_OBJS)) + +-PYTHON_CFLAGS := $(shell python-config --cflags 2>/dev/null) +-PYTHON_LIBS := $(shell python-config --libs 2>/dev/null) ++ifndef SC_PYTHON ++SC_PYTHON := python ++endif ++ifndef SC_PYTHON_CONFIG ++SC_PYTHON := python-config ++endif ++ ++PYTHON_CFLAGS := $(shell $(SC_PYTHON_CONFIG) --cflags 2>/dev/null) ++PYTHON_LIBS := $(shell $(SC_PYTHON_CONFIG) --libs 2>/dev/null) + ifeq ($(PYTHON_CFLAGS),) +-PYTHON_VER := $(shell python -V 2>&1 | \ ++PYTHON_VER := $(shell $(SC_PYTHON) -V 2>&1 | \ + sed 's/Python \([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') + PYTHON_CFLAGS := -fno-strict-aliasing -fPIC \ + -I/usr/include/python$(PYTHON_VER) diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a7806fc727a4 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,131 @@ +# $Id: 7d79bb74ac202ea9fcb2da4914790ab5e17056ba $ +# Maintainer: Ido Rosen <ido@kernel.org> +# +# NOTE: To request changes to this package, please submit a pull request +# to the GitHub repository at https://github.com/ido/packages-archlinux +# Otherwise, open a GitHub issue. Thank you! -Ido +# +# From the Solarflare Support website, http://support.solarflare.com/ : +# ``SolarCapture is a set of tools for capturing, timestamping, processing +# and injecting network traffic. SolarCapture is able to capture packets +# received from the network at very high rates, apply filtering in hardware +# and software, perform custom processing, and write packets to disk in PCAP +# format.'' (06/24/2014) + +pkgname='solar_capture' +pkgdesc="A set of tools for capturing, timestamping, processing, and injecting network traffic." +pkgver='1.3.1.11' +_kernelver="$(uname -r)" +_sfcrel='0' +pkgrel=1 +arch=('x86_64') +url='http://www.solarflare.com/SolarCapture-Packet-Capture-Software' +license=('custom') +depends=('openonload' 'sfptpd' 'libpcap' 'python2' 'libaio') +makedepends=('rpmextract' 'openonload' + 'python2' 'libaio' 'libpcap' 'findutils') +options=('!libtool' '!strip' '!makeflags' '!buildflags' 'staticlibs') +source=('http://127.0.0.1/SF-111817-DH-9_(SF-112972-LS-2)_SolarCapture_SDK.zip' + 'http://127.0.0.1/SF-111817-DH-9_(SF-112974-LS-2)_SolarCapture_Live_Pro_RPMs.zip' + 'http://127.0.0.1/SF-111817-DH-9_(SF-108469-CD-9)_SolarCapture_User_Guide.pdf') +sha512sums=('SKIP' + 'SKIP' + 'SKIP') +#install= +_python_sitelib="$(python2 -c 'from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())')" + +pkgver() { + cd "${srcdir}" + ls solar_capture-pro-*.x86_64.rpm | sed 's/^solar_capture-pro-\([0-9\.]*\)\(-[0-9]*\)\?.x86_64.rpm$/\1/' +} + +prepare() { + # SDK + rpmextract.sh ${srcdir}/${pkgname}-core-${pkgver}-${_sfcrel}.x86_64.rpm + rpmextract.sh ${srcdir}/${pkgname}-python-${pkgver}-${_sfcrel}.src.rpm + # Live + rpmextract.sh ${srcdir}/${pkgname}-live-${pkgver}-${_sfcrel}.x86_64.rpm + # Pro + rpmextract.sh ${srcdir}/${pkgname}-pro-${pkgver}-${_sfcrel}.x86_64.rpm + tar xvzf ${pkgname}-python-${pkgver}.tgz + sed -i '1 s/\bpython\b/python2/' "${srcdir}/usr/bin/solar_capture" + sed -i '1 s/\bpython\b/python2/' "${srcdir}/usr/bin/solar_replay" + sed -i '1 s/\bpython\b/python2/' "${srcdir}/${pkgname}-python-${pkgver}/src/solar_capture_monitor" + sed -i '1 s/\bpython\b/python2/' "${srcdir}/${pkgname}-python-${pkgver}/src/solar_capture_doc" +} + +build() { + case $CARCH in + "x86_64") + # x64 build + pushd ${pkgname}-python-${pkgver}/src + SC_LIBRARY=${srcdir}/usr/lib64 \ + SC_INCLUDE=${srcdir}/usr/include \ + SC_RPM_BUILD=1 \ + SC_PYTHON=python2 \ + SC_PYTHON_CONFIG=python2-config \ + make python/solar_capture_c.so + popd + ;; + *) + # unsupported + echo "Unsupported architecture." + exit 1 + ;; + esac +} + +package() { + cd "${srcdir}" + + mv "${srcdir}/usr" "${pkgdir}/." + + cd "${srcdir}/${pkgname}-python-${pkgver}" + + # Binaries: + install -dm755 "${pkgdir}/usr/bin" + install -m755 "src/solar_capture_monitor" "${pkgdir}/usr/bin" + install -m755 "src/solar_capture_doc" "${pkgdir}/usr/bin" + + # Python module: + install -dm755 "${pkgdir}/${_python_sitelib}/${pkgname}" + install -m644 "src/python/solar_capture_c.so" \ + "${pkgdir}/${_python_sitelib}/" + for i in __init__.py cli.py shm.py stats.py tabulate.py + do + install -m644 "src/python/${pkgname}/${i}" \ + "${pkgdir}/${_python_sitelib}/${pkgname}" + done + + # Documentation: + docdir="${pkgdir}/usr/share/doc/${pkgname}" + install -dm755 "${docdir}" + install -m644 docs/LICENSE.txt "${docdir}" + install -m644 docs/README "${docdir}" + install -m644 docs/ReleaseNotes "${docdir}" + install -m644 docs/ChangeLog "${docdir}" + install -m644 \ + "${srcdir}/SF-111817-DH-9_(SF-108469-CD-9)_SolarCapture_User_Guide.pdf" \ + "${docdir}" + install -dm755 "${docdir}/examples/c_api" + install -m 644 src/examples/c_api/* \ + "${docdir}/examples/c_api" + install -dm755 "${docdir}/examples/c_api_export" + install -m 644 src/examples/c_api_export/* \ + "${docdir}/examples/c_api_export" + install -dm755 "${docdir}/examples/extensions_api" + install -m 644 src/examples/extensions_api/* \ + "${docdir}/examples/" + install -dm755 "${docdir}/examples/unmanaged" + install -m 644 src/examples/unmanaged/* \ + "${docdir}/examples/unmanaged" + install -dm755 "${docdir}/examples/py_api" + install -m 644 src/examples/py_api/* \ + "${docdir}/examples/py_api" + + # Install LICENSE file: + install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}" + ln -s "/usr/share/doc/${pkgname}/LICENSE.txt" \ + "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + +} |