summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorchr0mag2018-01-23 19:17:49 -0800
committerchr0mag2018-01-23 19:17:49 -0800
commit0e16adff1d744cc58d73f2c2144327befec68bd2 (patch)
treec6d8d41a6908bfbf77c12d5eaeb34d27dcaab4c1
downloadaur-0e16adff1d744cc58d73f2c2144327befec68bd2.tar.gz
Initial sosreports PKGBIULD commit.
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD60
-rw-r--r--arch.py19
3 files changed, 102 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..6c1b721e833d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = sos
+ pkgdesc = A unified tool for collecting system logs and other debug information
+ pkgver = 3.5
+ pkgrel = 1
+ url = https://github.com/sosreport/sos
+ arch = any
+ license = GPL2
+ makedepends = python-sphinx
+ depends = python
+ depends = python-six
+ depends = python-lxml
+ depends = xz
+ depends = tar
+ backup = etc/sos.conf
+ source = https://github.com/sosreport/sos/archive/3.5.tar.gz
+ source = https://github.com/sosreport/sos/commit/0b30e8f72c3c669455209d15b1eb01de20c7d578.patch
+ source = arch.py
+ sha256sums = f62df231dd3c86a54645989f943bac6f5fdf45ffb210f4b76b4a5cc565296902
+ sha256sums = acf581080bad7772f10e183d18a2d1c2cf9bd9be91ee490e38ef5c5647859d6c
+ sha256sums = 281c8911687c2485b97db4891fd76f5d6e7071e7eebebeea5805edc77371de7b
+
+pkgname = sos
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..4ea61399a8e3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,60 @@
+# Maintainer: chr0mag <phillips.julian AT gmail DOT com>
+pkgname=sos
+pkgver=3.5
+pkgrel=1
+epoch=
+pkgdesc="A unified tool for collecting system logs and other debug information"
+arch=('any')
+url="https://github.com/sosreport/sos"
+license=('GPL2')
+groups=()
+depends=('python'
+ 'python-six'
+ 'python-lxml'
+ 'xz'
+ 'tar')
+makedepends=('python-sphinx')
+checkdepends=()
+optdepends=()
+provides=()
+conflicts=()
+replaces=()
+backup=('etc/sos.conf')
+options=()
+install=
+changelog=
+_urlparsefix="0b30e8f72c3c669455209d15b1eb01de20c7d578.patch"
+source=("https://github.com/sosreport/sos/archive/$pkgver.tar.gz" "https://github.com/sosreport/sos/commit/$_urlparsefix" "arch.py")
+noextract=()
+md5sums=()
+sha256sums=('f62df231dd3c86a54645989f943bac6f5fdf45ffb210f4b76b4a5cc565296902'
+ 'acf581080bad7772f10e183d18a2d1c2cf9bd9be91ee490e38ef5c5647859d6c'
+ '281c8911687c2485b97db4891fd76f5d6e7071e7eebebeea5805edc77371de7b')
+validpgpkeys=()
+
+prepare() {
+ cd "$pkgname-$pkgver"
+ patch sos/plugins/haproxy.py < ../../$_urlparsefix
+}
+
+build() {
+ cd "$pkgname-$pkgver"
+ make build
+}
+
+check() {
+ cd "$pkgname-$pkgver"
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir/" install
+ #put binary in /usr/bin instead of /usr/sbin
+ mkdir ${pkgdir}/usr/bin
+ mv ${pkgdir}/usr/sbin/sosreport ${pkgdir}/usr/bin
+ rmdir ${pkgdir}/usr/sbin
+ #add basic Arch policy
+ cp ../../arch.py ${pkgdir}/usr/lib/python3.6/site-packages/sos/policies
+ #disable plugins that cause issues
+ sed --in-place 's/#disable = rpm, selinux, dovecot/disable = rpm, selinux, dovecot, sunrpc, nfsserver, distupgrade/' ${pkgdir}/etc/sos.conf
+}
diff --git a/arch.py b/arch.py
new file mode 100644
index 000000000000..9299a04b2d32
--- /dev/null
+++ b/arch.py
@@ -0,0 +1,19 @@
+import os
+from sos.policies import PackageManager, LinuxPolicy
+from sos.plugins import Plugin
+
+class ArchPolicy(LinuxPolicy):
+
+ distro = "Arch Linux"
+ vendor = "Arch Linux"
+ vendor_url = "https://www.archlinux.org/"
+ vendor_text = ""
+ package_manager = PackageManager("pacman --query | awk 'BEGIN {OFS = \"|\"} {print $1,$2}'")
+ valid_subclasses = [Plugin]
+
+ @classmethod
+ def check(cls):
+ try:
+ return "archlinux" in open('/etc/os-release', 'r').read()
+ except:
+ return False