Github messages for voidlinux
 help / color / mirror / Atom feed
From: b-l-a-i-n-e <b-l-a-i-n-e@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: 1password-8.4.1
Date: Wed, 08 Dec 2021 23:18:39 +0100	[thread overview]
Message-ID: <20211208221839.tdb7IxqTyvtRAjf793Je6_VY8_Mz6F7Z-64-WMXS1x0@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-34427@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 661 bytes --]

There is an updated pull request by b-l-a-i-n-e against master on the void-packages repository

https://github.com/b-l-a-i-n-e/void-packages 1password
https://github.com/void-linux/void-packages/pull/34427

New package: 1password-8.4.1
#### Testing the changes
- I tested the changes in this PR: YES

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): YES

#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)


A patch file from https://github.com/void-linux/void-packages/pull/34427.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-1password-34427.patch --]
[-- Type: text/x-diff, Size: 8818 bytes --]

From 56344db022a0ea486fdc0cf5496e18ce5711a160 Mon Sep 17 00:00:00 2001
From: b-l-a-i-n-e <blaine.gilbreth@gmail.com>
Date: Wed, 8 Dec 2021 01:35:46 -0800
Subject: [PATCH 1/3] New package: 1password-8.4.1

---
 srcpkgs/1password/INSTALL  | 20 ++++++++++++++++++
 srcpkgs/1password/REMOVE   | 10 +++++++++
 srcpkgs/1password/template | 42 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 72 insertions(+)
 create mode 100644 srcpkgs/1password/INSTALL
 create mode 100644 srcpkgs/1password/REMOVE
 create mode 100644 srcpkgs/1password/template

diff --git a/srcpkgs/1password/INSTALL b/srcpkgs/1password/INSTALL
new file mode 100644
index 000000000000..269d27d84964
--- /dev/null
+++ b/srcpkgs/1password/INSTALL
@@ -0,0 +1,20 @@
+# INSTALL
+case "${ACTION}" in
+post)
+	install -Dm0644 opt/1Password/com.1password.1Password.policy -t /usr/share/polkit-1/actions/
+	install -Dm0644 opt/1Password/resources/custom_allowed_browsers -t /usr/share/doc/1password/examples/
+
+	chmod 4755 opt/1Password/chrome-sandbox
+
+	groupadd -f onepassword
+
+	chown :onepassword opt/1Password/1Password-KeyringHelper
+	chmod u+s opt/1Password/1Password-KeyringHelper
+	chmod g+s opt/1Password/1Password-KeyringHelper
+
+	chown :onepassword opt/1Password/1Password-BrowserSupport
+	chmod g+s opt/1Password/1Password-BrowserSupport
+
+	ln -sf /opt/1Password/1password /usr/bin/1password
+	;;
+esac
diff --git a/srcpkgs/1password/REMOVE b/srcpkgs/1password/REMOVE
new file mode 100644
index 000000000000..f30e3442e35e
--- /dev/null
+++ b/srcpkgs/1password/REMOVE
@@ -0,0 +1,10 @@
+# REMOVE
+case "${ACTION}" in
+post)
+	rm /usr/share/polkit-1/actions/com.1password.1Password.policy
+	# Remove docs
+	rm -rf /usr/share/doc/1password
+	# Cleanup symlink
+	rm /usr/bin/1password
+	;;
+esac
diff --git a/srcpkgs/1password/template b/srcpkgs/1password/template
new file mode 100644
index 000000000000..ad0ca10bfdfb
--- /dev/null
+++ b/srcpkgs/1password/template
@@ -0,0 +1,42 @@
+# Template file for '1password'
+pkgname=1password
+version=8.4.1
+revision=1
+_filename="1password-latest.tar.gz"
+_1passworddir="1password-${version}.x64"
+archs="x86_64"
+create_wrksrc=yes
+build_style=fetch
+hostmakedepends="curl w3m libcurl"
+short_desc="Password manager"
+maintainer="b-l-a-i-n-e <blaine.gilbreth@gmail.com>"
+license="custom:Proprietary"
+homepage="https://www.1password.com"
+distfiles="https://downloads.1password.com/linux/tar/stable/x86_64/${_filename}"
+checksum=f5c2468127c363b3a3d2fa5857b6ff0979eeaf1485c1afb114b3929c1fc4a7df
+_license_checksum=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
+repository=nonfree
+restricted=yes
+nostrip=yes
+noshlibprovides=yes
+
+post_extract() {
+	curl -Llhttps://1password.com/legal/terms-of-service/ |
+		w3m -dump -I utf-8 -T text/html |
+		sed -n '/Service Agreement for 1Password/,/We clarified what happens if we part ways./p' > EULA
+
+	filesum="$(xbps-digest EULA)"
+	if [ "$filesum" != "$_license_checksum" ]; then
+		msg_error "SHA256 mismatch for EULA:\n$filesum\n"
+	fi
+}
+
+do_build() {
+	bsdtar -xf "${_filename}"
+}
+
+do_install() {
+	vmkdir opt/1Password
+	vcopy "${_1passworddir}/*" opt/1Password
+	vlicense EULA
+}

