diff options
author | Tony Lambiris | 2016-10-01 19:34:17 -0400 |
---|---|---|
committer | Tony Lambiris | 2016-10-01 19:34:17 -0400 |
commit | a993fb7afe12a54287aec6bb3b1e078d991401c6 (patch) | |
tree | 9358ef1028e9cfcb737c659cf97a7f7df3618467 | |
parent | 3ea621081afc1c35f7cf9013c985cafa518d52cf (diff) | |
download | aur-a993fb7afe12a54287aec6bb3b1e078d991401c6.tar.gz |
Update git version
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 86 | ||||
-rw-r--r-- | arch-linux.patch | 49 | ||||
-rw-r--r-- | osqueryd.conf.d | 2 | ||||
-rw-r--r-- | osqueryd.service | 8 |
5 files changed, 98 insertions, 55 deletions
@@ -1,6 +1,6 @@ pkgbase = osquery-git pkgdesc = SQL powered operating system instrumentation, monitoring, and analytics. - pkgver = 1.8.2.r12.g85ed298 + pkgver = 1.8.2.r172.g65f41d3 pkgrel = 1 url = https://osquery.io arch = any @@ -35,11 +35,13 @@ pkgbase = osquery-git depends = yara backup = etc/osquery/osquery.conf source = osquery-git::git+https://github.com/facebook/osquery + source = osqueryd.conf.d source = osqueryd.service source = arch-linux.patch sha256sums = SKIP - sha256sums = 1fa367325d4a7ad7dfef3b7b817b3c7588ad02a8d08fc11db24de66b486c6503 - sha256sums = 8fb9a37c2704647268e20ca6a8fd77b4866e054801cd2ab86362a2c028f03a8a + sha256sums = 3aea1799571f6ddab8d4c9820686fb64e7989e8121a98747a65326cd9f62f7e1 + sha256sums = 7b1082c9a74e11b02fa6d8410e987db64be2e097f84fcd346e7feef8c1e8a104 + sha256sums = b39fd6563f02bcade66a2cb30a410177a53eb415d49fc74745e6b1c2def56166 pkgname = osquery-git @@ -1,7 +1,7 @@ # Maintainer: Tony Lambiris <tony@criticalstack.com> pkgname=osquery-git -pkgver=1.8.2.r12.g85ed298 +pkgver=1.8.2.r172.g65f41d3 pkgrel=1 epoch= pkgdesc="SQL powered operating system instrumentation, monitoring, and analytics." @@ -10,10 +10,10 @@ url="https://osquery.io" license=('BSD') groups=() depends=('asio' 'audit' 'aws-sdk-cpp-git' 'boost' 'boost-libs' 'clang' 'cmake' - 'doxygen' 'gflags' 'git' 'google-glog' 'lsb-release' 'make' 'python' - 'python-jinja' 'python-pip' 'sleuthkit' 'snappy' 'thrift' 'yara') + 'doxygen' 'gflags' 'git' 'google-glog' 'lsb-release' 'make' 'python' + 'python-jinja' 'python-pip' 'sleuthkit' 'snappy' 'thrift' 'yara') makedepends=('python-jinja' 'python-psutil' 'python-pexpect' 'rocksdb-lite' - 'cpp-netlib' 'magic' 'unzip' 'wget') + 'cpp-netlib' 'magic' 'unzip' 'wget') checkdepends=() optdepends=() provides=() @@ -24,52 +24,74 @@ options=() install= changelog= source=("${pkgname}::git+https://github.com/facebook/osquery" - "osqueryd.service" - "arch-linux.patch") + "osqueryd.conf.d" + "osqueryd.service" + "arch-linux.patch") noextract=() validpgpkeys=() sha256sums=('SKIP' - '1fa367325d4a7ad7dfef3b7b817b3c7588ad02a8d08fc11db24de66b486c6503' - '8fb9a37c2704647268e20ca6a8fd77b4866e054801cd2ab86362a2c028f03a8a') + '3aea1799571f6ddab8d4c9820686fb64e7989e8121a98747a65326cd9f62f7e1' + '7b1082c9a74e11b02fa6d8410e987db64be2e097f84fcd346e7feef8c1e8a104' + 'b39fd6563f02bcade66a2cb30a410177a53eb415d49fc74745e6b1c2def56166') _gitname=${pkgname} -# last known working commit-ish -_githash=85ed298fb9b35b4e2c1d690f7b207dbe368c8735 -pkgver() { - cd $_gitname - - git describe --long --tags $_githash | sed 's/\([^-]*-g\)/r\1/;s/-/./g' -} +#pkgver() { +# cd $_gitname +# +# git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +#} prepare() { - cd $_gitname + cd $_gitname + + git reset HEAD --hard + git submodule update --init + + patch -p1 -i "${srcdir}/arch-linux.patch" + + find . -type f -name '*apt_sources*' -delete + find . -type f -name '*deb_package*' -delete + find . -type f -name '*rpm_package*' -delete - git reset HEAD --hard - git checkout $_githash - git submodule update --init - patch -p1 -i "${srcdir}/arch-linux.patch" + make deps } build() { - cd $_gitname + cd $_gitname - make deps - cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/usr - make -j $(nproc) + #SANITIZE_THREAD=True # Add -fsanitize=thread when using "make sanitize" + #OPTIMIZED=True # Enable specific CPU optimizations (not recommended) + #SKIP_TESTS=True # Skip unit test building (very very not recommended!) + #SKIP_BENCHMARKS=True # Build unit tests but skip building benchmark targets + #SKIP_TABLES=True # Build platform without any table implementations or specs + #SQLITE_DEBUG=True # Enable SQLite query debugging (very verbose!) + #export SKIP_TESTS=True SKIP_BENCHMARKS=True + + cmake -Wno-dev \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_VERBOSE_MAKEFILE=OFF + + make -j $(nproc) all } package() { - cd $_gitname + cd $_gitname + + make DESTDIR="${pkgdir}" install + + # Remove legacy init script + rm "${pkgdir}/etc/init.d/osqueryd" && rmdir "${pkgdir}/etc/init.d" - make DESTDIR="${pkgdir}" install + install -dm755 "${pkgdir}/var/osquery/" + install -dm755 "${pkgdir}/var/log/osquery/" - install -dm755 "${pkgdir}/var/osquery/" - install -dm755 "${pkgdir}/var/log/osquery/" + install -Dm644 "${srcdir}/osqueryd.conf.d" \ + "${pkgdir}/etc/conf.d/osqueryd" - install -Dm755 "${pkgdir}/usr/share/osquery/osquery.example.conf" \ - "${pkgdir}/etc/osquery/osquery.conf" + install -Dm644 "${srcdir}/osqueryd.service" \ + "${pkgdir}/usr/lib/systemd/system/osqueryd.service" - install -Dm755 "${srcdir}/osqueryd.service" \ - "${pkgdir}/usr/lib/systemd/system/osqueryd.service" + install -Dm644 "${pkgdir}/usr/share/osquery/osquery.example.conf" \ + "${pkgdir}/etc/osquery/osquery.conf" } diff --git a/arch-linux.patch b/arch-linux.patch index 4f755ff58c24..267f3f7c03b1 100644 --- a/arch-linux.patch +++ b/arch-linux.patch @@ -1,30 +1,45 @@ diff --git a/osquery/CMakeLists.txt b/osquery/CMakeLists.txt -index 444b018..97c1a14 100644 +index a2e5608..ad5ea6e 100644 --- a/osquery/CMakeLists.txt +++ b/osquery/CMakeLists.txt -@@ -55,9 +55,9 @@ ADD_OSQUERY_LINK_CORE("lz4") - ADD_OSQUERY_LINK_CORE("thrift") - ADD_OSQUERY_LINK_CORE("gflags") - ADD_OSQUERY_LINK_CORE("glog") --ADD_OSQUERY_LINK_CORE("boost_system-mt") --ADD_OSQUERY_LINK_CORE("boost_filesystem-mt") --ADD_OSQUERY_LINK_CORE("boost_regex-mt") -+ADD_OSQUERY_LINK_CORE("boost_system") -+ADD_OSQUERY_LINK_CORE("boost_filesystem") -+ADD_OSQUERY_LINK_CORE("boost_regex") - - # TODO(#1956): Ignoring on WIN32 for now - if(NOT WIN32) +@@ -45,9 +45,9 @@ if(WINDOWS) + else() + ADD_OSQUERY_LINK_CORE("libpthread") + ADD_OSQUERY_LINK_CORE("libz") +- ADD_OSQUERY_LINK_CORE("boost_system-mt") +- ADD_OSQUERY_LINK_CORE("boost_filesystem-mt") +- ADD_OSQUERY_LINK_CORE("boost_regex-mt") ++ ADD_OSQUERY_LINK_CORE("boost_system") ++ ADD_OSQUERY_LINK_CORE("boost_filesystem") ++ ADD_OSQUERY_LINK_CORE("boost_regex") + ADD_OSQUERY_LINK_CORE("rocksdb_lite") + ADD_OSQUERY_LINK_CORE("snappy") + ADD_OSQUERY_LINK_CORE("gflags") diff --git a/tools/provision.sh b/tools/provision.sh -index fc465d1..a66a7d4 100755 +index c363196..31019ff 100755 --- a/tools/provision.sh +++ b/tools/provision.sh -@@ -87,6 +87,8 @@ function main() { +@@ -83,6 +83,8 @@ function main() { log "your $OS does not use a provision script" fi - + + exit + # The dependency directory (DEPS_DIR) will contain our legacy runtime glibc # and various compilers/library dependencies. if [[ ! -d "$DEPS_DIR" ]]; then +diff --git a/osquery/tables/CMakeLists.txt b/osquery/tables/CMakeLists.txt +index c8fe70d..ae85ff4 100644 +--- a/osquery/tables/CMakeLists.txt ++++ b/osquery/tables/CMakeLists.txt +@@ -77,8 +77,8 @@ else() + ADD_OSQUERY_LINK_ADDITIONAL("magic") + ADD_OSQUERY_LINK_ADDITIONAL("tsk") + +- ADD_OSQUERY_LINK_ADDITIONAL("apt-pkg dpkg lzma lz4 bz2") +- ADD_OSQUERY_LINK_ADDITIONAL("rpm rpmio beecrypt popt db") ++ #ADD_OSQUERY_LINK_ADDITIONAL("apt-pkg dpkg lzma lz4 bz2") ++ #ADD_OSQUERY_LINK_ADDITIONAL("rpm rpmio beecrypt popt db") + endif() + + if(APPLE OR LINUX) diff --git a/osqueryd.conf.d b/osqueryd.conf.d new file mode 100644 index 000000000000..45f7dfdefba9 --- /dev/null +++ b/osqueryd.conf.d @@ -0,0 +1,2 @@ +FLAG_FILE="/etc/osquery/osquery.flags" +CONFIG_FILE="/etc/osquery/osquery.conf" diff --git a/osqueryd.service b/osqueryd.service index 29cedf8206f6..5258f6d199c1 100644 --- a/osqueryd.service +++ b/osqueryd.service @@ -4,12 +4,14 @@ After=network.service syslog.service [Service] TimeoutStartSec=0 -ExecStart=/usr/bin/osqueryd --config_path /etc/osquery/osquery.conf +EnvironmentFile=/etc/conf.d/osqueryd +ExecStartPre=/bin/sh -c "if [ ! -f $FLAG_FILE ]; then touch $FLAG_FILE; fi" +ExecStart=/usr/bin/osqueryd \ + --flagfile $FLAG_FILE \ + --config_path $CONFIG_FILE Restart=on-failure KillMode=process KillSignal=SIGTERM -SuccessExitStatus=143 -PIDFile=/var/osquery/osqueryd.pidfile [Install] WantedBy=multi-user.target |