From 02f1afcf74044f73f83d1738918aae9c64481be9 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sat, 10 May 2025 15:48:53 +0300 Subject: [PATCH] Add license --- check-version.sh | 24 ++++++++++++++++++++++++ pkg.info | 3 ++- source.sh | 3 +++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 check-version.sh diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..ec03165 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Webpage URL +URL="https://www.kernel.org/pub/software/network/ethtool/" + +# Cell to extract +ROW=2 +COLUMN=1 + +# Get HTML table from webpage +HTML_TABLE=$(curl -s -L "$URL" | sed -n -e '//,/<\/table>/ p' | sed -e 's/^[ \t]*//') + +# Get row from $HTML_TABLE +ROW_START=$(echo "$HTML_TABLE" | grep -n -m$ROW '' | tail -n1 | cut -d':' -f1) +ROW_END=$(echo "$HTML_TABLE" | grep -n -m$ROW '' | tail -n1 | cut -d':' -f1) +HTML_ROW=$(echo "$HTML_TABLE" | sed "$ROW_START,$ROW_END !d") + +# Get column from $HTML_ROW +HTML_COLUMN=$(echo "$HTML_ROW" | grep -m$COLUMN '^
' | tail -n1) + +# Get version by removing HTML tags from $HTML_COLUMN +VERSION=$(echo "$HTML_COLUMN" | sed 's|<[^>]*>||g') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info index 536cf73..53815c4 100644 --- a/pkg.info +++ b/pkg.info @@ -1,8 +1,9 @@ name: ethtool description: Utility for controlling network drivers and hardware version: 6.10 +revision: 2 url: https://www.kernel.org/pub/software/network/ethtool/ -license: GPL +license: GPL2-only architecture: any depends: ["glibc","libmnl"] type: source diff --git a/source.sh b/source.sh index f17fa31..33df895 100644 --- a/source.sh +++ b/source.sh @@ -29,4 +29,7 @@ check() { # This function is used to move the compiled files into the output directory package() { make DESTDIR="$BPM_OUTPUT" install + + # Install package licenses + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/ethtool/COPYING }