Browse Source

Package update

buster
Vítězslav Dvořák 5 years ago
parent
commit
f9c3b6aa77
  1. 10
      .gitignore
  2. 4
      README.md
  3. 4
      Vagrantfile
  4. 10
      bonus/flexibee.service
  5. 13
      build.sh
  6. 23
      debian/changelog
  7. 7
      debian/conffiles
  8. 47
      debian/config
  9. 30
      debian/control
  10. 182
      debian/postinst
  11. 64
      debian/postrm
  12. 51
      debian/prerm
  13. 2
      debian/revision
  14. 4
      debian/rules

10
.gitignore vendored

@ -1,2 +1,12 @@
debian/flexibee-server
tmp
etc
nbproject
debian/debhelper-build-stamp
debian/flexibee-server.debhelper.log
debian/flexibee-server.postrm.debhelper
debian/flexibee-server.substvars
debian/lastversion
debian/md5sums
flexibee_*

4
README.md

@ -2,3 +2,7 @@
Debian Package for FlexiBee server-only deploy
Odlehčený balíček bez GUI - pouze API server pro Debian Stretch
* doplněna podpora pro službu Avahi

4
Vagrantfile vendored

@ -31,16 +31,14 @@ Vagrant.configure("2") do |config|
locale-gen
update-locale
export LC_ALL="cs_CZ.UTF-8"
echo network winstrom/local-network string | debconf-set-selections
apt-get -y install gdebi-core curl locales
apt-get -y install gdebi-core curl locales mc htop screen
# CURVER="`curl -s https://www.flexibee.eu/podpora/stazeni-flexibee/stazeni-ekonomickeho-systemu-flexibee-linux/ | grep h2 | awk '{gsub("<[^>]*>", "")}1'| awk '{print $2}'`"
# IFS='.' read -r -a array <<< "$CURVER"
# GETURL="http://download.flexibee.eu/download/${array[0]}.${array[1]}/$CURVER/flexibee_${CURVER}_all.deb"
# wget $GETURL
# PACKAGE=`ls /vagrant/flexibee-server_*_all.deb`
gdebi --n --q `ls /vagrant/flexibee-server_*_all.deb`
echo FLEXIBEE_CFG=server >> /etc/default/flexibee
# dpkg-reconfigure flexibee
service flexibee status
SHELL

10
bonus/flexibee.service

@ -0,0 +1,10 @@
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">FlexiBee on %h</name>
<service>
<type>_https._tcp</type>
<port>5434</port>
<txt-record>path=/</txt-record>
</service>
</service-group>

13
build.sh

@ -1,13 +1,22 @@
#!/bin/bash
PACKAGE="flexibee-server"
wget -c http://download.flexibee.eu.s3-website.eu-central-1.amazonaws.com/download/2017.1/2017.1.11/flexibee_2017.1.11_all.deb
LATESTURL=`curl -q https://www.flexibee.eu/podpora/stazeni-flexibee/stazeni-ekonomickeho-systemu-flexibee-linux/ | grep _all.deb | awk -F'"' '{print $6}'`
LATESTPKG=`basename $LATESTURL`
if [ ! -f $LATESTPKG ];
then
wget -c $LATESTURL
fi
VERSION=`ls flexibee_*_all.deb | awk -F_ '{print $2}'`
REVISION=`cat debian/revision | perl -ne 'chomp; print join(".", splice(@{[split/\./,$_]}, 0, -1), map {++$_} pop @{[split/\./,$_]}), "\n";'`
echo XXXXXXXXXXXXXXXXXXXXXXXXXX $VERSION-$REVISION
rm -rf tmp debian/data
rm -rf tmp debian/data data
mkdir tmp
cd tmp

23
debian/changelog vendored

@ -1,21 +1,6 @@
flexibee-server (2017.1.11-8) UNRELEASED; urgency=medium
flexibee-server (2017.1.11-0) UNRELEASED; urgency=medium
* Initial commit
* Initial commit
* Initial commit
* Initial commit
* Merge branch 'master' of github.com:VitexSoftware/flexibee-server-
deb
* 2017.1.11-6 Merge branch 'master' of
github.com:VitexSoftware/flexibee-server-deb
* 2017.1.11-6 Merge branch 'master' of
github.com:VitexSoftware/flexibee-server-deb
* branch 'master' of github.com:VitexSoftware/flexibee-server-deb
* Merge branch 'master' of github.com:VitexSoftware/flexibee-server-
deb
* Merge branch 'master' of github.com:VitexSoftware/flexibee-server-
deb
* Merge branch 'master' of github.com:VitexSoftware/flexibee-server-
deb
[ Vítězslav Dvořák ]
* Added Support for Avahi
-- Vítězslav Dvořák <info@vitexsoftware.cz> Wed, 14 Jun 2017 09:23:07 +0200
-- Vítězslav Dvořák <info@vitexsoftware.cz> Fri, 16 Jun 2017 12:27:49 +0200

