Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. # Maintainer: mhammond9 <mhammond9@radford.edu>
  2.  
  3. #Most of this code comes from the cisco-anyconnect repo,
  4. #with some minor changes for tarball users.
  5.  
  6. #Thanks to K900 for the .sh AUR repo,
  7. #as their creation of that AUR package saved a bunch of time.
  8.  
  9. pkgname=cisco-anyconnect-tarball
  10. pkgver=1.0
  11. pkgrel=1
  12. pkgdesc="Automates anyconnect installation on Arch distros for tarball owners."
  13. arch=('x86_64')
  14. depends=('libxml2' 'ca-certificates' 'lib32-gcc-libs' 'boost-libs' 'webkit2gtk' 'lib32-ncurses5-compat-libs')
  15. optdepends=(
  16. 'hicolor-icon-theme: required by desktop shortcuts'
  17. 'gtk2: required by vpnui'
  18. 'glib2: required by vpnui'
  19. 'gtk3: required by acwebhelper'
  20. 'gtk3-classic: required by acwebhelper'
  21. )
  22. license=('custom')
  23. # you will have to obtain the installer yourself - it's not available publicly
  24. _filename="anyconnect-linux64.tar.gz"
  25. _dirname="/home/${USER}/Downloads/$_filename"
  26. source=("file://${_dirname}" "vpnagentd.service" "anyconnect.sh" "anyconnect.csh" "AnyConnectLocalPolicy.xml")
  27.  
  28. package() {
  29. cd "${srcdir}"
  30. tar -xf $_dirname
  31. cd "anyconnect-linux64-4.7.00136/vpn"
  32. # install binaries
  33. for binary in "vpnagentd" "vpn" "vpndownloader" "vpndownloader-cli" "manifesttool" "acinstallhelper" "vpnui" "acwebhelper"; do
  34. install -Dm755 ${binary} "${pkgdir}/opt/cisco/anyconnect/bin/${binary}"
  35. done
  36.  
  37. # install libs
  38. for lib in "libvpnagentutilities.so" "libvpncommon.so" "libvpncommoncrypt.so" \
  39. "libvpnapi.so" "libacruntime.so" "libacciscossl.so" "libacciscocrypto.so" \
  40. "libboost_date_time.so" "libboost_filesystem.so" "libboost_system.so" \
  41. "libboost_thread.so" "libboost_signals.so" "libboost_chrono.so" \
  42. "libaccurl.so.4.5.0"; do
  43. install -Dm755 ${lib} "${pkgdir}/opt/cisco/anyconnect/lib/${lib}"
  44. done
  45.  
  46. # the installer copies all the other symlinks, but creates this one
  47. # for some reason so let's just create it ourselves
  48. ln -s /opt/cisco/anyconnect/lib/libaccurl.so.4.5.0 "${pkgdir}/opt/cisco/anyconnect/lib/libaccurl.so.4"
  49.  
  50. # install plugins
  51. # we intentionally don't install the telemetry plugin here
  52. # because it tries to write to /opt and we don't want that
  53. for plugin in "libvpnipsec.so"; do
  54. install -Dm755 ${plugin} "${pkgdir}/opt/cisco/anyconnect/bin/plugins/${plugin}"
  55. done
  56.  
  57. # cp -R resources "${pkgdir}/opt/cisco/anyconnect/resources"
  58.  
  59. # install some misc stuff
  60. install -Dm444 AnyConnectProfile.xsd "${pkgdir}/opt/cisco/anyconnect/profile/AnyConnectProfile.xsd"
  61.  
  62. for file in "ACManifestVPN.xml" "update.txt" "AnyConnectLocalPolicy.xsd"; do
  63. install -Dm444 ${file} "${pkgdir}/opt/cisco/anyconnect/${file}"
  64. done
  65.  
  66. # install desktop file for vpnui
  67. install -Dm644 resources/vpnui48.png "${pkgdir}/usr/share/icons/hicolor/48x48/apps/cisco-anyconnect.png"
  68. install -Dm644 resources/vpnui128.png "${pkgdir}/usr/share/icons/hicolor/128x128/apps/cisco-anyconnect.png"
  69.  
  70. # no, Cisco, you don't get to have your own menu category
  71. echo "Categories=Network" >> cisco-anyconnect.desktop
  72. install -Dm644 cisco-anyconnect.desktop "${pkgdir}/usr/share/applications/cisco-anyconnect.desktop"
  73.  
  74. # install license
  75. for license in "license.txt" "OpenSource.html"; do
  76. install -Dm644 ${license} "${pkgdir}/usr/share/licenses/${pkgname}/${license}"
  77. done
  78.  
  79. # install systemd unit for vpnagentd
  80. install -Dm644 "${srcdir}/vpnagentd.service" "${pkgdir}/usr/lib/systemd/system/vpnagentd.service"
  81.  
  82. # install profile files - this makes sure we have all the tools in $PATH
  83. for profile in "anyconnect.sh" "anyconnect.csh"; do
  84. install -Dm644 "${srcdir}/${profile}" "${pkgdir}/etc/profile.d/${profile}"
  85. done
  86.  
  87. # install CA certificates
  88. # Cisco ships their own copy of the VeriSign root, but we already have that in the system store
  89. # so don't install that and just symlink our system bundle
  90. mkdir -p "${pkgdir}/opt/.cisco/certificates/ca"
  91. ln -s /etc/ca-certificates/extracted/tls-ca-bundle.pem "${pkgdir}/opt/.cisco/certificates/ca/system-ca.pem"
  92.  
  93. # install custom policy to disable auto updates
  94. # AnyConnect will attempt to update itself as root, and then run all over both itself and our packaging
  95. # so prevent it from doing anything like that
  96. #
  97. # this may break some really quirky setups that require downloading files from the server,
  98. # but there's no other way around it that I could find
  99. install -Dm644 "${srcdir}/AnyConnectLocalPolicy.xml" "${pkgdir}/opt/cisco/anyconnect/AnyConnectLocalPolicy.xml"
  100. }
  101. md5sums=('6427cc695ed556b2ef8d8f247f658e43'
  102. '8654e46106048d5e32a4695bac98cd05'
  103. '52b8acbee4eb3892e6f88d50e55feb99'
  104. '70b4e3b0b7be2b7c637fc03dd14b7a49'
  105. '0880528d636c98e626dcc96ae0841f6a')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement