Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
[Bugfix] deleted dependency of xtable*
Browse files Browse the repository at this point in the history
Signed-off-by: Alvaro Cano <alvaro.cano@zevenet.com>
  • Loading branch information
cano-devel committed Sep 11, 2019
1 parent a323237 commit 9cdb85f
Show file tree
Hide file tree
Showing 6 changed files with 252 additions and 0 deletions.
9 changes: 9 additions & 0 deletions DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: zevenet
Version: 5.9.2
Maintainer: Zevenet SL <zevenet-ce-users@zevenet.com>
Architecture: amd64
Section: admin
Priority: optional
Description: Zevenet Load Balancer Community Edition
Zevenet is a Multilayered Aplication Delivery Controller (ADC) and high performance load balancer whith an easy configuration, usability and user-friendly web GUI for layer 3, 4 and 7 networking management.
Depends: rrdtool, libnet-netmask-perl, libproc-daemon-perl, libnetwork-ipv4addr-perl, librrds-perl, libio-interface-perl, libdata-validate-ip-perl, libpcap0.8, ntpdate, libfile-grep-perl, iputils-arping, openssl, unzip, libev4, libjson-perl, libjson-xs-perl, libcgi-session-perl, libauthen-simple-perl, libauthen-simple-passwd-perl, conntrack, liburi-perl, libtimedate-perl, libconfig-tiny-perl, snmpd, libnet-ssleay-perl, libnetaddr-ip-perl, libswitch-perl, libcgi-simple-perl, libunix-syslog-perl, monitoring-plugins, monitoring-plugins-common, net-tools, cherokee, pound, libregexp-ipv6-perl, nftlb, curl
95 changes: 95 additions & 0 deletions DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/bin/bash
###############################################################################
#
# Zevenet Software License
# This file is part of the Zevenet Load Balancer software package.
#
# Copyright (C) 2014-today ZEVENET SL, Sevilla (Spain)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################

GLOBALCF="/usr/local/zevenet/config/global.conf"
GLOBALCFT="/usr/local/zevenet/share/global.conf.template"

[ ! "$1" == "configure" ] && echo "Installation aborted $1 $2" && exit 1
[ "$1" == "configure" ] && echo "Completing the Zevenet installation..."

# upgrading global.conf
/usr/local/zevenet/bin/checkglobalconf


# Enable root access through SSH
SSHDCONFIG="/etc/ssh/sshd_config"
if [[ `grep -c "^PermitRootLogin.*yes" $SSHDCONFIG` == '0' ]]; then
sed -i -e 's/^PermitRootLogin.*/PermitRootLogin yes/' $SSHDCONFIG
/etc/init.d/ssh reload 2> /dev/null
fi

# Disable services

# SNMP service
if [[ -f /etc/snmp/snmpd.conf && `grep -c '#zenlb' /etc/snmp/snmpd.conf` == '0' ]]; then
/etc/init.d/snmpd stop
update-rc.d snmpd disable
cp /usr/local/zevenet/share/snmpd.conf.template /etc/snmp/snmpd.conf
fi

# Disable SNMP debugging messages in log
if [[ `grep -c 'LSd' /etc/default/snmpd` == '1' ]]; then
sed -i -e 's/LSd/LS6d/' /etc/default/snmpd
fi

# Start ssh server after zevenet service
sed -i 's/^\# Required-Start:.*/# Required-Start:\t\$remote_fs \$syslog zevenet/g' /etc/init.d/ssh
sed -i 's/^\# Required-Stop:.*/# Required-Stop:\t\$remote_fs \$syslog zevenet/g' /etc/init.d/ssh

# Restore already existing zlb-stop and zlb-start
if [ -f /tmp/zlb-start ]; then
mv /tmp/zlb-start /usr/local/zevenet/config/
fi
if [ -f /tmp/zlb-stop ]; then
mv /tmp/zlb-stop /usr/local/zevenet/config/
fi

chmod +x /usr/local/zevenet/config/zlb-start
chmod +x /usr/local/zevenet/config/zlb-stop

# Install check_uplink
ZBIN_PATH="/usr/local/zevenet/bin"
LIBEXEC_PATH="/usr/lib/nagios/plugins"
if [ ! -L ${LIBEXEC_PATH}/check_uplink ]; then
ln -s ${ZBIN_PATH}/check_uplink ${LIBEXEC_PATH}/check_uplink
fi

