summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandr Boiko2015-06-15 17:54:40 +1000
committerAlexandr Boiko2015-06-15 17:54:40 +1000
commit2e5d992d500610c13b9be7ec4cc1054db927118a (patch)
treec7d09a8d113e74ae5474e1934084a1ad56a42577
downloadaur-2e5d992d500610c13b9be7ec4cc1054db927118a.tar.gz
Initial import
-rw-r--r--.SRCINFO30
-rw-r--r--PKGBUILD61
-rw-r--r--bgbilling.conf3
-rw-r--r--bgbilling.install22
-rw-r--r--bgbilling.service13
-rw-r--r--bgdataloader.service13
-rw-r--r--bgscheduler.service13
-rw-r--r--setenv.sh.patch15
-rw-r--r--update.sh.patch50
9 files changed, 220 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..8b9c6a38618f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,30 @@
+pkgbase = bgbilling
+ pkgdesc = The billing system BGBilling
+ pkgver = 6.2.1047
+ pkgrel = 3
+ url = http://bgbilling.ru
+ install = bgbilling.install
+ arch = i686
+ arch = x86_64
+ license = custom
+ makedepends = unzip
+ makedepends = dos2unix
+ makedepends = patch
+ depends = activemq
+ depends = java-runtime=7
+ depends = pbzip2
+ depends = percona-server-clients
+ optdepends = percona-server
+ backup = opt/bgbilling/data/lic.properties
+ source = ftp://bgbilling.ru/pub/bgbilling/6.2/data/BGBillingServer_6.2_1047.zip
+ source = bgbilling.conf
+ source = bgbilling.service
+ source = bgdataloader.service
+ source = bgscheduler.service
+ source = setenv.sh.patch
+ source = update.sh.patch
+
+pkgname = bgbilling
+ backup = opt/bgbilling/data/lic.properties
+ backup = etc/conf.d/
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..57b2f912b7d8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,61 @@
+# Maintainer: Aleksander Boiko <brdcom@ya.ru>
+pkgname=bgbilling
+_pkgname=BGBillingServer
+_major=6.2
+_minor=1047
+pkgver=$_major.$_minor
+pkgrel=3
+pkgdesc="The billing system BGBilling"
+arch=('i686' 'x86_64')
+url="http://bgbilling.ru"
+license=('custom')
+depends=('activemq' 'java-runtime=7' 'pbzip2' 'percona-server-clients')
+optdepends=('percona-server')
+makedepends=('unzip' 'dos2unix' 'patch')
+backup=("opt/${pkgname}/data/lic.properties")
+source=("ftp://bgbilling.ru/pub/${pkgname}/${_major}/data/${_pkgname}_${_major}_${_minor}.zip"
+ 'bgbilling.conf'
+ 'bgbilling.service'
+ 'bgdataloader.service'
+ 'bgscheduler.service'
+ 'setenv.sh.patch'
+ 'update.sh.patch')
+install=bgbilling.install
+
+package() {
+ install -d -m0755 ${pkgdir}/opt
+ mv ./${_pkgname} ${pkgdir}/opt/${pkgname}
+
+ for d in bgbilling; do
+ install -D -m 644 $pkgname.conf "$pkgdir/etc/conf.d/$d"
+ backup+=("etc/conf.d/$d")
+ done
+
+ for d in bgbilling bgscheduler bgdataloader; do
+ install -D -m 644 $d.service "$pkgdir/usr/lib/systemd/system/$d.service"
+ done
+
+ install -D -m0644 ./dump.sql ${pkgdir}/usr/share/${pkgname}/dump.sql
+ #install -D -m0644 ./lic.properties ${pkgdir}/usr/share/licenses/${pkgname}/test_license/lic.properties
+
+# putting the appropriate access rights to the startup scripts
+ cd ${pkgdir}/opt/${pkgname}
+ chmod 0744 *.sh
+
+# patch
+ patch -p0 <"${srcdir}/setenv.sh.patch"
+ patch -p0 <"${srcdir}/update.sh.patch"
+
+# converting files to Unix format
+ dos2unix *.sh
+
+# remove win files
+ rm -rf *.ini
+ rm -rf *.bat
+ rm -rf *.exe
+
+# remove junk files
+ rm -rf ./script
+}
+
+# vim:set ts=2 sw=2 ft=sh et:
diff --git a/bgbilling.conf b/bgbilling.conf
new file mode 100644
index 000000000000..459c0885c4dd
--- /dev/null
+++ b/bgbilling.conf
@@ -0,0 +1,3 @@
+JAVA_HOME=/usr/lib/jvm/default
+BGBILLING_SERVER_DIR=/opt/bgbilling
+BGBILLING_HOME=/opt/bgbilling
diff --git a/bgbilling.install b/bgbilling.install
new file mode 100644
index 000000000000..97302f093f33
--- /dev/null
+++ b/bgbilling.install
@@ -0,0 +1,22 @@
+# Colors
+note() {
+ printf "${BLUE}==>${ALL_OFF}${BOLD} NOTE:${ALL_OFF} ${1}\n"
+}
+
+ALL_OFF="$(tput sgr0)"
+BOLD="$(tput bold)"
+BLUE="${BOLD}$(tput setaf 4)"
+GREEN="${BOLD}$(tput setaf 2)"
+
+post_install() {
+
+ echo
+ note "Select the correct path to your JAVA_HOME in /etc/conf.d/bgbilling
+ Create database: mysql < dump.sql"
+}
+
+post_upgrade() {
+
+ echo
+ note "Select the correct path to your JAVA_HOME in /etc/conf.d/bgbilling"
+}
diff --git a/bgbilling.service b/bgbilling.service
new file mode 100644
index 000000000000..6ce04c01b15d
--- /dev/null
+++ b/bgbilling.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=BGBilling Server daemon
+Requires=activemq.service
+After=activemq.service
+
+[Service]
+EnvironmentFile=/etc/conf.d/bgbilling
+Type=forking
+ExecStart=/opt/bgbilling/server.sh start
+ExecStop=/opt/bgbilling/server.sh stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/bgdataloader.service b/bgdataloader.service
new file mode 100644
index 000000000000..d63913d97538
--- /dev/null
+++ b/bgdataloader.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Data loader service for the billing system BGBilling
+Requires=activemq.service
+After=activemq.service
+
+[Service]
+EnvironmentFile=/etc/conf.d/bgbilling
+Type=forking
+ExecStart=/opt/bgbilling/data_loader.sh -estart
+ExecStop=/opt/bgbilling/data_loader.sh -estop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/bgscheduler.service b/bgscheduler.service
new file mode 100644
index 000000000000..1d8e33aaff2a
--- /dev/null
+++ b/bgscheduler.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Data loader service for the billing system BGBilling
+Requires=activemq.service
+After=activemq.service
+
+[Service]
+EnvironmentFile=/etc/conf.d/bgbilling
+Type=forking
+ExecStart=/opt/bgbilling/scheduler.sh -estart
+ExecStop=/opt/bgbilling/scheduler.sh -estop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/setenv.sh.patch b/setenv.sh.patch
new file mode 100644
index 000000000000..f323ebc80bda
--- /dev/null
+++ b/setenv.sh.patch
@@ -0,0 +1,15 @@
+--- setenv.sh.orig 2013-02-16 16:26:06.028821203 +1200
++++ setenv.sh 2013-02-16 16:24:10.728652087 +1200
+@@ -1,8 +1,8 @@
+-JAVA_HOME=
+-BGBILLING_SERVER_DIR=.
++JAVA_HOME="$JAVA_HOME"
++BGBILLING_SERVER_DIR="$BGBILLING_SERVER_DIR"
+
+ if [ -z "$JAVA_HOME" ]; then
+ echo "The JAVA_HOME environment variable is not defined"
+ echo "This environment variable is needed to run this program"
+ exit 1
+-fi
+\ No newline at end of file
++fi
diff --git a/update.sh.patch b/update.sh.patch
new file mode 100644
index 000000000000..5fd39d9e6618
--- /dev/null
+++ b/update.sh.patch
@@ -0,0 +1,50 @@
+--- update.sh.orig 2015-03-04 19:50:24.000000000 +1000
++++ update.sh 2015-03-06 15:27:45.895433090 +1000
+@@ -2,11 +2,12 @@
+
+ cd ${0%${0##*/}}.
+
+-SERVER=/etc/init.d/bgbilling
+-SCHEDULER=/etc/init.d/bgscheduler
+-DATALOADER=/etc/init.d/bgdataloader
++SERVER=bgbilling
++SCHEDULER=bgscheduler
++DATALOADER=bgdataloader
+ TEE=/usr/bin/tee
+ DATE=/bin/date
++DATALOADER_STATUS=`systemctl status bgdataloader | grep run | wc -l`
+
+ snapshot=`find ./snapshots -type f -mtime 0 | tail -1`
+
+@@ -19,23 +20,23 @@
+
+ time=`${DATE} +%d_%H:%M:%S`
+
+-if [ -e ${DATALOADER} ]; then
++if [ "${DATALOADER_STATUS}" -eq "1" ]; then
+ echo "# Stopping DataLoader"
+- ${DATALOADER} stop
++ systemctl stop ${DATALOADER}
+ fi
+ echo "# Stopping Scheduler"
+-${SCHEDULER} stop
++systemctl stop ${SCHEDULER}
+ echo "# Stopping Server"
+-${SERVER} stop
++systemctl stop ${SERVER}
+ echo "# Start Updating"
+ ./bg_installer.sh update | ${TEE} ./log_update_${time}
+ echo "# Starting Server"
+-${SERVER} start
++systemctl start ${SERVER}
+ echo "# Starting Scheduler"
+-${SCHEDULER} start
+-if [ -e ${DATALOADER} ]; then
++systemctl start ${SCHEDULER}
++if [ "${DATALOADER_STATUS}" -eq "0" ]; then
+ echo "# Starting DataLoader"
+- ${DATALOADER} start
++ systemctl start ${DATALOADER}
+ fi
+
+ if [ -e .bgclient_keystore_user -o -e .bgclient_keystore ]; then