diff options
author | Adrian Bacircea | 2019-12-21 15:39:34 +0200 |
---|---|---|
committer | Adrian Bacircea | 2019-12-21 15:39:34 +0200 |
commit | 14ff994e5c12dc10604bb7fc99dfb8fa6bc1dfe7 (patch) | |
tree | 64ccf67872870aae19c1fd059ad046fab77d0daf | |
parent | e0d00c66d6b6f8c1701904d6a2ffe724410b6d3b (diff) | |
download | aur-14ff994e5c12dc10604bb7fc99dfb8fa6bc1dfe7.tar.gz |
Rewrite package to use github libbpf
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | 0001-Fix-Makefile-to-always-link-libelf-even-if-not-used.patch | 30 | ||||
-rw-r--r-- | LICENSE | 1 | ||||
-rw-r--r-- | LICENSE.BSD-2-Clause | 32 | ||||
-rw-r--r-- | PKGBUILD | 34 |
5 files changed, 96 insertions, 21 deletions
@@ -1,19 +1,21 @@ pkgbase = libbpf pkgdesc = BPF library - pkgver = 5.3.7 + pkgver = 0.0.4 pkgrel = 1 - url = https://github.com/torvalds/linux/tree/master/tools/lib/bpf + url = https://github.com/libbpf/libbpf arch = x86_64 - license = LGPL2.1 + license = custom makedepends = rsync depends = libelf - provides = libbpf - source = https://mirrors.kernel.org/pub/linux/kernel/v5.x/linux-5.3.7.tar.xz - source = https://mirrors.kernel.org/pub/linux/kernel/v5.x/linux-5.3.7.tar.sign - validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886 - validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E - sha256sums = c6c9714e21531c825c306b107bc6f6c7bfa2d5270a14bad170f8de5a73d34802 + depends = linux-api-headers + source = git+https://github.com/libbpf/libbpf#tag=v0.0.4 + source = LICENSE + source = LICENSE.BSD-2-Clause + source = 0001-Fix-Makefile-to-always-link-libelf-even-if-not-used.patch sha256sums = SKIP + sha256sums = 847f4addbd56e2d5be20c4ea0845e972672fc07b755fadaae5f7abd35d71e349 + sha256sums = 6313108c23efffa36948f8b2cff1560a5935373b527b0e1a837cc77e6ed1bacd + sha256sums = 7c4099472757d082f56a546f6d08a2418262f08e289b6b65e8fbbe33f9ddc2c3 pkgname = libbpf diff --git a/0001-Fix-Makefile-to-always-link-libelf-even-if-not-used.patch b/0001-Fix-Makefile-to-always-link-libelf-even-if-not-used.patch new file mode 100644 index 000000000000..745b13b5570f --- /dev/null +++ b/0001-Fix-Makefile-to-always-link-libelf-even-if-not-used.patch @@ -0,0 +1,30 @@ +From d9571801ee98f1355746865d78bdb30682fcd318 Mon Sep 17 00:00:00 2001 +From: Adrian Bacircea <adrian.b.enthropy@gmail.com> +Date: Sat, 21 Dec 2019 15:35:13 +0200 +Subject: [PATCH] Fix Makefile to always link libelf even if not used + +--- + src/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index 4a558b4..d2a297c 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -24,11 +24,11 @@ CFLAGS ?= -g -O2 -Werror -Wall + ALL_CFLAGS += $(CFLAGS) + ALL_LDFLAGS += $(LDFLAGS) + ifdef NO_PKG_CONFIG +- ALL_LDFLAGS += -lelf ++ ALL_LDFLAGS += -Wl,--push-state,--no-as-needed -lelf -Wl,--pop-state + else + PKG_CONFIG ?= pkg-config + ALL_CFLAGS += $(shell $(PKG_CONFIG) --cflags libelf) +- ALL_LDFLAGS += $(shell $(PKG_CONFIG) --libs libelf) ++ ALL_LDFLAGS += -Wl,--push-state,--no-as-needed $(shell $(PKG_CONFIG) --libs libelf) -Wl,--pop-state + endif + + OBJDIR ?= . +-- +2.24.1 + diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..d38fed3cd0c4 --- /dev/null +++ b/LICENSE @@ -0,0 +1 @@ +LGPL-2.1 OR BSD-2-Clause diff --git a/LICENSE.BSD-2-Clause b/LICENSE.BSD-2-Clause new file mode 100644 index 000000000000..da366e2ce50b --- /dev/null +++ b/LICENSE.BSD-2-Clause @@ -0,0 +1,32 @@ +Valid-License-Identifier: BSD-2-Clause +SPDX-URL: https://spdx.org/licenses/BSD-2-Clause.html +Usage-Guide: + To use the BSD 2-clause "Simplified" License put the following SPDX + tag/value pair into a comment according to the placement guidelines in + the licensing rules documentation: + SPDX-License-Identifier: BSD-2-Clause +License-Text: + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. @@ -1,29 +1,39 @@ # Maintainer: Adrian Bacircea <adrian.bacircea@gmail.com> pkgname=libbpf -pkgver=5.3.7 +pkgver=0.0.4 pkgrel=1 pkgdesc='BPF library' -depends=('libelf') -url='https://github.com/torvalds/linux/tree/master/tools/lib/bpf' -license=('LGPL2.1') +depends=('libelf' 'linux-api-headers') +url='https://github.com/libbpf/libbpf' +license=('custom') makedepends=('rsync') arch=('x86_64') -provides=('libbpf') -source=(https://mirrors.kernel.org/pub/linux/kernel/v${pkgver:0:1}.x/linux-${pkgver}.tar.{xz,sign}) -sha256sums=('c6c9714e21531c825c306b107bc6f6c7bfa2d5270a14bad170f8de5a73d34802' - 'SKIP') -validpgpkeys=('ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds - '647F28654894E3BD457199BE38DBBDC86092693E') # Greg Kroah-Hartman +source=("git+https://github.com/libbpf/libbpf#tag=v0.0.4" + "LICENSE" + "LICENSE.BSD-2-Clause" + "0001-Fix-Makefile-to-always-link-libelf-even-if-not-used.patch") +sha256sums=('SKIP' + '847f4addbd56e2d5be20c4ea0845e972672fc07b755fadaae5f7abd35d71e349' + '6313108c23efffa36948f8b2cff1560a5935373b527b0e1a837cc77e6ed1bacd' + '7c4099472757d082f56a546f6d08a2418262f08e289b6b65e8fbbe33f9ddc2c3') + +prepare () { + cd "${srcdir}/${pkgname}" + patch -p1 < "${srcdir}/0001-Fix-Makefile-to-always-link-libelf-even-if-not-used.patch" +} build() { - cd "linux-$pkgver/tools/lib/bpf" + cd "${srcdir}/${pkgname}/src" make } package() { - cd "linux-$pkgver/tools/lib/bpf" + cd "${srcdir}/${pkgname}/src" DESTDIR="${pkgdir}" make prefix=/usr install install_headers + install -d "${pkgdir}/usr/share/licenses/${pkgname}" + install -t "${pkgdir}/usr/share/licenses/${pkgname}" "${srcdir}/LICENSE" + install -t "${pkgdir}/usr/share/licenses/${pkgname}" "${srcdir}/LICENSE.BSD-2-Clause" pushd "${pkgdir}/usr" mv lib64 lib popd |