7
debian/conffiles vendored

@ -0,0 +1,7 @@
/etc/logrotate.d/flexibee
/etc/ufw/applications.d/flexibee
/etc/apt/sources.list.d/flexibee.list
/etc/default/flexibee
/etc/init.d/flexibee
/etc/flexibee/flexibee-server.xml
/etc/avahi/services/flexibee.service

47
debian/config vendored

@ -0,0 +1,47 @@
#!/bin/bash
set -e
TYPE=client
# check if PostgreSQL cluster is installed.
if [ -f /usr/bin/pg_createcluster ]; then
. /usr/share/debconf/confmodule
# ask user for local database
db_input high winstrom/local-network || true
db_go || true
db_get winstrom/local-network
if [ "x$RET" = "xnetwork" ]; then
db_input high winstrom/server-client || true
db_go || RET=true
db_get winstrom/server-client
if [ "x$RET" = "xserver" ]; then
TYPE="server"
else
TYPE="client"
fi
else
TYPE="local"
fi
fi
CFG=/etc/default/flexibee
if [ -f "$CFG" ]; then
cat $CFG | sed "s/#*[[:space:]]*FLEXIBEE_CFG=.*/FLEXIBEE_CFG=$TYPE/g" > $CFG.new
CONFIG_CHANGED=0
/usr/bin/diff -q --ignore-space-change $CFG $CFG.new > /dev/null 2> /dev/null || CONFIG_CHANGED=1
if [ "x$CONFIG_CHANGED" = "x1" ]; then
mv $CFG $CFG.old
mv $CFG.new $CFG
else
rm "$CFG.new"
fi
fi
exit 0

30
debian/control vendored

@ -0,0 +1,30 @@
Source: flexibee-server
Build-Depends: debhelper (>= 7.0.50~)
Standards-Version: 3.8.4
Maintainer: Vítězslav Dvořák <info@vitexsoftware.cz>
Uploaders: Vitex <vitex@hippy.cz>
Priority: optional
Homepage: https://www.vitexsoftware.cz/
Package: flexibee-server
Architecture: all
Depends: openjdk-8-jre-headless, postgresql-client-common, postgresql-9.6 | postgresql-9.5 | postgresql-9.4 | postgresql-9.3 | postgresql-9.2 | postgresql-9.1 | postgresql-9.0 | postgresql-8.4 | postgresql-8.3 | postgresql (>= 8.3), postgresql-pltcl-9.6 | postgresql-pltcl-9.5 | postgresql-pltcl-9.4 | postgresql-pltcl-9.3 | postgresql-pltcl-9.2 | postgresql-pltcl-9.1 | postgresql-pltcl-9.0 | postgresql-pltcl-8.4 | postgresql-pltcl-8.3, postgresql-contrib-9.6 | postgresql-contrib-9.5 | postgresql-contrib-9.4 | postgresql-contrib-9.3 | postgresql-contrib-9.2 | postgresql-contrib-9.1 | postgresql-contrib-9.0 | postgresql-contrib-8.4 | postgresql-contrib-8.3, debconf | debconf-2.0
Conflicts: flexibee-client,flexibee, winstrom, winstrom-client
Replaces: flexibee-client,flexibee, winstrom
Section: contrib/office
Priority: optional
Homepage: http://www.flexibee.eu/
Description: Ekonomický systém ABRA FlexiBee
Internetový ekonomický systém ABRA FlexiBee.
.
Upozornění pro uživatele Ubuntu 14.04 LTS a vyšší:
ABRA FlexiBee k nastavení typu instalace používá nástroj
DebConf, který k zobrazení dotazů využívá knihovnu libgtk2-perl.
Tento balíček ale nemusí být ve Vašem systému dostupný a Centrum
softwaru pro Ubuntu kvůli tomu na konci instalace přestane
odpovídat. Nedojde tak k výběru typu instalace a FlexiBee poběží
v režimu "Lokální instalace". K dodatečnému nastavení typu
instalace otevřete terminál a zadejte příkaz
"sudo dpkg-reconfigure flexibee".
Instalace v terminálu tímto problémem netrpí.

182
debian/postinst vendored

@ -0,0 +1,182 @@
#!/bin/bash
. /usr/share/debconf/confmodule
set -e
MYLANG=`echo $LANG | cut -c 1-2`
# get install type from dbconf database
db_get winstrom/local-network || true
INSTALL_TYPE=local
if [ "x$RET" = "xnetwork" ]; then
db_get winstrom/server-client || true
if [ "x$RET" = "xclient" ]; then
INSTALL_TYPE=client
INSTALL_DB=false
else
INSTALL_TYPE=server
INSTALL_DB=true
fi
fi
# if it's not a client instalation type check for cs_CZ.utf8 locale (and exit if it's missing)
if [ "x$INSTALL_TYPE" != "xclient" ] && [ -x "/usr/bin/localectl" ]; then
FOUND=0
LOCALES=`localectl list-locales`
for LOC in $LOCALES; do
LOC_LOWER=$(echo "$LOC" | tr '[:upper:]' '[:lower:]')
if [ "$LOC_LOWER" = "cs_cz.utf8" ]; then
FOUND=1
fi
done
if [ "$FOUND" -eq "0" ]; then
echo ""
if [ "x$MYLANG" = "xcs" ]; then
echo " Chyba: K běhu FlexiBee Server je nutné cs_CZ.utf8 locale. Můžete ho přidat pomocí 'sudo locale-gen cs_CZ.utf8; sudo update-locale'";
else
echo " Error: FlexiBee Server needs cs_CZ.utf8 locale to run. You can add it with 'sudo locale-gen cs_CZ.utf8; sudo update-locale'";
fi
exit 1;
fi
fi
# it is not hard to overcome this. This is for letting the user know in advance that the installation will fail (license is checked at startup)
LICENSE_CHECKER_CP=""
for i in /usr/share/flexibee/lib/postgresql-*.jar /usr/share/flexibee/lib/winstrom-connector-*.jar /usr/share/flexibee/lib/LicenseChecker.jar; do
LICENSE_CHECKER_CP=$LICENSE_CHECKER_CP:$i
done
OK=true
/usr/bin/java -cp $LICENSE_CHECKER_CP cz.winstrom.Checker /usr/share/flexibee/lib/winstrom-connector*.jar || OK=false
if [ x$OK = xfalse ]; then
echo ""
if [ "x$MYLANG" = "xcs" ]; then
echo " Chyba: Pokoušíte se aktualizovat na novější verzi systému FlexiBee než vás opravňuje zaplacená služba záruka. Vraťte původní verzi a nebo kontaktujte dodavatele systému a prodlužte si záruku.";
else
echo " Error: You are trying to update to a newer version of FlexiBee system than allowed in your license. Please put back the original version or contact the producer and prolong your license.";
fi
echo ""
exit 1
fi
if [ -f /usr/bin/update-mime-database ]; then
/usr/bin/update-mime-database /usr/share/mime/ > /dev/null || true
fi
if [ -f /usr/bin/xdg-desktop-menu ]; then
/usr/bin/xdg-desktop-menu install --novendor /usr/share/applications/flexibee.desktop > /dev/null || true
fi
if [ -f /usr/bin/xdg-mime ]; then
/usr/bin/xdg-mime install --novendor /usr/share/mime/packages/flexibee.xml > /dev/null || true
fi
if [ -f /usr/bin/xdg-icon-resource ]; then
/usr/bin/xdg-icon-resource install --context mimetypes --size 128 /usr/share/flexibee/flexibee-connection.png flexibee-connection
/usr/bin/xdg-icon-resource install --context mimetypes --size 128 /usr/share/flexibee/flexibee-backup.png flexibee-backup
/usr/bin/xdg-icon-resource install --context mimetypes --size 128 /usr/share/flexibee/flexibee-license.png flexibee-license
/usr/bin/xdg-icon-resource install --context mimetypes --size 128 /usr/share/flexibee/flexibee-query.png flexibee-query
/usr/bin/xdg-icon-resource install --context mimetypes --size 128 /usr/share/flexibee/flexibee-report.png flexibee-report
/usr/bin/xdg-icon-resource install --context mimetypes --size 128 /usr/share/flexibee/flexibee-xml.png flexibee-xml
/usr/bin/xdg-icon-resource install --context mimetypes --size 128 /usr/share/flexibee/flexibee-isdoc.png flexibee-isdoc
/usr/bin/xdg-icon-resource install --context mimetypes --size 128 /usr/share/flexibee/flexibee-backup.png winstrom-backup
/usr/bin/xdg-icon-resource install --context mimetypes --size 128 /usr/share/flexibee/flexibee-license.png winstrom-license
/usr/bin/xdg-icon-resource install --context mimetypes --size 128 /usr/share/flexibee/flexibee-xml.png winstrom-xml
fi
INSTALL_DB=true
CLIENT_TYPE=client
# check if PostgreSQL cluster is installed.
if [ -f /usr/bin/pg_createcluster -a -f /etc/init.d/flexibee ]; then
DBVERSION=8.2
PATHPGSQL="/usr/lib/postgresql/"
SUPPORTEDVERSIONS=( "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" )
for ver in "${SUPPORTEDVERSIONS[@]}"
do
if [ -d $PATHPGSQL$ver ]; then
DBVERSION=$ver
break;
fi
done
if [ "x$INSTALL_TYPE" != "xclient" ]; then
if [ ! -f /etc/flexibee/ws.cenServer.xml -a -f /usr/share/flexibee/ws.cenServer.xml ]; then
cp /usr/share/flexibee/ws.cenServer.xml /etc/flexibee/ws.cenServer.xml || true
fi
fi
if [ "x$INSTALL_DB" = "xtrue" ]; then
PG_USER=postgres
PG_GROUP=postgres
PG_PORT=5435
if [ "x$MYLANG" = "xcs" ]; then
echo "Připravuji databázi PostgreSQL pro systém FlexiBee ..."
else
echo "Preparing PostgreSQL for FlexiBee ..."
fi
# check for cluster existance
EXISTING=0
/usr/bin/pg_lsclusters | grep -e winstrom -e flexibee 2>/dev/null > /dev/null && EXISTING=1
if [ "x$EXISTING" = "x0" ]; then
if [ "x$MYLANG" = "xcs" ]; then
echo -n " Vytvářím novou databázi ... "
else
echo -n " Creating new database ... "
fi
/usr/bin/pg_createcluster --port=$PG_PORT --datadir=/var/lib/flexibee --encoding=utf-8 --locale=cs_CZ.utf8 --user=$PG_USER --group=$PG_GROUP --start-conf=auto --socketdir=/var/run/postgresql/ "$DBVERSION" flexibee > /dev/null
echo "ok"
else
if [ "x$MYLANG" = "xcs" ]; then
echo " Použiji existující databázi ..."
else
echo " Using existing database ..."
fi
fi
if [ -f /usr/sbin/update-rc.d ]; then
/usr/sbin/update-rc.d flexibee start 90 2 3 5 . stop 20 0 1 6 . > /dev/null
fi
if [ -f /usr/share/flexibee/bin/initdb.sh ]; then
/usr/share/flexibee/bin/initdb.sh || exit 1
fi
fi
fi
if [ -f /etc/init.d/flexibee -a x$INSTALL_TYPE != xclient ]; then
/etc/init.d/flexibee start || exit 1
fi
# the keyring in /var that gets fetched by apt-key net-update
# if it does not yet exist, copy it to avoid uneeded net copy
KEYRINGDIR="/var/lib/apt/keyrings"
KEYRING="${KEYRINGDIR}/flexibee.gpg"
if ! test -d $KEYRINGDIR; then
mkdir -m 755 -p $KEYRINGDIR
fi
if ! test -f $KEYRING; then
cp /usr/share/flexibee/flexibee.gpg $KEYRING
touch $KEYRING
apt-key add $KEYRING
fi
db_stop
exit 0

