pkgname=1password-beta _tarver=8.12.24-31.BETA case "${CARCH}" in x86_64) _archdir="x64" ;; aarch64) _archdir="arm64" ;; esac pkgver=${_tarver//-/_} pkgrel=31.1 conflicts=('1password' '1password-beta-bin') pkgdesc="Password manager and secure wallet" arch=('x86_64' 'aarch64') url='https://1password.com' license=('LicenseRef-1Password-Proprietary') options=(!strip) install="1password.install" source=() sha256sums=() source_x86_64=(https://downloads.1password.com/linux/tar/beta/x86_64/1password-${_tarver}.x64.tar.gz{,.sig}) source_aarch64=(https://downloads.1password.com/linux/tar/beta/aarch64/1password-${_tarver}.arm64.tar.gz{,.sig}) sha256sums_x86_64=('67c9d0ccbe59d0ffcbab5a9cc9a326912e011d184572e653878f9bc6b8cea059' '2009e5282afb6f4d4fdb1f3537193de7fc30d37b2781534f5aebc7291f677327') sha256sums_aarch64=('46f37c269ff95d94aa260338965dc5e3c9b4989ab1ae00f7243bd9e49a8d4635' '9516c04b69fada825d520aa421e27e4642c624a077aa74bcee58272e470b7904') validpgpkeys=('3FEF9748469ADBE15DA7CA80AC2D62742012EA22') package() { depends=('hicolor-icon-theme' 'libgtk-3.so=0' 'nss' 'xdg-utils') # Go to source directory cd "1password-${_tarver}.${_archdir}" # Install icons resolutions=(32x32 64x64 256x256 512x512) for resolution in "${resolutions[@]}" do install -Dm0644 "resources/icons/hicolor/${resolution}/apps/1password.png" \ "${pkgdir}/usr/share/icons/hicolor/${resolution}/apps/1password.png" done # Install desktop file install -Dm0644 resources/1password.desktop -t "${pkgdir}"/usr/share/applications/ # Fill in policy kit file with a list of (the first 10) human users of the system. export POLICY_OWNERS POLICY_OWNERS="$(cut -d: -f1,3 /etc/passwd | grep -E ':[0-9]{4}$' | cut -d: -f1 | head -n 10 | sed 's/^/unix-user:/' | tr '\n' ' ')" eval "cat < ./com.1password.1Password.policy # Install system unlock PolKit policy file install -Dm0644 com.1password.1Password.policy -t "${pkgdir}"/usr/share/polkit-1/actions/ # Install examples install -Dm0644 resources/custom_allowed_browsers -t "${pkgdir}"/usr/share/doc/1password/examples/ # Move package contents to /opt/1Password cd "${srcdir}" install -dm0755 "${pkgdir}"/opt mv "1password-${_tarver}.${_archdir}" "${pkgdir}/opt/1Password" # Cleanup un-needed files rm "${pkgdir}"/opt/1Password/com.1password.1Password.policy "${pkgdir}"/opt/1Password/com.1password.1Password.policy.tpl "${pkgdir}"/opt/1Password/install_biometrics_policy.sh rm -r "${pkgdir}"/opt/1Password/resources/icons/ rm "${pkgdir}"/opt/1Password/resources/1password.desktop "${pkgdir}"/opt/1Password/resources/custom_allowed_browsers # Symlink /usr/bin executable to opt install -dm0755 "${pkgdir}"/usr/bin ln -s /opt/1Password/1password "${pkgdir}"/usr/bin/1password # chrome-sandbox requires the setuid bit to be specifically set. # See https://github.com/electron/electron/issues/17972 chmod 4755 "${pkgdir}"/opt/1Password/chrome-sandbox }