mirror of
https://github.com/YunoHost-Apps/netdata_ynh.git
synced 2024-09-03 19:46:33 +02:00
Use equivs to install dependencies (closes #1)
This commit is contained in:
parent
94d287b05d
commit
5c06166851
6 changed files with 37 additions and 14 deletions
13
conf/netdata-deps.control
Normal file
13
conf/netdata-deps.control
Normal file
|
@ -0,0 +1,13 @@
|
|||
Section: misc
|
||||
Priority: optional
|
||||
Homepage: https://https://my-netdata.io/
|
||||
Standards-Version: 3.9.2
|
||||
|
||||
Package: netdata-deps
|
||||
Version: 1.5.0-1
|
||||
Depends: zlib1g-dev, uuid-dev, libmnl-dev, gcc, make, git, autoconf, autoconf-archive, autogen, automake, pkg-config, curl, jq, nodejs
|
||||
Architecture: all
|
||||
Description: meta package for NetData dependencies
|
||||
netdata is a system for distributed real-time performance and health monitoring. It provides unparalleled insights, in real-time, of everything happening on the system it runs (including applications such as web and database servers), using modern interactive web dashboards.
|
||||
.
|
||||
This meta-package is only responsible of installing its dependencies.
|
|
@ -9,6 +9,9 @@ VERSION="1.5.0"
|
|||
# Remote URL to fetch application source archive
|
||||
APPLICATION_SOURCE_URL="https://github.com/firehol/netdata/releases/download/v${VERSION}/netdata-${VERSION}.tar.gz"
|
||||
|
||||
# Package name for NetData dependencies
|
||||
DEPS_PKG_NAME="netdata-deps"
|
||||
|
||||
#
|
||||
# Common helpers
|
||||
#
|
||||
|
|
|
@ -9,6 +9,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
# Source local helpers
|
||||
source ./_common.sh
|
||||
|
||||
SRCPATH=$(pwd)
|
||||
|
||||
# Retrieve arguments
|
||||
|
@ -30,19 +31,22 @@ sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
|||
|| ynh_die "Path not available: ${domain}${path}"
|
||||
|
||||
# Download and extract application
|
||||
TMPDIR=$(extract_application)
|
||||
NETDATA_TMPDIR=$(extract_application)
|
||||
|
||||
# Install dependencies
|
||||
ynh_package_update
|
||||
ynh_package_install zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autoconf-archive autogen automake pkg-config curl jq nodejs
|
||||
ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control \
|
||||
|| ynh_die "Unable to install dependencies"
|
||||
|
||||
# Launch netdata installation in /opt directory
|
||||
cd $TMPDIR
|
||||
cd $NETDATA_TMPDIR
|
||||
sudo ./netdata-installer.sh --install /opt --dont-wait
|
||||
|
||||
# Store the uninstaller for the removal script
|
||||
sudo mv ./netdata-uninstaller.sh /opt/netdata/etc/netdata
|
||||
# Store the local helper for backup/restore scripts
|
||||
|
||||
# Store useful files for backup/restore scripts
|
||||
sudo cp $SRCPATH/_common.sh /opt/netdata/etc/netdata
|
||||
sudo cp $SRCPATH/../conf/netdata-deps.control /opt/netdata/etc/netdata
|
||||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
if [[ "$path" == "/" ]] ; then
|
||||
|
|
|
@ -9,6 +9,9 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
# Source YunoHost helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
# Source local helpers
|
||||
source ./_common.sh
|
||||
|
||||
# Retrieve app settings
|
||||
domain=$(ynh_app_setting_get "$app" domain)
|
||||
|
||||
|
@ -25,6 +28,9 @@ sudo sed -i "s/rm -I/rm -f/g" ${UNINSTALL_SCRIPT}
|
|||
# Execute the uninstall script
|
||||
sudo ./${UNINSTALL_SCRIPT} --force
|
||||
|
||||
# Remove app dependencies
|
||||
ynh_package_autoremove "$DEPS_PKG_NAME" || true
|
||||
|
||||
# Remove user and group
|
||||
sudo userdel netdata
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Note: each files and directories you've saved using the ynh_backup helper
|
||||
# will be located in the current directory, regarding the last argument.
|
||||
|
||||
# Exit on command errors and treat unset variables as an error
|
||||
set -eu
|
||||
|
||||
|
@ -27,14 +24,14 @@ sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
|||
|| ynh_die "Path not available: ${domain}${path}"
|
||||
|
||||
# Download and extract application
|
||||
TMPDIR=$(extract_application)
|
||||
NETDATA_TMPDIR=$(extract_application)
|
||||
|
||||
# Install dependencies
|
||||
ynh_package_update
|
||||
ynh_package_install zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autoconf-archive autogen automake pkg-config curl jq nodejs
|
||||
ynh_package_install_from_equivs ./conf/${DEPS_PKG_NAME}.control \
|
||||
|| ynh_die "Unable to install dependencies"
|
||||
|
||||
# Launch netdata installation in /opt directory
|
||||
cd $TMPDIR
|
||||
cd $NETDATA_TMPDIR
|
||||
sudo ./netdata-installer.sh --install /opt --dont-wait
|
||||
sudo mv ./netdata-uninstaller.sh /opt/netdata
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ is_public=$(ynh_app_setting_get "$app" is_public)
|
|||
path=$(fix_path $path)
|
||||
|
||||
# Download and extract application
|
||||
TMPDIR=$(extract_application)
|
||||
NETDATA_TMPDIR=$(extract_application)
|
||||
|
||||
# signal netdata to start saving its database
|
||||
# this is handy if your database is big
|
||||
|
@ -36,7 +36,7 @@ tmp=$(mktemp /tmp/netdata-updater-log-XXXXXX.log)
|
|||
exec 3>${tmp}
|
||||
|
||||
# Launch netdata installation in /opt directory
|
||||
cd $TMPDIR
|
||||
cd $NETDATA_TMPDIR
|
||||
sudo ./netdata-installer.sh --install /opt --dont-wait >&3 2>&3 || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
|
||||
# Store the uninstaller for the removal script
|
||||
sudo mv ./netdata-uninstaller.sh /opt/netdata/etc/netdata
|
||||
|
|
Loading…
Add table
Reference in a new issue