From feeb408e70f0110740b4532b6cf0a7c2b4e4f079 Mon Sep 17 00:00:00 2001 From: madomado Date: Thu, 16 May 2024 18:51:19 +0800 Subject: [PATCH] add: bruno --- anda/devs/bruno/anda.hcl | 5 ++ anda/devs/bruno/bruno.sh | 2 + anda/devs/bruno/bruno.spec | 56 +++++++++++++++++++ .../devs/bruno/com.usebruno.app.Bruno.desktop | 9 +++ anda/devs/bruno/update.rhai | 1 + 5 files changed, 73 insertions(+) create mode 100644 anda/devs/bruno/anda.hcl create mode 100644 anda/devs/bruno/bruno.sh create mode 100644 anda/devs/bruno/bruno.spec create mode 100644 anda/devs/bruno/com.usebruno.app.Bruno.desktop create mode 100644 anda/devs/bruno/update.rhai diff --git a/anda/devs/bruno/anda.hcl b/anda/devs/bruno/anda.hcl new file mode 100644 index 0000000000..150c7bf68d --- /dev/null +++ b/anda/devs/bruno/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "bruno.spec" + } +} diff --git a/anda/devs/bruno/bruno.sh b/anda/devs/bruno/bruno.sh new file mode 100644 index 0000000000..660603c428 --- /dev/null +++ b/anda/devs/bruno/bruno.sh @@ -0,0 +1,2 @@ +%!/usr/bin/sh +ELECTRON_IS_DEV=0 exec electron /usr/lib64/bruno "\$@" diff --git a/anda/devs/bruno/bruno.spec b/anda/devs/bruno/bruno.spec new file mode 100644 index 0000000000..5b36677f98 --- /dev/null +++ b/anda/devs/bruno/bruno.spec @@ -0,0 +1,56 @@ +Name: bruno +Version: 1.17.0 +Release: 1%?dist +Summary: Opensource API Client for Exploring and Testing APIs +License: MIT +URL: https://www.usebruno.com +Source0: https://github.com/usebruno/bruno/archive/refs/tags/v%version.tar.gz +Source1: com.usebruno.app.Bruno.desktop +Requires: electron alsa-lib +BuildRequires: nodejs-npm asar electron + +%description +Bruno is a new and innovative API client, aimed at revolutionizing the status quo represented by Postman and similar tools out there. + +%prep +%autosetup + +# ref aur +# disabling husky however I can since I'm not in a git repository +sed -i -e 's/"husky":.*//g' -e 's/"husky install"/"true"/g' package.json + +%build +export NODE_ENV=production +export NODE_OPTIONS=--openssl-legacy-provider + +npm i --include=dev +npm run build:bruno-query +npm run build:bruno-common +npm run build:graphql-docs +npm run build:web + +electronDist="%_libdir/electron" +electronVer="$(cat ${electronDist}/version)" +sed -i -e "s~\"dist:linux\":.*~\"dist:linux\": \"electron-builder --linux --x64 --dir --config electron-builder-config.js -c.electronDist=${electronDist} -c.electronVersion=${electronVer}\",~g" packages/bruno-electron/package.json + +npm run build:electron:linux + +%install +mkdir -p %buildroot%_datadir/applications/ +install -Dm644 %SOURCE1 %buildroot%_datadir/applications/ +install -Dm755 %SOURCE2 %buildroot%_bindir/bruno + +install -d %buildroot%_libdir/bruno +asar e packages/bruno-electron/out/linux-unpacked/resources/app.asar %buildroot%_libdir/bruno/ + +for i in 16 24 48 64 128 256 512 1024; do + install -Dm644 "packages/bruno-electron/resources/icons/png/${i}x${i}.png" "%buildroot%_iconsdir/hicolor/${i}x${i}/apps/com.usebruno.app.Bruno.png" +done + +%files +%doc readme.md +%license license.md +%_bindir/bruno/ +%_libdir/bruno/ +%_datadir/applications/com.usebruno.app.Bruno.desktop +%_iconsdir/hicolor/*/apps/com.usebruno.app.Bruno.png diff --git a/anda/devs/bruno/com.usebruno.app.Bruno.desktop b/anda/devs/bruno/com.usebruno.app.Bruno.desktop new file mode 100644 index 0000000000..a3e7883636 --- /dev/null +++ b/anda/devs/bruno/com.usebruno.app.Bruno.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Bruno +Comment=Opensource API Client for Exploring and Testing APIs +Exec=/usr/bin/bruno %u +Terminal=false +Type=Application +Icon=com.usebruno.app.Bruno +StartupWMClass=Bruno +Categories=Development; diff --git a/anda/devs/bruno/update.rhai b/anda/devs/bruno/update.rhai new file mode 100644 index 0000000000..b3d2f356c9 --- /dev/null +++ b/anda/devs/bruno/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("usebruno/bruno"));