commit:     c7737650e9b4faaa9069cf70a62d4816a16e4238
Author:     Rahil Bhimjiani <me <AT> rahil <DOT> rocks>
AuthorDate: Sun Feb 25 01:06:24 2024 +0000
Commit:     Rahil Bhimjiani <rahil3108 <AT> gmail <DOT> com>
CommitDate: Mon Feb 26 05:47:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c7737650

app-admin/bitwarden-cli: frontend to Bitwarden compatible servers

Initial 2024.2.0

Signed-off-by: Rahil Bhimjiani <me <AT> rahil.rocks>

 app-admin/bitwarden-cli/Manifest                   |  3 ++
 .../bitwarden-cli/bitwarden-cli-2024.2.0.ebuild    | 61 ++++++++++++++++++++++
 app-admin/bitwarden-cli/metadata.xml               | 15 ++++++
 3 files changed, 79 insertions(+)

diff --git a/app-admin/bitwarden-cli/Manifest b/app-admin/bitwarden-cli/Manifest
new file mode 100644
index 0000000000..c7b8232019
--- /dev/null
+++ b/app-admin/bitwarden-cli/Manifest
@@ -0,0 +1,3 @@
+DIST bitwarden-cli-2024.2.0-pkg-cache.tar.xz 13081348 BLAKE2B 
c0f56169752a8659f4a42b36a1fb48604d968a82853f8a860fb03455b499be03ba6cdacc643188b86c3673ffa26ab8ed2a825bdf6a37996189f851ad5e638b5b
 SHA512 
f1de3477537b9f95dc38353ce1bf1d22e7cf8b92b0012befe2c0db4c62dd1f7fc419ba06518318fed90deb9a8627e35422daee8ba70f07e02f3c8eb43678a7c1
+DIST bitwarden-cli-2024.2.0.tar.gz 20328706 BLAKE2B 
0f8120b7ddbf74a6e5c3d7a63ad72dd3ecea3f32c46b488b21bfa2ca877724841a5dd9318854a0204dc7015ea104ffed0783a8301bf57a53f9a5d4b9d1ff18e1
 SHA512 
8a9f69242a945b17c944c699649b9f2524d5ae3b07f97d296ae01bde44b9081b9262fa80028c28a1f876ce789d4daac103d2c15c01a9af07e5c7159f43d427b6
+DIST bitwarden-clients-a1a5c4b.tar.xz 204680568 BLAKE2B 
dd7ae09792831dacf9e7c110a508315e8d57c3231c6c32014e7b842ffc01a046fec03f375c48afd40379ba2853159e594a54b3f8ec229c1568ba3d1b8c054335
 SHA512 
5644d0b53c525164c2af14036dd7d432be9a943b55df2aef9922329326b164b31336bd53e2f9f2eb35a858f974d8fc0a3bd3aac6e42b821d5d4634ca714a51c3

diff --git a/app-admin/bitwarden-cli/bitwarden-cli-2024.2.0.ebuild 
b/app-admin/bitwarden-cli/bitwarden-cli-2024.2.0.ebuild
new file mode 100644
index 0000000000..8258f2c576
--- /dev/null
+++ b/app-admin/bitwarden-cli/bitwarden-cli-2024.2.0.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit check-reqs shell-completion
+
+DESCRIPTION="CLI frontend client connects to Bitwarden comapatible password 
manager server"
+HOMEPAGE="https://github.com/bitwarden/clients/tree/main/apps/cli";
+
+BW_CLIENTS_COMMIT="a1a5c4b"
+SRC_URI="
+       
https://github.com/bitwarden/clients/archive/refs/tags/cli-v${PV}.tar.gz -> 
${P}.tar.gz
+       
https://github.com/rahilarious/gentoo-distfiles/releases/download/bitwarden-clients-${BW_CLIENTS_COMMIT}/deps.tar.xz
 -> bitwarden-clients-${BW_CLIENTS_COMMIT}.tar.xz
+       
https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/pkg-cache.tar.xz
 -> ${P}-pkg-cache.tar.xz
+"
+
+S="${WORKDIR}/clients-cli-v${PV}"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+
+# non-stripped binary is of 99M but works
+# stripped  bianry is of 44M but doesnt work
+RESTRICT='strip'
+
+RDEPEND="!app-admin/bitwarden-cli-bin"
+BDEPEND="
+       net-libs/nodejs:0/18[npm]
+"
+
+QA_PRESTRIPPED="usr/bin/bw"
+
+CHECKREQS_MEMORY=2G
+CHECKREQS_DISK_BUILD=2G
+
+pkg_pretend() {
+       einfo ""
+       einfo "#################################################"
+       einfo "Precompiled alternative to this package is available:"
+       einfo "        ${CATEGORY}/${PN}-bin"
+       einfo "#################################################"
+       einfo ""
+       check-reqs_pkg_pretend
+}
+
+src_prepare() {
+       default
+       mv -v ../node_modules ./ || die
+}
+
+src_compile() {
+       pushd apps/cli
+       PKG_CACHE_PATH="${WORKDIR}"/.pkg-cache npm --verbose --offline run 
dist:lin || die "Build failed! Try prebuilt from upstream ${CATEGORY}/${PN}-bin"
+       ./dist/linux/bw completion --shell zsh > bw.zsh
+}
+
+src_install() {
+       dobin apps/cli/dist/linux/bw
+       newzshcomp apps/cli/bw.zsh _bw
+}

diff --git a/app-admin/bitwarden-cli/metadata.xml 
b/app-admin/bitwarden-cli/metadata.xml
new file mode 100644
index 0000000000..120e3e571a
--- /dev/null
+++ b/app-admin/bitwarden-cli/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>me@rahil.rocks</email>
+               <name>Rahil Bhimjiani</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">bitwarden/clients</remote-id>
+               <bugs-to>https://github.com/bitwarden/clients/issues</bugs-to>
+               
<doc>https://github.com/bitwarden/clients/tree/main/apps/cli</doc>
+               
<doc>https://contributing.bitwarden.com/getting-started/clients/cli/</doc>
+               <doc>https://bitwarden.com/help/cli/</doc>
+       </upstream>
+</pkgmetadata>

Reply via email to