From 1322e69d971956e0a2ea8398dfe3826dfbbc56df Mon Sep 17 00:00:00 2001
From: b-l-a-i-n-e <blaine.gilbreth@gmail.com>
Date: Wed, 8 Dec 2021 14:10:09 -0800
Subject: [PATCH 2/3] Address PR comments

- usr populated at build time instead of INSTALL
- add group using system_groups
- specify version instead of latest
- drop build_style
- also adds gpg verify
---
 srcpkgs/1password/INSTALL         |  9 ---------
 srcpkgs/1password/REMOVE          | 10 ----------
 srcpkgs/1password/files/1password |  2 ++
 srcpkgs/1password/template        | 32 ++++++++++++++++++++++---------
 4 files changed, 25 insertions(+), 28 deletions(-)
 delete mode 100644 srcpkgs/1password/REMOVE
 create mode 100644 srcpkgs/1password/files/1password

diff --git a/srcpkgs/1password/INSTALL b/srcpkgs/1password/INSTALL
index 269d27d84964..c4ec5e9b3720 100644
--- a/srcpkgs/1password/INSTALL
+++ b/srcpkgs/1password/INSTALL
@@ -1,20 +1,11 @@
 # INSTALL
 case "${ACTION}" in
 post)
-	install -Dm0644 opt/1Password/com.1password.1Password.policy -t /usr/share/polkit-1/actions/
-	install -Dm0644 opt/1Password/resources/custom_allowed_browsers -t /usr/share/doc/1password/examples/
-
 	chmod 4755 opt/1Password/chrome-sandbox
-
-	groupadd -f onepassword
-
 	chown :onepassword opt/1Password/1Password-KeyringHelper
 	chmod u+s opt/1Password/1Password-KeyringHelper
 	chmod g+s opt/1Password/1Password-KeyringHelper
-
 	chown :onepassword opt/1Password/1Password-BrowserSupport
 	chmod g+s opt/1Password/1Password-BrowserSupport
-
-	ln -sf /opt/1Password/1password /usr/bin/1password
 	;;
 esac
diff --git a/srcpkgs/1password/REMOVE b/srcpkgs/1password/REMOVE
deleted file mode 100644
index f30e3442e35e..000000000000
--- a/srcpkgs/1password/REMOVE
+++ /dev/null
@@ -1,10 +0,0 @@
-# REMOVE
-case "${ACTION}" in
-post)
-	rm /usr/share/polkit-1/actions/com.1password.1Password.policy
-	# Remove docs
-	rm -rf /usr/share/doc/1password
-	# Cleanup symlink
-	rm /usr/bin/1password
-	;;
-esac
diff --git a/srcpkgs/1password/files/1password b/srcpkgs/1password/files/1password
new file mode 100644
index 000000000000..c1c521260437
--- /dev/null
+++ b/srcpkgs/1password/files/1password
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /opt/1Password/1password "$@"
diff --git a/srcpkgs/1password/template b/srcpkgs/1password/template
index ad0ca10bfdfb..6bad3bd33a1e 100644
--- a/srcpkgs/1password/template
+++ b/srcpkgs/1password/template
@@ -2,41 +2,55 @@
 pkgname=1password
 version=8.4.1
 revision=1
-_filename="1password-latest.tar.gz"
 _1passworddir="1password-${version}.x64"
+_filename="${_1passworddir}.tar.gz"
 archs="x86_64"
 create_wrksrc=yes
-build_style=fetch
-hostmakedepends="curl w3m libcurl"
+hostmakedepends="curl w3m libcurl gnupg"
+system_groups="onepassword"
 short_desc="Password manager"
 maintainer="b-l-a-i-n-e <blaine.gilbreth@gmail.com>"
 license="custom:Proprietary"
 homepage="https://www.1password.com"
 distfiles="https://downloads.1password.com/linux/tar/stable/x86_64/${_filename}"
 checksum=f5c2468127c363b3a3d2fa5857b6ff0979eeaf1485c1afb114b3929c1fc4a7df