64
debian/postrm vendored

@ -0,0 +1,64 @@
#!/bin/bash
. /usr/share/debconf/confmodule
if [ -f /usr/bin/update-mime-database ]; then
/usr/bin/update-mime-database /usr/share/mime/ > /dev/null
fi
set -e
MYLANG=`echo $LANG | cut -c 1-2`
# are we removing?
if [ "$1" = remove -a -f /usr/bin/pg_lsclusters ]; then
# check for cluster existance
EXISTING=0
/usr/bin/pg_lsclusters | grep -e winstrom -e flexibee 2>/dev/null > /dev/null && EXISTING=1
if [ "x$EXISTING" = "x1" ]; then
DBVERSION=`/usr/bin/pg_lsclusters | grep -e winstrom -e flexibee | cut "-d " -f 1`
CLUSTERNAME=`/usr/bin/pg_lsclusters --no-head | grep $DBVERSION | sed -e"s/[ ]\+/ /g" | cut "-d " -f 2 | sed "s/[[:space:]]*//g" | head -1`
/usr/bin/pg_ctlcluster --force $DBVERSION $CLUSTERNAME stop || true
# we always ask this question
db_fset winstrom/remove-db seen false
db_set winstrom/remove-db false
db_input high winstrom/remove-db || RET=false
db_go || RET=false
db_get winstrom/remove-db
if [ "x$RET" = "xtrue" ]; then
if [ "x$MYLANG" = "xcs" ]; then
echo "Odstraňují databázi systému FlexiBee ..."
else
echo "Removing FlexiBee database ..."
fi
/usr/bin/pg_dropcluster $DBVERSION $CLUSTERNAME --stop || true
else
if [ "x$MYLANG" = "xcs" ]; then
echo "Zachovávám databázi systému FlexiBee ..."
else
echo "Keeping FlexiBee database ..."
fi
fi
fi
fi
if [ "$1" = purge ]; then
if [ -f /etc/init.d/flexibee ]; then
update-rc.d flexibee remove >/dev/null
fi
userdel winstrom >/dev/null 2>&1 || true
rm /etc/winstrom/ 2>/dev/null || true
rm /etc/flexibee/ 2>/dev/null || true
rm /etc/default/flexibee 2> /dev/null || true
rm /etc/default/winstrom 2> /dev/null || true
fi
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
db_purge
fi
# End automatically added section

