summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authordarkbarker2017-03-24 15:24:02 +0500
committerdarkbarker2017-03-24 15:24:02 +0500
commit05b08bbafd194906008309e61f386164c7df5367 (patch)
tree1062fd41cab7d63f013c1056db2d4ae997388d1d
downloadaur-05b08bbafd194906008309e61f386164c7df5367.tar.gz
Initial import
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD93
-rw-r--r--bgbillingclient.install12
-rw-r--r--bgbillingclient{_versuf}.desktop9
-rw-r--r--bgbillingclient{_versuf}.pngbin0 -> 612 bytes
-rwxr-xr-xbgbillingclient{_versuf}.sh4
6 files changed, 139 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..846d741484e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+# Generated by mksrcinfo v8
+# Fri Mar 24 10:19:30 UTC 2017
+pkgbase = bgbillingclient71
+ pkgdesc = Client for billing system BGBilling 7.1
+ pkgver = 7.1.11
+ pkgrel = 1
+ url = http://bgbilling.ru
+ install = bgbillingclient.install
+ arch = i686
+ arch = x86_64
+ license = custom
+ depends = java-runtime=8
+ source = bgbillingclient{_versuf}.sh
+ source = bgbillingclient{_versuf}.desktop
+ source = bgbillingclient{_versuf}.png
+ md5sums = 5c6031713ab88c1d6fa71e43d27d1071
+ md5sums = 64cbed916271ecc83f2af450cfececbc
+ md5sums = e33f57ef3a2e711f47ccc3ec5ecddaf8
+
+pkgname = bgbillingclient71
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..dc931cd5214
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,93 @@
+# Maintainer: Dmitry Barker Medvedev <dimon@bitel.ru>
+pkgname=bgbillingclient71
+pkgver=7.1.11
+pkgrel=1
+pkgdesc='Client for billing system BGBilling 7.1'
+arch=('i686' 'x86_64')
+url='http://bgbilling.ru'
+license=('custom')
+depends=('java-runtime=8')
+install=bgbillingclient.install
+source=(bgbillingclient{_versuf}.sh bgbillingclient{_versuf}.desktop bgbillingclient{_versuf}.png)
+md5sums=('5c6031713ab88c1d6fa71e43d27d1071'
+ '64cbed916271ecc83f2af450cfececbc'
+ 'e33f57ef3a2e711f47ccc3ec5ecddaf8')
+
+# vesions: major, build, version suffix for package
+_vermajor=$(echo ${pkgver}|cut -d'.' -f1,2)
+_verbuild=$(echo ${pkgver}|cut -d'.' -f3)
+_versuf=$(echo ${_vermajor}|sed -e "s/\.//g")
+# product/archive name
+_achivename=BGBillingClient
+# program directory name
+_dstdirname=bgbillingclient
+
+_patch_var_file() {
+ local file="$1"
+ v1="s/\\\${_versuf}/${_versuf}/g"
+ v2="s/\\\${pkgver}/${pkgver}/g"
+ v3="s/\\\${_vermajor}/${_vermajor}/g"
+ sed -i "$v1" $file
+ sed -i "$v2" $file
+ sed -i "$v3" $file
+}
+
+_rename_var_file() {
+ local file="$1"
+ local basefile=$(basename "$file")
+ v1="s/{_versuf}/${_versuf}/g"
+ local replace=$(echo $basefile | sed "$v1")
+ rename $basefile $replace $file
+}
+
+pkgver() {
+ wget --no-remove-listing ftp://ftp.bgbilling.ru/pub/bgbilling/${_vermajor}/${_achivename}_${_vermajor}_*.zip
+ # -rw-r--r-- 9 500 100 31493131 Oct 25 19:32 BGBillingClient_6.0_1258.zip
+ _ver=$(grep -o -P "${_achivename}_(\d+)\.(\d+)_(\d+)" .listing)
+ # BGBillingClient_6.0_1258
+ _v1=$(echo ${_ver}|cut -d'_' -f2)
+ _v2=$(echo ${_ver}|cut -d'_' -f3)
+ echo "${_v1}.${_v2}"
+}
+
+package() {
+ msg2 "unzip distributive"
+ unzip -o ./${_achivename}_${_vermajor}_${_verbuild}.zip
+
+ msg2 "create structure"
+ mkdir $pkgdir/opt
+ mv ${_achivename} $pkgdir/opt/${_dstdirname}${_versuf}
+
+ msg2 "remove win files"
+ rm -f $pkgdir/opt/${_dstdirname}${_versuf}/*.{bat,exe,ini}
+
+ msg2 "rename launch scripts (add suffix) and chmod"
+ rename .sh ${_versuf}.sh $pkgdir/opt/${_dstdirname}${_versuf}/*.sh
+ chmod +x $pkgdir/opt/${_dstdirname}${_versuf}/*.sh
+
+ msg2 "patch env in launch script"
+ sed -i "s/BGBILLING_DIR=\./BGBILLING_DIR=\$\{BGBILLING_DIR_${_versuf}\}/" $pkgdir/opt/${_dstdirname}${_versuf}/bgbilling*${_versuf}.sh
+
+ msg2 "patch JAVA_HOME in launch script"
+ sed -i "s|\${JAVA_HOME}\/bin\/java|java|" $pkgdir/opt/${_dstdirname}${_versuf}/bgbilling*${_versuf}.sh
+ sed -i '5d' $pkgdir/opt/${_dstdirname}${_versuf}/bgbilling*${_versuf}.sh
+ sed -i '5d' $pkgdir/opt/${_dstdirname}${_versuf}/bgbilling*${_versuf}.sh
+ sed -i '5d' $pkgdir/opt/${_dstdirname}${_versuf}/bgbilling*${_versuf}.sh
+ sed -i '5d' $pkgdir/opt/${_dstdirname}${_versuf}/bgbilling*${_versuf}.sh
+ sed -i '5d' $pkgdir/opt/${_dstdirname}${_versuf}/bgbilling*${_versuf}.sh
+
+ msg2 "patch var in files"
+ _patch_var_file bgbillingclient{_versuf}.desktop
+ _patch_var_file bgbillingclient{_versuf}.sh
+
+ msg2 "rename var in files"
+ _rename_var_file $srcdir/bgbillingclient{_versuf}.png
+ _rename_var_file $srcdir/bgbillingclient{_versuf}.desktop
+ _rename_var_file $srcdir/bgbillingclient{_versuf}.sh
+
+ msg2 "copy file"
+ mkdir -p $pkgdir/usr/share/{applications,pixmaps}
+ install -m644 $srcdir/bgbillingclient${_versuf}.png $pkgdir/usr/share/pixmaps/
+ install -m644 $srcdir/bgbillingclient${_versuf}.desktop $pkgdir/usr/share/applications/
+ install -D -m755 $srcdir/bgbillingclient${_versuf}.sh $pkgdir/etc/profile.d/bgbillingclient${_versuf}.sh
+}
diff --git a/bgbillingclient.install b/bgbillingclient.install
new file mode 100644
index 00000000000..5c2516dc5b0
--- /dev/null
+++ b/bgbillingclient.install
@@ -0,0 +1,12 @@
+# arg 1: the new package version
+post_install() {
+ echo
+ echo "After the install you must relog and forced update BGClient (as root)."
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ echo
+ echo "After the upgrade you must forced update BGClient (as root)."
+}
diff --git a/bgbillingclient{_versuf}.desktop b/bgbillingclient{_versuf}.desktop
new file mode 100644
index 00000000000..1c744d2fa20
--- /dev/null
+++ b/bgbillingclient{_versuf}.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=BGBilling ${_vermajor}
+Comment=BGBilling Client ${pkgver}
+Exec=bgbilling${_versuf}.sh
+Icon=bgbillingclient${_versuf}.png
+Type=Application
+Terminal=false
+Categories=Office;
diff --git a/bgbillingclient{_versuf}.png b/bgbillingclient{_versuf}.png
new file mode 100644
index 00000000000..cc1be09ac03
--- /dev/null
+++ b/bgbillingclient{_versuf}.png
Binary files differ
diff --git a/bgbillingclient{_versuf}.sh b/bgbillingclient{_versuf}.sh
new file mode 100755
index 00000000000..4ef7e59fc29
--- /dev/null
+++ b/bgbillingclient{_versuf}.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+export BGBILLING_DIR_${_versuf}=/opt/bgbillingclient${_versuf}
+export PATH=$PATH:$BGBILLING_DIR_${_versuf}