diff options
author | Allen Zhong | 2015-06-08 17:28:12 +0800 |
---|---|---|
committer | Allen Zhong | 2015-06-08 17:28:12 +0800 |
commit | 14dd787cf713928940e257b12e41d8932b27cf62 (patch) | |
tree | bd5971c3a5e102fc9707af849d3fdfa73f1d28a5 | |
download | aur-14dd787cf713928940e257b12e41d8932b27cf62.tar.gz |
migrate from aur3: tsar-git 0.136.2683d6f-1
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | PKGBUILD | 47 | ||||
-rw-r--r-- | fix_apache_log.patch | 24 | ||||
-rw-r--r-- | fix_module_path.patch | 11 |
4 files changed, 102 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..9e6f50b25813 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = tsar-git + pkgdesc = Taobao System Activity Reporter + pkgver = 0.136.2683d6f + pkgrel = 1 + url = http://tsar.taobao.org/ + arch = i686 + arch = x86_64 + license = Apache + makedepends = git + depends = glibc + backup = etc/tsar/tsar.conf + source = git://github.com/alibaba/tsar.git + source = fix_module_path.patch + source = fix_apache_log.patch + sha1sums = SKIP + sha1sums = fcb802d50a4d374b05e9453e688ea6e9e5e40d4d + sha1sums = 3ad26fcbc9bcbb886caa58e3315eb02edb65534f + +pkgname = tsar-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..11c21972e0b1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: Allen Zhong <moeallenz@gmail.com> +# Contributor: Felix Yan <felixonmars@gmail.com> + +pkgname=tsar-git +_gitname=tsar +pkgver=0.136.2683d6f +pkgrel=1 +pkgdesc="Taobao System Activity Reporter" +arch=('i686' 'x86_64') +url="http://tsar.taobao.org/" +license=('Apache') +depends=('glibc') +makedepends=('git') +backup=('etc/tsar/tsar.conf') +source=("git://github.com/alibaba/$_gitname.git" + "fix_module_path.patch" + "fix_apache_log.patch") +sha1sums=('SKIP' + 'fcb802d50a4d374b05e9453e688ea6e9e5e40d4d' + '3ad26fcbc9bcbb886caa58e3315eb02edb65534f') + +pkgver() { + cd "$srcdir/$_gitname" + echo "0.$(git rev-list --count HEAD).$(git describe --always)" +} + +build() { + cd "$srcdir/${_gitname}" + patch -Np1 -i "$srcdir"/fix_module_path.patch + patch -Np1 -i "$srcdir"/fix_apache_log.patch + make # --prefix=/usr Not supported, WTF +} + +package() { + cd "$srcdir/${_gitname}" + + install -d "$pkgdir"/usr/lib/tsar/modules + cp modules/*.so "$pkgdir"/usr/lib/tsar/modules/ + + install -Dm755 src/tsar "$pkgdir"/usr/bin/tsar + + install -Dm644 conf/tsar.conf "$pkgdir"/etc/tsar/tsar.conf + install -Dm644 conf/tsar.logrotate "$pkgdir"/etc/logrotate.d/tsar + install -Dm644 conf/tsar.cron "$pkgdir"/etc/cron.d/tsar + + install -Dm644 conf/tsar.8 "$pkgdir"/usr/share/man/man8/tsar.8 +} diff --git a/fix_apache_log.patch b/fix_apache_log.patch new file mode 100644 index 000000000000..698a2d3db41c --- /dev/null +++ b/fix_apache_log.patch @@ -0,0 +1,24 @@ +diff -Npur a/include/define.h b/include/define.h +--- a/include/define.h 2014-05-08 15:24:57.000000000 +0800 ++++ b/include/define.h 2014-05-08 15:25:19.000000000 +0800 +@@ -71,7 +71,7 @@ + #define LOADAVG "/proc/loadavg" + #define NET_DEV "/proc/net/dev" + #define NET_SNMP "/proc/net/snmp" +-#define APACHERT "/tmp/apachert.mmap" ++#define APACHERT "/var/log/httpd/apachert.mmap" + #define TCP "/proc/net/tcp" + #define NETSTAT "/proc/net/netstat" + +diff -Npur a/include/public.h b/include/public.h +--- a/include/public.h 2014-05-08 15:24:52.000000000 +0800 ++++ b/include/public.h 2014-05-08 15:23:36.000000000 +0800 +@@ -35,7 +35,7 @@ + #define MEMINFO "/proc/meminfo" + #define LOADAVG "/proc/loadavg" + #define INTERRUPT "/proc/interrupts" +-#define APACHERT "/tmp/apachert.mmap" ++#define APACHERT "/var/log/httpd/apachert.mmap" + #define VMSTAT "/proc/vmstat" + #define DISKSTATS "/proc/diskstats" + #define NET_SNMP "/proc/net/snmp" diff --git a/fix_module_path.patch b/fix_module_path.patch new file mode 100644 index 000000000000..73fd6991cfc1 --- /dev/null +++ b/fix_module_path.patch @@ -0,0 +1,11 @@ +--- a/src/framework.c 2014-05-05 13:34:08.000000000 +0800 ++++ b/src/framework.c 2014-05-05 13:33:52.000000000 +0800 +@@ -55,7 +55,7 @@ + int (*mod_register) (struct module *); + + /* get the full path of modules */ +- sprintf(buff, "/usr/local/tsar/modules"); ++ sprintf(buff, "/usr/lib/tsar/modules"); + + for (i = 0; i < statis.total_mod_num; i++) { + mod = &mods[i]; |