51
debian/prerm vendored

@ -0,0 +1,51 @@
#!/bin/bash
. /usr/share/debconf/confmodule
set -e
if [ -x /etc/init.d/flexibee ]; then
/etc/init.d/flexibee stop || true
fi
if [ -x /etc/init.d/winstrom ]; then
/etc/init.d/winstrom stop || true
fi
if [ -f /usr/bin/xdg-desktop-menu ]; then
/usr/bin/xdg-desktop-menu uninstall --novendor /usr/share/applications/flexibee.desktop > /dev/null || true
fi
if [ -f /usr/bin/xdg-mime ]; then
/usr/bin/xdg-mime uninstall --novendor /usr/share/mime/packages/flexibee.xml > /dev/null || true
fi
if [ -f /usr/bin/xdg-icon-resource ]; then
/usr/bin/xdg-icon-resource uninstall --context mimetypes --size 128 flexibee-backup
/usr/bin/xdg-icon-resource uninstall --context mimetypes --size 128 flexibee-license
/usr/bin/xdg-icon-resource uninstall --context mimetypes --size 128 flexibee-query
/usr/bin/xdg-icon-resource uninstall --context mimetypes --size 128 flexibee-report
/usr/bin/xdg-icon-resource uninstall --context mimetypes --size 128 flexibee-xml
/usr/bin/xdg-icon-resource uninstall --context mimetypes --size 128 flexibee-isdoc
/usr/bin/xdg-icon-resource uninstall --context mimetypes --size 128 winstrom-backup
/usr/bin/xdg-icon-resource uninstall --context mimetypes --size 128 winstrom-license
/usr/bin/xdg-icon-resource uninstall --context mimetypes --size 128 winstrom-xml
fi
# backup changes in FlexiBee installation type done manually by user [Bug 41596 - Aktualizace FlexiBee balíčku na linuxu resetuje nastavení FLEXIBEE_CFG (typ instalace se vrací na local)]
if [ -f /etc/default/flexibee ]; then
. /etc/default/flexibee
if [ "x$FLEXIBEE_CFG" == "xlocal" ]; then
db_set winstrom/local-network "local"
else
db_set winstrom/local-network "network"
if [ "x$FLEXIBEE_CFG" == "xserver" ]; then
db_set winstrom/server-client "server"
else
db_set winstrom/server-client "client"
fi
fi
fi

2
debian/revision vendored

@ -0,0 +1,2 @@
0

4
debian/rules vendored

@ -15,4 +15,8 @@ override_dh_install:
rm -rf data/usr/share/mime
rm -rf data/usr/share/mimelnk
rm -rf data/usr/share/pixmaps
mkdir -p data/etc/avahi/services/
cp bonus/flexibee.service data/etc/avahi/services/
echo FLEXIBEE_CFG=server >> data/etc/default/flexibee
mv data/* debian/flexibee-server

Loading…
Cancel
Save