new package: ipv6calc

This commit is contained in:
Tee KOBAYASHI 2022-03-17 15:40:24 +09:00 committed by xtkoba
parent bf466ec018
commit 5b5d657a89
4 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,20 @@
TERMUX_PKG_HOMEPAGE=https://www.deepspace6.net/projects/ipv6calc.html
TERMUX_PKG_DESCRIPTION="Does some format changes and calculations of IPv6 addresses"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=4.0.1
TERMUX_PKG_SRCURL=https://github.com/pbiering/ipv6calc/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=0de7dbe66c0e3602becc18bb8f69a278a02eeaf5d58779cd1c0e0069eb80a7e6
TERMUX_PKG_DEPENDS="openssl, perl"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--with-external-db=$TERMUX_PREFIX/share/ipv6calc/db
--with-dbip-db=$TERMUX_PREFIX/share/DBIP
--with-ip2location-db=$TERMUX_PREFIX/share/IP2Location
"
TERMUX_PKG_EXTRA_MAKE_ARGS="exec_prefix=$TERMUX_PREFIX"
termux_step_pre_configure() {
CFLAGS+=" $CPPFLAGS"
LDFLAGS+=" -lcrypto"
}

View File

@ -0,0 +1,10 @@
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -115,7 +115,6 @@
echo "Install shared library"
mkdir -p $(DESTDIR)$(libdir)
install -m 755 libipv6calc.so.@PACKAGE_VERSION@ $(DESTDIR)$(libdir)
- /sbin/ldconfig -n $(DESTDIR)$(libdir)
else
echo "Nothing to do (shared library mode is not enabled)"
endif

View File

@ -0,0 +1,29 @@
--- a/tools/ipv6calc-create-update-ipset.sh
+++ b/tools/ipv6calc-create-update-ipset.sh
@@ -271,7 +271,7 @@
return 4
else
# create temporary file
- commandfile=$(mktemp /tmp/ipset-$list-$setname.XXXXX)
+ commandfile=$(mktemp @TERMUX_PREFIX@/tmp/ipset-$list-$setname.XXXXX)
if [ -z "$commandfile" ]; then
echo "ERROR : can't create temporary command file"
return 2
@@ -296,7 +296,7 @@
# update entries of an ipset (firewalld)
# rc: 0=ok 1=nothingtodo 4=dryrun 3=error 2=fatal
ipset_update_entries_firewalld() {
- local add_entries_file=$(mktemp /tmp/ipset-firewalld-add-$list-$setname.XXXXX)
+ local add_entries_file=$(mktemp @TERMUX_PREFIX@/tmp/ipset-firewalld-add-$list-$setname.XXXXX)
if [ -z "$add_entries_file" ]; then
echo "ERROR : can't create temporary file containing entries to add"
return 2
@@ -310,7 +310,7 @@
fi
done
- local del_entries_file=$(mktemp /tmp/ipset-firewalld-remove-$list-$setname.XXXXX)
+ local del_entries_file=$(mktemp @TERMUX_PREFIX@/tmp/ipset-firewalld-remove-$list-$setname.XXXXX)
if [ -z "$del_entries_file" ]; then
echo "ERROR : can't create temporary file containing entries to remove"
return 2

View File

@ -0,0 +1,17 @@
--- a/tools/ipv6calc-db-update.sh.in
+++ b/tools/ipv6calc-db-update.sh.in
@@ -12,10 +12,10 @@
[ -z "$IPV6CALC_DAT_DIR" -a -n "$IPV6CALC_DB_EXTERNAL_DIR" ] && IPV6CALC_DAT_DIR="$IPV6CALC_DB_EXTERNAL_DIR"
[ -z "$IPV6CALC_DAT_DIR" ] && IPV6CALC_DAT_DIR="$IPV6CALC_DAT_DIR_DEFAULT"
-IPV6CALC_UPDATE_LIST="./ipv6calc-update-registries.sh /usr/share/ipv6calc/tools/ipv6calc-update-registries.sh"
-IPV6CALC_CHECK_LIST="./ipv6calc-registries-check-run-create.sh /usr/share/ipv6calc/tools/ipv6calc-registries-check-run-create.sh"
-IPV6CALC_CREATE_IPV4_LIST="./ipv6calc-create-registry-list-ipv4.pl /usr/share/ipv6calc/tools/ipv6calc-create-registry-list-ipv4.pl"
-IPV6CALC_CREATE_IPV6_LIST="./ipv6calc-create-registry-list-ipv6.pl /usr/share/ipv6calc/tools/ipv6calc-create-registry-list-ipv6.pl"
+IPV6CALC_UPDATE_LIST="./ipv6calc-update-registries.sh @TERMUX_PREFIX@/share/ipv6calc/tools/ipv6calc-update-registries.sh"
+IPV6CALC_CHECK_LIST="./ipv6calc-registries-check-run-create.sh @TERMUX_PREFIX@/share/ipv6calc/tools/ipv6calc-registries-check-run-create.sh"
+IPV6CALC_CREATE_IPV4_LIST="./ipv6calc-create-registry-list-ipv4.pl @TERMUX_PREFIX@/share/ipv6calc/tools/ipv6calc-create-registry-list-ipv4.pl"
+IPV6CALC_CREATE_IPV6_LIST="./ipv6calc-create-registry-list-ipv6.pl @TERMUX_PREFIX@/share/ipv6calc/tools/ipv6calc-create-registry-list-ipv6.pl"
help() {