summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenry-ZHR2022-07-27 09:04:15 +0800
committerHenry-ZHR2022-07-27 09:04:15 +0800
commit9a6b53a71182c48e45b5056fd480afd0d48e81b8 (patch)
treeecc4b24acbad348df8af6e773db9c37603a19a3c
downloadaur-9a6b53a71182c48e45b5056fd480afd0d48e81b8.tar.gz
Init (v4.1.8)
-rw-r--r--.SRCINFO19
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD40
-rw-r--r--mosdns.service11
4 files changed, 75 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c42176b25197
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = mosdns
+ pkgdesc = A DNS forwarder
+ pkgver = 4.1.8
+ pkgrel = 1
+ url = https://github.com/IrineSistiana/mosdns
+ arch = x86_64
+ license = GPL3
+ makedepends = git
+ makedepends = go
+ depends = glibc
+ optdepends = v2ray-domain-list-community: geosite.dat
+ optdepends = v2ray-geoip: geoip.dat
+ backup = etc/mosdns/config.yaml
+ source = mosdns::git+https://github.com/IrineSistiana/mosdns.git#tag=a569c25fa92386dc762e78a38f0aee4237120938
+ source = mosdns.service
+ sha512sums = SKIP
+ sha512sums = c4defddfc87754b8dd105df080374ec32785c435b5a60fa60608e5e0b57eddd4aa6c5581daceba6dff6d84b8e0f4914db0ea09f0150aecee17e216379f7fcb62
+
+pkgname = mosdns
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..c55eb26e2d69
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+**/*
+!.SRCINFO
+!.gitignore
+!PKGBUILD
+!mosdns.service
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..da2156dde362
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: Henry-ZHR <henry-zhr@qq.com>
+pkgname=mosdns
+pkgver=4.1.8
+pkgrel=1
+pkgdesc="A DNS forwarder"
+arch=('x86_64')
+url="https://github.com/IrineSistiana/mosdns"
+license=('GPL3')
+depends=('glibc')
+makedepends=('git' 'go')
+optdepends=('v2ray-domain-list-community: geosite.dat'
+ 'v2ray-geoip: geoip.dat')
+backup=('etc/mosdns/config.yaml')
+_tag=a569c25fa92386dc762e78a38f0aee4237120938 # git rev-parse "v${pkgver}"
+source=("${pkgname}::git+${url}.git#tag=${_tag}"
+ "mosdns.service")
+sha512sums=('SKIP'
+ 'c4defddfc87754b8dd105df080374ec32785c435b5a60fa60608e5e0b57eddd4aa6c5581daceba6dff6d84b8e0f4914db0ea09f0150aecee17e216379f7fcb62')
+
+prepare() {
+ mkdir -p "${pkgname}/build"
+}
+
+build() {
+ cd "${pkgname}/build"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ go run ../ config gen config.yaml
+ go build -buildmode=pie -trimpath -ldflags="-linkmode external -s -w -X main.version=$(git describe --tags --long --always)" -mod=readonly -modcacherw -o mosdns ../
+}
+
+package() {
+ cd "${srcdir}/${pkgname}"
+ install -Dm755 "build/mosdns" "${pkgdir}/usr/bin/mosdns"
+ install -Dm644 "build/config.yaml" "${pkgdir}/etc/mosdns/config.yaml"
+ install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/mosdns/LICENSE"
+ install -Dm644 "${srcdir}/mosdns.service" "${pkgdir}/usr/lib/systemd/system/mosdns.service"
+}
diff --git a/mosdns.service b/mosdns.service
new file mode 100644
index 000000000000..dad2983c2e95
--- /dev/null
+++ b/mosdns.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=mosdns - A DNS forwarder
+After=network.target
+
+[Service]
+Type=exec
+ExecStart=/usr/bin/mosdns start -c /etc/mosdns/config.yaml -d /etc/mosdns
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target