summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD33
2 files changed, 50 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..3569786fd4c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = ipset-china-ipv4-git
+ pkgdesc = ipset for matching China Mainland ipv4 network addresses
+ pkgver = 0.1
+ pkgrel = 2
+ arch = any
+ license = GPL3
+ makedepends = git
+ makedepends = zstd
+ depends = ipset
+ optdepends = ipset-loader: load this ipset
+ provides = ipset-china-ipv4
+ conflicts = ipset-china-ipv4
+ source = https://github.com/Hackl0us/GeoIP2-CN/raw/release/CN-ip-cidr.txt
+ sha512sums = SKIP
+
+pkgname = ipset-china-ipv4-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..c098bb11a05
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,33 @@
+# Maintainer: DuckSoft <realducksoft@gmail.com>
+
+pkgname=ipset-china-ipv4-git
+pkgver=0.1
+pkgrel=2
+pkgdesc="ipset for matching China Mainland ipv4 network addresses"
+arch=(any)
+license=(GPL3)
+depends=(ipset)
+makedepends=(git zstd)
+optdepends=('ipset-loader: load this ipset')
+provides=(ipset-china-ipv4)
+conflicts=(ipset-china-ipv4)
+source=("https://github.com/Hackl0us/GeoIP2-CN/raw/release/CN-ip-cidr.txt")
+sha512sums=(SKIP)
+
+prepare() {
+ # Strip Empty Lines
+ cd $srcdir
+ sed -i '/^[[:space:]]*$/d' CN-ip-cidr.txt
+}
+
+build() {
+ cd $srcdir
+ echo create china-ipv4 hash:net family inet maxelem `cat CN-ip-cidr.txt | wc -l` > china-ipv4
+ cat CN-ip-cidr.txt | sed 's/^/add china-ipv4 /g' >> china-ipv4
+}
+
+package() {
+ cd $srcdir
+ zstd --ultra -f -22 china-ipv4
+ install -Dm644 china-ipv4.zst -t "$pkgdir"/usr/share/ipset/
+}