-_license_checksum=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
+_license_checksum=b8f6ff9297488416f3d8063a151109ed5e8a2df6fa546856a4beaa715cbc0fda
+_gpg_key=3FEF9748469ADBE15DA7CA80AC2D62742012EA22
 repository=nonfree
 restricted=yes
 nostrip=yes
 noshlibprovides=yes
 
-post_extract() {
-	curl -Llhttps://1password.com/legal/terms-of-service/ |
+post_fetch() {
+	# verify gpg key
+	curl -L "${distfiles}.sig" > "${_filename}.sig"
+	if ! gpg --recv-keys "${_gpg_key}"; then
+		msg_error "Incorrect gpg key: ${_gpg_key}\n"
+	fi
+	if ! gpg --verify "${_filename}.sig" "${_filename}"; then
+		msg_error "gpg verify failed\n"
+	fi
+
+	# verify EULA
+	curl -L https://1password.com/legal/terms-of-service/ |
 		w3m -dump -I utf-8 -T text/html |
 		sed -n '/Service Agreement for 1Password/,/We clarified what happens if we part ways./p' > EULA
-
 	filesum="$(xbps-digest EULA)"
 	if [ "$filesum" != "$_license_checksum" ]; then
 		msg_error "SHA256 mismatch for EULA:\n$filesum\n"
 	fi
 }
 
-do_build() {
-	bsdtar -xf "${_filename}"
+post_extract() {
+	# copy the verified EULA
+	cp "${XBPS_SRCDISTDIR}/${pkgname}-${version}/EULA" "${wrksrc}"
 }
 
 do_install() {
 	vmkdir opt/1Password
 	vcopy "${_1passworddir}/*" opt/1Password
+	vinstall "${_1passworddir}/com.1password.1Password.policy" 644 usr/share/polkit-1/actions/
+	vinstall "${_1passworddir}/resources/custom_allowed_browsers" 644 usr/share/doc/1password/examples/
+	vbin "${FILESDIR}/1password"
 	vlicense EULA
 }

From f1fb050b7d743d9fd17f01c4afe40c9e7d437eea Mon Sep 17 00:00:00 2001
From: b-l-a-i-n-e <blaine.gilbreth@gmail.com>
Date: Wed, 8 Dec 2021 14:18:39 -0800
Subject: [PATCH 3/3] Fix lint error

---
 srcpkgs/1password/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/1password/template b/srcpkgs/1password/template
index 6bad3bd33a1e..2a3ea9570958 100644
--- a/srcpkgs/1password/template
+++ b/srcpkgs/1password/template
@@ -7,13 +7,13 @@ _filename="${_1passworddir}.tar.gz"
 archs="x86_64"
 create_wrksrc=yes
 hostmakedepends="curl w3m libcurl gnupg"
-system_groups="onepassword"
 short_desc="Password manager"
 maintainer="b-l-a-i-n-e <blaine.gilbreth@gmail.com>"
 license="custom:Proprietary"
 homepage="https://www.1password.com"
 distfiles="https://downloads.1password.com/linux/tar/stable/x86_64/${_filename}"
 checksum=f5c2468127c363b3a3d2fa5857b6ff0979eeaf1485c1afb114b3929c1fc4a7df
+system_groups="onepassword"
 _license_checksum=b8f6ff9297488416f3d8063a151109ed5e8a2df6fa546856a4beaa715cbc0fda
 _gpg_key=3FEF9748469ADBE15DA7CA80AC2D62742012EA22
 repository=nonfree

  parent reply	other threads:[~2021-12-08 22:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08  9:46 [PR PATCH] " b-l-a-i-n-e
2021-12-08  9:48 ` b-l-a-i-n-e
2021-12-08  9:49 ` b-l-a-i-n-e
2021-12-08  9:50 ` b-l-a-i-n-e
2021-12-08 17:31 ` Chocimier
2021-12-08 22:11 ` [PR PATCH] [Updated] " b-l-a-i-n-e
2021-12-08 22:18 ` b-l-a-i-n-e [this message]
2021-12-08 22:23 ` b-l-a-i-n-e
2021-12-08 23:15 ` b-l-a-i-n-e
2021-12-09 17:28 ` b-l-a-i-n-e
2021-12-13 18:54 ` [PR PATCH] [Updated] " b-l-a-i-n-e
2021-12-13 19:36 ` Chocimier
2021-12-13 19:37 ` Chocimier
2021-12-13 19:38 ` Chocimier
2021-12-15 20:09 ` [PR PATCH] [Merged]: " Chocimier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211208221839.tdb7IxqTyvtRAjf793Je6_VY8_Mz6F7Z-64-WMXS1x0@z \
    --to=b-l-a-i-n-e@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).