summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsinbud20042021-10-06 07:04:05 +0800
committersinbud20042021-10-06 07:04:05 +0800
commit652227e3b8d69a6fcc48c2ecfd24d4c1012cf11c (patch)
tree984fbeaa48af729d4ffaa9104849537e7ba81a14
downloadaur-652227e3b8d69a6fcc48c2ecfd24d4c1012cf11c.tar.gz
easyconnect-zjjy
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD26
-rw-r--r--easyconnect-zjjy.install189
3 files changed, 230 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..6b62d9215dd5
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = easyconnect-zjjy
+ pkgdesc = Accessing ZJJY's network resources over vpn connection.
+ pkgver = 7.6.7.3
+ pkgrel = 1
+ url = https://vpn.zjjy.com.cn
+ install = easyconnect-zjjy.install
+ arch = x86_64
+ license = custom
+ conflicts = easyconnect
+ source = http://download.sangfor.com.cn/download/product/sslvpn/pkg/linux_767/EasyConnect_x64_7_6_7_3.deb
+ source = http://ftp.acc.umu.se/pub/GNOME/sources/pango/1.42/pango-1.42.4.tar.xz
+ md5sums = 89441c8eadab3c6c8f701f32d680d0b6
+ md5sums = deb171a31a3ad76342d5195a1b5bbc7c
+
+pkgname = easyconnect-zjjy
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9ba693a71f2d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,26 @@
+# Maintainer: Xing Peng <xingpeng@zjjy.com.cn>
+
+pkgname=easyconnect-zjjy
+pkgver=7.6.7.3
+pkgrel=1
+pkgdesc="Accessing ZJJY's network resources over vpn connection."
+arch=('x86_64')
+url="https://vpn.zjjy.com.cn"
+license=('custom')
+conflicts=('easyconnect')
+install=${pkgname}.install
+source=("http://download.sangfor.com.cn/download/product/sslvpn/pkg/linux_767/EasyConnect_x64_7_6_7_3.deb"
+ "http://ftp.acc.umu.se/pub/GNOME/sources/pango/1.42/pango-1.42.4.tar.xz")
+md5sums=('89441c8eadab3c6c8f701f32d680d0b6'
+ 'deb171a31a3ad76342d5195a1b5bbc7c')
+package(){
+ tar xzf data.tar.gz -C "${pkgdir}"
+ tar xf ${srcdir}/pango-1.42.4.tar.xz
+ cd pango-1.42.4
+ ./configure --prefix=/usr
+ make -j4 && make DESTDIR=${pkgdir}"/usr/share/sangfor/EasyConnect/oldlib/pango" install
+ cd ${pkgdir}
+ sed -i 's/Exec=/Exec=env LD_LIBRARY_PATH=\/usr\/share\/sangfor\/EasyConnect\/oldlib\/pango\/usr\/lib /g' "${pkgdir}/usr/share/applications/EasyConnect.desktop"
+ install -D -m644 "${pkgdir}/usr/share/sangfor/EasyConnect/LICENSES.chromium.html" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
+
diff --git a/easyconnect-zjjy.install b/easyconnect-zjjy.install
new file mode 100644
index 000000000000..8542ef59c671
--- /dev/null
+++ b/easyconnect-zjjy.install
@@ -0,0 +1,189 @@
+pre_install() {
+ #打包的时候替换
+ PAK_ARCH="amd64"
+ #错误输出位置
+ ERR_OUT=/tmp/EasyConnectSDU.install.error
+
+ #清空之前可能存在的错误日志信息
+ if [ -f $ERR_OUT ]
+ then
+ echo > $ERR_OUT
+ fi
+ uname -a | grep x86_64 > /dev/null
+ if [ $? -eq 0 ]
+ then
+ if [ $PAK_ARCH = "i386" ]
+ then
+ echo "deb pkg is 32bit, os is 64bit, can't install..."
+ echo "deb pkg is 32bit, os is 64bit, can't install..." >>$ERR_OUT
+ exit -1
+ fi
+ else
+ if [ $PAK_ARCH = "amd64" ]
+ then
+ echo "deb pkg is 64bit, os is 32bit, can't install..."
+ echo "deb pkg is 64bit, os is 32bit, can't install..." >>$ERR_OUT
+ exit -1
+ fi
+ fi
+
+}
+
+post_install() {
+
+ #######################################################################
+ #宏定义
+ EasyConnectDir=/usr/share/sangfor/EasyConnect
+ ResourcesDir=${EasyConnectDir}/resources
+
+ ECAGENT_IMPORT_CA=${ResourcesDir}"/usr/bin/ECAgent --install-import-cert"
+ #######################################################################
+
+ ###################
+ #添加系统服务
+ ###################
+ system_add_service()
+ {
+ systemctl enable EasyMonitor
+ systemctl start EasyMonitor
+ }
+ add_service()
+ {
+ #导入证书
+ ${ECAGENT_IMPORT_CA} > /dev/null 2>&1
+
+ system_add_service
+ }
+ #更改文件权限
+ change_authority(){
+
+ #文件权限处理
+ chmod +x ${EasyConnectDir}/EasyConnect
+ #保证logs文件夹存在
+ mkdir -p ${ResourcesDir}/logs
+ chmod 755 ${ResourcesDir}/logs
+ ###CSClient创建的域套接字的句柄在这个地方,要加写权限,可以考录换个目录
+ chmod 755 ${ResourcesDir}/conf -R
+ chmod +x ${ResourcesDir}/shell/*
+
+ #更改所有者
+ chown root:root ${ResourcesDir}/bin/ECAgent
+ chown root:root ${ResourcesDir}/bin/svpnservice
+ chown root:root ${ResourcesDir}/bin/CSClient
+ #添加s权限
+ chmod +s ${ResourcesDir}/bin/ECAgent
+ chmod +s ${ResourcesDir}/bin/svpnservice
+ chmod +s ${ResourcesDir}/bin/CSClient
+ }
+ #手动启动EasyMonitor,这里处理可能有不妥之处,需要修改
+ #${ResourcesDir}/bin/EasyMonitor
+
+ change_authority
+ add_service
+ exit 0
+}
+
+pre_upgrade() {
+ pre_install
+}
+
+post_upgrade() {
+ post_install
+}
+
+pre_remove() {
+
+ #EasyMonitor位置
+ EASYMONITOR="/usr/share/sangfor/EasyConnect/resources/bin/EasyMonitor"
+
+
+ ###################
+ #删除系统服务
+ ###################
+ system_del_service()
+ {
+ systemctl stop EasyMonitor
+ systemctl disable EasyMonitor
+ }
+
+ del_service()
+ {
+ system_del_service
+ }
+
+ #杀死可能存在的EC进程
+ kill_programe()
+ {
+
+ #停止所有相关进程
+ pidof EasyMonitor
+ if [ $? -eq 0 ];then
+ killall EasyMonitor
+ fi
+ pidof EasyMonitor
+ if [ $? -eq 0 ];then
+ killall -9 EasyMonitor
+ fi
+
+ pidof ECAgent
+ if [ $? -eq 0 ];then
+ killall ECAgent
+ fi
+ pidof ECAgent
+ if [ $? -eq 0 ];then
+ killall -9 ECAgent
+ fi
+
+ pidof EasyConnect
+ if [ $? -eq 0 ];then
+ killall EasyConnect
+ fi
+ pidof EasyConnect
+ if [ $? -eq 0 ];then
+ killall -9 EasyConnect
+ fi
+
+ pidof CSClient
+ if [ $? -eq 0 ];then
+ killall CSClient
+ fi
+ pidof CSClient
+ if [ $? -eq 0 ];then
+ killall -9 CSClient
+ fi
+
+ pidof svpnservice
+ if [ $? -eq 0 ];then
+ killall svpnservice
+ fi
+ pidof svpnservice
+ if [ $? -eq 0 ];then
+ killall -9 svpnservice
+ fi
+
+
+ }
+
+ #恢复之前修改的所有相关的配置信息
+ recover_ec()
+ {
+ #调用EasyMonitor
+ ${EASYMONITOR} -a -r > /dev/null 2>&1
+ }
+
+
+ #停止服务
+ del_service
+ #杀死相关进程
+ kill_programe
+ #恢复配置
+ recover_ec
+
+ echo "rm pkg before..."
+ exit 0
+}
+
+post_remove() {
+ rm -rf /usr/share/sangfor/EasyConnect
+ exit 0
+}