diff --git a/app-admin/1password/1password-8.12.12.ebuild b/app-admin/1password/1password-8.12.12.ebuild new file mode 100644 index 0000000..f941f72 --- /dev/null +++ b/app-admin/1password/1password-8.12.12.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 +# shellcheck shell=bash + +EAPI=8 + +inherit desktop xdg + +DESCRIPTION="Password Manager" +HOMEPAGE="https://1password.com" +SRC_URI=" + amd64? ( https://downloads.1password.com/linux/tar/stable/x86_64/${PN}-${PV}.x64.tar.gz -> ${P}-amd64.tar.gz ) + arm64? ( https://downloads.1password.com/linux/tar/stable/aarch64/${PN}-${PV}.arm64.tar.gz -> ${P}-arm64.tar.gz )" + +LICENSE="all-rights-reserved" +KEYWORDS="amd64 arm64" +IUSE="policykit cli" +DEPEND=" +x11-misc/xdg-utils +acct-group/onepassword +policykit? ( sys-auth/polkit ) +cli? ( app-admin/op-cli-bin ) +" +RDEPEND="${DEPEND}" +SLOT="0" + +RESTRICT="bindist mirror strip" + +QA_PREBUILT="usr/bin/${MY_PN}" + +S="${WORKDIR}" + +src_prepare() { + default + xdg_environment_reset +} + +src_install() { + mkdir -p "${D}/opt/1Password/" + cp -ar "${S}/${PN}-"**"/"* "${D}/opt/1Password/" || die "Install failed!" + + # Fill in policy kit file with a list of (the first 10) human users of + # the system. + mkdir -p "${D}/usr/share/polkit-1/actions/" + 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 <"${D}/usr/share/polkit-1/actions/com.1password.1Password.policy" + chmod 644 "${D}/usr/share/polkit-1/actions/com.1password.1Password.policy" + + dosym /opt/1Password/1password /usr/bin/1password + dosym /opt/1Password/op-ssh-sign /usr/bin/op-ssh-sign + + dosym /opt/1Password/resources/1password.desktop "/usr/share/applications/${PN}.desktop" + newicon "${D}/opt/1Password/resources/icons/hicolor/512x512/apps/1password.png" "${PN}.png" + + dodoc "${D}/opt/1Password/resources/custom_allowed_browsers" +} + +pkg_postinst() { + # chrome-sandbox requires the setuid bit to be specifically set. + # See https://github.com/electron/electron/issues/17972 + chmod 4755 /opt/1Password/chrome-sandbox + + # This gives no extra permissions to the binary. It only hardens it against environmental tampering. + chgrp onepassword /opt/1Password/1Password-BrowserSupport + chmod g+s /opt/1Password/1Password-BrowserSupport + + xdg_pkg_postinst +} + +pkg_postrm() { + xdg_icon_cache_update + xdg_desktop_database_update + xdg_mimeinfo_database_update +} diff --git a/app-admin/1password/Manifest b/app-admin/1password/Manifest new file mode 100644 index 0000000..0c2bbae --- /dev/null +++ b/app-admin/1password/Manifest @@ -0,0 +1,2 @@ +DIST 1password-8.12.12-amd64.tar.gz 198731835 BLAKE2B 8f0565e37eb346c53ad5615a5fbf1e97c34c555ca6f5542c88ac3932295ae23707e0c984cc57d76dade75282f7400c075b6cc9be605bc4e07bc65b7d9883fab6 SHA512 4fc82feb9bc00688d9b0064585e2152f365b83a44c080f6038c02ce107b13ba75167d8c49c3a8788daf60dc9c802c2160f4ad312d4b72b413e94b69fd7b79c6d +DIST 1password-8.12.12-arm64.tar.gz 197274974 BLAKE2B 5d1bce4e2a8bbcb5b83bb06a5959b49c57739a2bc6dbf9df1dd737ee8445acb0d57fbb637dadd54b87bfee8c4252399bc548155b6ebe1e029a5df7f79b04134d SHA512 e91f4d820a37f5f16768d8109a378cd4e94b98a2651f63cc727444fcd2d87d32bbecbcf43360ded6f90725b0a12d654fde88068d6a6fb77229e3f2d71412929c