mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-11 08:03:16 -04:00
gui-apps/1password: QA fixups
- Whitespace fixes - Drop superfluous USE - Add original committer to metadata.xml - replace `eval` with `sed` - `dosym` Signed-off-by: Matt Jolly <kangie@gentoo.org>
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
EAPI=8
|
EAPI=8
|
||||||
|
|
||||||
inherit desktop xdg
|
inherit desktop optfeature xdg
|
||||||
|
|
||||||
DESCRIPTION="Password Manager"
|
DESCRIPTION="Password Manager"
|
||||||
HOMEPAGE="https://1password.com"
|
HOMEPAGE="https://1password.com"
|
||||||
@@ -13,66 +13,75 @@ SRC_URI="
|
|||||||
amd64? ( https://downloads.1password.com/linux/tar/stable/x86_64/${PN}-${PV}.x64.tar.gz -> ${P}-amd64.tar.gz )
|
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 )"
|
arm64? ( https://downloads.1password.com/linux/tar/stable/aarch64/${PN}-${PV}.arm64.tar.gz -> ${P}-arm64.tar.gz )"
|
||||||
|
|
||||||
|
S="${WORKDIR}"
|
||||||
LICENSE="all-rights-reserved"
|
LICENSE="all-rights-reserved"
|
||||||
KEYWORDS="~amd64 ~arm64"
|
|
||||||
IUSE="policykit cli"
|
|
||||||
DEPEND="
|
|
||||||
x11-misc/xdg-utils
|
|
||||||
acct-group/1password
|
|
||||||
policykit? ( sys-auth/polkit )
|
|
||||||
cli? ( app-admin/op-cli-bin )
|
|
||||||
"
|
|
||||||
RDEPEND="${DEPEND}"
|
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
|
|
||||||
|
KEYWORDS="~amd64 ~arm64"
|
||||||
|
IUSE="policykit"
|
||||||
RESTRICT="bindist mirror strip"
|
RESTRICT="bindist mirror strip"
|
||||||
|
|
||||||
QA_PREBUILT="usr/bin/${MY_PN}"
|
DEPEND="
|
||||||
|
x11-misc/xdg-utils
|
||||||
|
acct-group/1password
|
||||||
|
"
|
||||||
|
RDEPEND="${DEPEND}"
|
||||||
|
|
||||||
S="${WORKDIR}"
|
QA_PREBUILT="/opt/1Password/*"
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
xdg_environment_reset
|
xdg_environment_reset
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
mkdir -p "${D}/opt/1Password/"
|
mkdir -p "${D}/opt/1Password/"
|
||||||
cp -ar "${S}/${PN}-"**"/"* "${D}/opt/1Password/" || die "Install failed!"
|
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
|
# Fill in policy kit file with a list of (the first 10) human users of
|
||||||
# the system.
|
# the system.
|
||||||
mkdir -p "${D}/usr/share/polkit-1/actions/"
|
mkdir -p "${D}/usr/share/polkit-1/actions/"
|
||||||
export POLICY_OWNERS
|
local 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' ' ')"
|
policy_owners="$(cut -d: -f1,3 /etc/passwd \
|
||||||
eval "cat <<EOF
|
| grep -E ':[0-9]{4}$' \
|
||||||
$(cat "${D}/opt/1Password/com.1password.1Password.policy.tpl")
|
| cut -d: -f1 \
|
||||||
EOF" >"${D}/usr/share/polkit-1/actions/com.1password.1Password.policy"
|
| head -n 10 \
|
||||||
chmod 644 "${D}/usr/share/polkit-1/actions/com.1password.1Password.policy"
|
| sed 's/^/unix-user:/' \
|
||||||
|
| tr '\n' ' ')"
|
||||||
|
sed -e "s/\${POLICY_OWNERS}/${policy_owners}/" \
|
||||||
|
"${D}/opt/1Password/com.1password.1Password.policy.tpl" \
|
||||||
|
> "${D}/usr/share/polkit-1/actions/com.1password.1Password.policy" ||
|
||||||
|
die "Failed to create policy file"
|
||||||
|
|
||||||
dosym /opt/1Password/1password /usr/bin/1password
|
chmod 644 "${D}/usr/share/polkit-1/actions/com.1password.1Password.policy"
|
||||||
dosym /opt/1Password/op-ssh-sign /usr/bin/op-ssh-sign
|
|
||||||
|
|
||||||
dosym /opt/1Password/resources/1password.desktop "/usr/share/applications/${PN}.desktop"
|
dosym "opt/1Password/1password" /usr/bin/1password
|
||||||
newicon "${D}/opt/1Password/resources/icons/hicolor/512x512/apps/1password.png" "${PN}.png"
|
dosym "opt/1Password/op-ssh-sign" /usr/bin/op-ssh-sign
|
||||||
|
|
||||||
dodoc "${D}/opt/1Password/resources/custom_allowed_browsers"
|
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() {
|
pkg_postinst() {
|
||||||
# chrome-sandbox requires the setuid bit to be specifically set.
|
# chrome-sandbox requires the setuid bit to be specifically set.
|
||||||
# See https://github.com/electron/electron/issues/17972
|
# See https://github.com/electron/electron/issues/17972
|
||||||
chmod 4755 /opt/1Password/chrome-sandbox
|
chmod 4755 /opt/1Password/chrome-sandbox
|
||||||
|
|
||||||
# This gives no extra permissions to the binary. It only hardens it against environmental tampering.
|
# This gives no extra permissions to the binary. It only hardens it against environmental tampering.
|
||||||
chgrp 1password /opt/1Password/1Password-BrowserSupport
|
chgrp 1password /opt/1Password/1Password-BrowserSupport
|
||||||
chmod g+s /opt/1Password/1Password-BrowserSupport
|
chmod g+s /opt/1Password/1Password-BrowserSupport
|
||||||
|
|
||||||
xdg_pkg_postinst
|
xdg_pkg_postinst
|
||||||
|
|
||||||
|
if [[ -z ${REPLACING_VERSIONS} ]]; then
|
||||||
|
optfeature "1Password CLI" app-admin/op-cli-bin
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_postrm() {
|
pkg_postrm() {
|
||||||
xdg_icon_cache_update
|
xdg_icon_cache_update
|
||||||
xdg_desktop_database_update
|
xdg_desktop_database_update
|
||||||
xdg_mimeinfo_database_update
|
xdg_mimeinfo_database_update
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||||
<pkgmetadata>
|
<pkgmetadata>
|
||||||
<!-- maintainer-needed -->
|
<maintainer type="person">
|
||||||
|
<email>sm+git@skym.fi</email>
|
||||||
|
<name>Skyler Mäntysaari</name>
|
||||||
|
</maintainer>
|
||||||
|
<longdescription>
|
||||||
|
1Password remembers all your passwords for you. It keeps your digital life secure and always available, safe behind the one password that only you know.
|
||||||
|
</longdescription>
|
||||||
</pkgmetadata>
|
</pkgmetadata>
|
||||||
|
|||||||
Reference in New Issue
Block a user