summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorleetking2019-05-02 21:37:28 +0800
committerleetking2019-05-02 22:08:08 +0800
commita3b131108a8549c9479f808b7cb88ab817b7693c (patch)
treef83006ebad84fd8809e5dd64701cb06085d21d85
downloadaur-a3b131108a8549c9479f808b7cb88ab817b7693c.tar.gz
Initial commit
-rw-r--r--.SRCINFO17
-rw-r--r--.gitignore2
-rw-r--r--PKGBUILD51
-rw-r--r--fix-log-path.patch17
4 files changed, 87 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..f5401a20cdbf
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = intercept-git
+ pkgdesc = An auxiliary tool for tcpcopy and tcpburn.
+ pkgver = 1.0.0.r9.g185c3b8
+ pkgrel = 1
+ url = https://github.com/session-replay-tools/intercept.git
+ arch = x86_64
+ license = BSD
+ makedepends = git
+ provides = intercept
+ options = strip
+ source = intercept::git+https://github.com/session-replay-tools/intercept.git
+ source = fix-log-path.patch
+ sha256sums = SKIP
+ sha256sums = dd127920ffe56ea944ca048fe66ed1d75023ba66c0f5a316e3a2f0b3bcd4ab45
+
+pkgname = intercept-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..46045221b0c7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.tar.xz
+intercept/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6d27bc6c025b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,51 @@
+# Maintainer: leetking <li_tking@163.com>
+
+pkgname=intercept-git
+_pkgname=intercept
+pkgver=1.0.0.r9.g185c3b8
+pkgrel=1
+pkgdesc="An auxiliary tool for tcpcopy and tcpburn."
+arch=('x86_64')
+url="https://github.com/session-replay-tools/intercept.git"
+license=('BSD')
+makedepends=('git')
+provides=($_pkgname)
+options=('strip')
+source=("$_pkgname::git+$url"
+ "fix-log-path.patch")
+sha256sums=('SKIP'
+ 'dd127920ffe56ea944ca048fe66ed1d75023ba66c0f5a316e3a2f0b3bcd4ab45')
+
+pkgver() {
+ cd "${_pkgname}"
+ ( set -o pipefail
+ git describe --tags --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' \
+ || printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ )
+}
+
+
+prepare() {
+ cd "$_pkgname"
+ git apply "$srcdir/fix-log-path.patch"
+}
+
+build() {
+ cd "$_pkgname"
+ ./configure \
+ --prefix=/usr \
+ --conf-path=/etc/$_pkgname/$_pkgname.conf \
+ --sbin-path=/usr/bin/$_pkgname \
+ --pid-path=/run/$_pkgname/$_pkgname.pid \
+ --error-log-path=/var/log/$_pkgname.log
+ make
+}
+
+package() {
+ cd "$_pkgname"
+ make DESTDIR="$pkgdir/" install
+
+ # install license
+ mkdir -p "$pkgdir/usr/share/licenses/$_pkgname"
+ cp LICENSE "$pkgdir/usr/share/licenses/$_pkgname"
+}
diff --git a/fix-log-path.patch b/fix-log-path.patch
new file mode 100644
index 000000000000..a38842698672
--- /dev/null
+++ b/fix-log-path.patch
@@ -0,0 +1,17 @@
+diff --git a/src/core/tc_log.c b/src/core/tc_log.c
+index 472587d..dad2537 100644
+--- a/src/core/tc_log.c
++++ b/src/core/tc_log.c
+@@ -69,6 +69,12 @@ tc_log_init(const char *file)
+ return -1;
+ }
+ strncpy(default_file_path, TC_PREFIX, len);
++
++ /* absolute path */
++ if ('/' == TC_ERROR_LOG_PATH[0]) {
++ len = 0;
++ }
++
+ p = default_file_path + len;
+ len += strlen(TC_ERROR_LOG_PATH);
+ if (len >= 256) {