# Restarting zevenet service
echo "Zevenet will be unavailable while the service is restarting."
/etc/init.d/zevenet stop
/etc/init.d/zevenet start

# Add Zevenet Load Balancer service to boot process
update-rc.d zevenet defaults

# Setup motd.tail
cp /etc/motd.tail /etc/motd

# Set the cron service
cp /usr/local/zevenet/share/zevenet.cron /etc/cron.d/zevenet
/etc/init.d/cron reload

# Change prompt color
sed -i "s/1;30m/0;37m/g" /etc/bash.bashrc 2> /dev/null

echo "Zevenet Load Balancer installation completed."
36 changes: 36 additions & 0 deletions DEBIAN/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
###############################################################################
#
# Zevenet Software License
# This file is part of the Zevenet Load Balancer software package.
#
# Copyright (C) 2014-today ZEVENET SL, Sevilla (Spain)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################

# Save zlb-stop and zlb-start to a temporal directory
tmp_start="/tmp/zlb-start"
tmp_stop="/tmp/zlb-stop"
zvn_start="/usr/local/zevenet/config/zlb-start"
zvn_stop="/usr/local/zevenet/config/zlb-stop"

if [ -f $zvn_start ]; then
mv $zvn_start $tmp_start
fi

if [ -f $zvn_stop ]; then
mv $zvn_stop $tmp_stop
fi
2 changes: 2 additions & 0 deletions build-pkg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/workdir/
/build-context/
109 changes: 109 additions & 0 deletions build-pkg/gen_pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#!/bin/bash

# Exit at the first error
set -e

BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
DATE=$(date +%y%m%d_%H%M%S)
arch="amd64"

# Default options
devel="false"

function print_usage_and_exit() {
echo "Usage: $(basename "$0") <distribution> [options]
--devel Debug logs"
exit 1
}

function msg() {
echo -e "\n#### ${1} ####\n"
}

function die() {
local bldred='\e[1;31m' # Red bold text
local txtrst='\e[0m' # Text Reset

msg "${bldred}Error${txtrst}${1}"
exit 1
}


##### Parse command arguments #####

# Distribution parameter (-i or -u) is not optional show
# how to use the command if no distribution was selected
while [ $# -gt 0 ]; do
case $1 in
--devel)
devel="true"
;;
*)
echo "Invalid option: $1"
print_usage_and_exit
;;
esac

shift
done


#### Initial setup ####

# Setup a clean environment
cd "$BASE_DIR"
msg "Setting up a clean environment..."
rm -rf workdir
mkdir workdir
rsync -a --exclude "/$(basename "$BASE_DIR")" ../* workdir/
cd workdir

# Set version and package name
version=$(grep "Version:" DEBIAN/control | cut -d " " -f 2)
pkgname_prefix="zevenet_${version}_${arch}"

if [[ "$devel" == "false" ]]; then
pkgname=${pkgname_prefix}_${distribution}_${DATE}.deb
else
pkgname=${pkgname_prefix}_DEV_${distribution}_${DATE}.deb
fi

# set version in global.conf tpl
globalconftpl='usr/local/zevenet/share/global.conf.template'
version_string='$version="_VERSION_";'
sed -i "s/$version_string/\$version=\"$version\";/" $globalconftpl


#### Package preparation ####

msg "Preparing package..."

# Remove .keep files
find . -name .keep -exec rm {} \;


# Release or development
if [[ $devel == "false" ]]; then
msg "Removing warnings and profiling instrumentation..."
# Don't include API 3
find -L usr/local/zevenet/bin \
usr/share/perl5/Zevenet \
usr/local/zevenet/www/zapi/v3.1 \
usr/local/zevenet/www/zapi/v4.0 \
-type f \
-exec sed --follow-symlinks -i 's/^use warnings.*//' {} \; \
-exec sed --follow-symlinks -i '/zenlog.*PROFILING/d' {} \;
fi


#### Generate package and clean up ####

msg "Generating .deb package..."
cd "$BASE_DIR"

# Generate package using the most recent debian version
dpkg-deb --build workdir packages/"$pkgname" \
|| die " generating the package"

msg "Success: package ready"
1 change: 1 addition & 0 deletions build-pkg/packages/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.deb

0 comments on commit 9cdb85f

Please sign in to comment.