summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authordarkbarker2015-06-26 14:30:41 +0500
committerdarkbarker2015-06-26 14:30:41 +0500
commita80ec27b10a4355fc1bf7663b1f4d86ad00dabac (patch)
treea8d394da83748988e36c3b6944b02ebca4fb3f8b
downloadaur-a80ec27b10a4355fc1bf7663b1f4d86ad00dabac.tar.gz
Initial import
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD78
-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, 122 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2ead9a1223a4
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = bgbillingclient51
+ pkgdesc = Client for billing system BGBilling 5.1
+ pkgver = 5.1.695
+ pkgrel = 2
+ url = http://bgbilling.ru
+ install = bgbillingclient.install
+ arch = i686
+ arch = x86_64
+ license = custom
+ depends = java-runtime
+ source = bgbillingclient{_versuf}.sh
+ source = bgbillingclient{_versuf}.desktop
+ source = bgbillingclient{_versuf}.png
+ md5sums = 5c6031713ab88c1d6fa71e43d27d1071
+ md5sums = 64cbed916271ecc83f2af450cfececbc
+ md5sums = e33f57ef3a2e711f47ccc3ec5ecddaf8
+
+pkgname = bgbillingclient51
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c5cb3c31c37c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,78 @@
+# Maintainer: Dmitry Barker Medvedev <dimon@bitel.ru>
+pkgname=bgbillingclient51
+pkgver=5.1.695
+pkgrel=2
+pkgdesc='Client for billing system BGBilling 5.1'
+arch=('i686' 'x86_64')
+url='http://bgbilling.ru'
+license=('custom')
+depends=('java-runtime')
+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() {
+ # unzip distributive
+ unzip -o ./${_achivename}_${_vermajor}_${_verbuild}.zip
+ # create structure
+ mkdir $pkgdir/opt
+ mv ${_achivename} $pkgdir/opt/${_dstdirname}${_versuf}
+ # remove win files
+ rm -f $pkgdir/opt/${_dstdirname}${_versuf}/*.{bat,exe,ini}
+ # rename launch scripts (add suffix) and chmod
+ rename .sh ${_versuf}.sh $pkgdir/opt/${_dstdirname}${_versuf}/*.sh
+ chmod +x $pkgdir/opt/${_dstdirname}${_versuf}/*.sh
+ # patch env in launch script
+ sed -i "s/BGBILLING_DIR=\./BGBILLING_DIR=\$\{BGBILLING_DIR_${_versuf}\}/" $pkgdir/opt/${_dstdirname}${_versuf}/*.sh
+ # patch var in files
+ _patch_var_file bgbillingclient{_versuf}.desktop
+ _patch_var_file bgbillingclient{_versuf}.sh
+ # 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
+ # 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 000000000000..5c2516dc5b0f
--- /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 000000000000..1c744d2fa205
--- /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 000000000000..cc1be09ac032
--- /dev/null
+++ b/bgbillingclient{_versuf}.png
Binary files differ
diff --git a/bgbillingclient{_versuf}.sh b/bgbillingclient{_versuf}.sh
new file mode 100755
index 000000000000..4ef7e59fc296
--- /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}