summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c0cac11428d2e82edd84d565a5d4125a4a7b7933 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Maintainer: yjun <jerrysteve1101 at gmail dot com>

pkgname=sunloginclient
pkgver=10.1.1.38139
pkgrel=2
pkgdesc="Sunlogin Remote Control is a software that supports remote control of mobile devices, Windows, Mac, Linux and other systems.(GUI version)"
arch=("x86_64")
url="https://sunlogin.oray.com"
depends=("libappindicator-gtk3"
         "webkitgtk"
         'aspell'
         'hspell'
         'nuspell' 
         'hunspell'
         'libvoikko'
         'xorg-xhost')
license=('custom')
provides=('sunlogin')
source=("http://dl-cdn.oray.com/sunlogin/linux/SunloginClient-${pkgver}_amd64.deb"
        'LICENSE::https://service.oray.com/question/1820.html'
        'sunlogin-client-xhost.desktop')
install='.INSTALL'
sha256sums=('0467fa18f99d01d38f311c5b36b0f53f8ad36f5a6f1426ee552143b9de42939c'
            'SKIP'
            '15abf7f89fe7d54112e083914740108a73b6b2cd9d942d49de4c7ccb66c3e30f')

package() {
  tar -xf data.tar.xz -C "${pkgdir}"

  install -Dm644 "${pkgdir}/usr/local/sunlogin/scripts/runsunloginclient.service" "${pkgdir}/usr/lib/systemd/system/runsunloginclient.service"

  install -dm755 "${pkgdir}/opt"
  cp -r "${pkgdir}/usr/local/sunlogin" "${pkgdir}/opt/sunlogin"

  # 删除不必要的文件
  rm -r "${pkgdir}/usr/local/"
  rm -r "${pkgdir}/opt/sunlogin/scripts"

  # 修改文件权限(需要写入权限执行)
  chmod 666 "${pkgdir}/opt/sunlogin/res/skin/"*.skin
  chmod 666 $pkgdir/opt/sunlogin/res/font/wqy-zenhei.ttc
  chmod -R 755 $pkgdir/usr/

  # 修改路径
  sed -i 's#/usr/local/#/opt/#g' "${pkgdir}/opt/sunlogin/etc/watch.sh"
  sed -i "s#/usr/local/#/opt/#g" "${pkgdir}/usr/lib/systemd/system/runsunloginclient.service"
  sed -i 's#Exec=/usr/local/sunlogin/#Exec=/usr/#g' "${pkgdir}/usr/share/applications/sunlogin.desktop"
  sed -i 's#Icon=/usr/local/sunlogin/res/icon/sunlogin_client.png#Icon=sunlogin_client#g' "${pkgdir}/usr/share/applications/sunlogin.desktop"
	
  # 安装图标
  install -Dm644 "${pkgdir}/opt/sunlogin/res/icon/sunlogin_client.png" "${pkgdir}/usr/share/pixmaps/sunlogin_client.png"
  # 安装协议
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  # 创建软链
  install -dm755 "$pkgdir/usr/bin"

  ln -s "/opt/sunlogin/bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
  ln -s "/opt/sunlogin/bin/oray_rundaemon" "${pkgdir}/usr/bin/oray_rundaemon"

  # xhost +
  install -Dm644 "${srcdir}/sunlogin-client-xhost.desktop" "${pkgdir}/etc/xdg/autostart/sunlogin-client-xhost.desktop"
	 
  #  ugly hack
  sed -i "s#/usr/local/sunlogin\x0#/opt/sunlogin\x0\x0\x0\x0\x0\x0\x0#g" "${pkgdir}/opt/sunlogin/bin/${pkgname}"
  sed -i "s#/usr/local/sunlogin/res/icon/%s.ico\x0#/opt/sunlogin/res/icon/%s.ico\x0\x0\x0\x0\x0\x0\x0#g" "${pkgdir}/opt/sunlogin/bin/${pkgname}"
}
# vim: ts=2 sw=2 et: