diff options
author | Chris. H | 2018-03-31 09:22:37 +0200 |
---|---|---|
committer | Chris. H | 2018-03-31 09:22:37 +0200 |
commit | 70ca1f660b76877bc20ec8173bdbf0a8d04d5d36 (patch) | |
tree | ae32c7e20e4bd4423737d644458e697a789759b8 | |
parent | 1a8615f42ce8226341b47731f21ed5e1e770e67e (diff) | |
download | aur-70ca1f660b76877bc20ec8173bdbf0a8d04d5d36.tar.gz |
switched location to /opt; run bundle install during build
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 27 | ||||
-rw-r--r-- | envizon.install | 20 |
3 files changed, 29 insertions, 20 deletions
@@ -1,6 +1,6 @@ pkgbase = envizon-git pkgdesc = network visualization tool with focus on red / blue team requirements - pkgver = 37.24d86d4 + pkgver = 38.810f89c pkgrel = 1 url = https://evait-security.github.io/envizon/ install = envizon.install @@ -2,7 +2,7 @@ pkgname='envizon-git' _pkgname='envizon' -pkgver=37.24d86d4 +pkgver=38.810f89c pkgrel=1 pkgdesc='network visualization tool with focus on red / blue team requirements' url='https://evait-security.github.io/envizon/' @@ -26,26 +26,33 @@ pkgver() { echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD) } -package() { - cd "$srcdir" +build() { + cd "$srcdir/${_pkgname}" + bundle config --local build.nokogiri --use-system-libraries + bundle install --path vendor/bundle --without development test -j"$(nproc)" --no-cache + mkdir -p .ssl +} +package() { mkdir -p "$pkgdir/usr/lib/sysusers.d/" \ "$pkgdir/usr/bin" \ - "$pkgdir/usr/share" + "$pkgdir/opt" install -m644 "${_pkgname}.sysusers.conf"\ "$pkgdir/usr/lib/sysusers.d/${_pkgname}.conf" - cp -ar "${_pkgname}" "$pkgdir/usr/share/${_pkgname}" - cp db_setup.sh "$pkgdir/usr/share/${_pkgname}/" - chmod +x "$pkgdir/usr/share/${_pkgname}/" + cp -ar "${_pkgname}" "$pkgdir/opt/${_pkgname}" + cp db_setup.sh "$pkgdir/opt/${_pkgname}/" + chmod +x "$pkgdir/opt/${_pkgname}/" + + rm -rf "$pkgdir/opt/${_pkgname}/docker" + rm -rf "$pkgdir/opt/${_pkgname}/.github" - rm -rf "$pkgdir/usr/share/${_pkgname}/docker" - rm -rf "$pkgdir/usr/share/${_pkgname}/.github" + chmod -R g+w "$pkgdir/opt/${_pkgname}" cat > "$pkgdir/usr/bin/${_pkgname}" << EOF #!/bin/sh -cd /usr/share/${_pkgname} +cd /opt/${_pkgname} export SECRET_KEY_BASE=\$(cat config/secret) RAILS_ENV=production export RAILS_ENV diff --git a/envizon.install b/envizon.install index 408c1abb3a36..ce03da2d4cf0 100644 --- a/envizon.install +++ b/envizon.install @@ -1,8 +1,5 @@ post_install() { - cd /usr/share/envizon || exit - bundle config --local build.nokogiri --use-system-libraries - bundle install --path vendor/bundle --without development test - mkdir -p .ssl + cd /opt/envizon || exit openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 \ -subj "/C=DE/ST=None/L=None/O=evait/CN=None" \ -keyout .ssl/localhost.key -out .ssl/localhost.crt @@ -13,18 +10,23 @@ post_install() { } post_upgrade() { + if [ -d /usr/share/envizon ]; then + echo ">> Found directory '/usr/share/envizon'. This might be left over" + echo ">> from a previous installation. You should check if you still need it," + echo ">> otherwise it can probably be removed." + fi post_group "$@" post_common "$@" } post_remove() { - rm -r /usr/share/envizon + rm -r /opt/envizon } post_group() { - chown -R :envizon /usr/share/envizon - chmod -R g+w /usr/share/envizon - chmod -R g+r /usr/share/envizon/.ssl + chown -R :envizon /opt/envizon + chmod -R g+w /opt/envizon + chmod -R g+r /opt/envizon/.ssl } post_common() { @@ -35,5 +37,5 @@ post_common() { echo '>> with '\''exec sg envizon newgrp `id -gn`'\''.' echo ">>" echo ">> A running and initialized PostgreSQL instance is required. If you haven't done so yet," - echo ">> run sudo -u postgres /usr/share/envizon/db_setup.sh to create a database and the database user." + echo ">> run sudo -u postgres /opt/envizon/db_setup.sh to create a database and the database user." } |