Skip to content

Instantly share code, notes, and snippets.

@aalmiray
Created December 1, 2021 21:18
Show Gist options
  • Save aalmiray/b498e4964bde59790a3f16f69188ed5a to your computer and use it in GitHub Desktop.
Save aalmiray/b498e4964bde59790a3f16f69188ed5a to your computer and use it in GitHub Desktop.
Name: jbang
Version: 0.83.1.11
Release: 1%{?dist}
Summary: Unleash the power of Java
License: MIT
URL: https://jbang.dev
Source0: https://github.com/aalmiray/jbang/releases/download/v0.83.1.11/jbang-0.83.1.11.tar
BuildArch: noarch
Requires: java
%description
Unleash the power of Java.
Use `jbang` to run java, jar, jsh or kt file(s) with automatic dependency fetching
and immediate compilation and execution.
%prep
%setup -q
%install
mkdir -p %{buildroot}%{_bindir}
%define _appdir %{buildroot}%{_datadir}/%{name}
mkdir -p %{_appdir}/bin
cat > %{buildroot}%{_bindir}/jbang <<-EOF
#!/bin/sh
%{_datadir}/%{name}/bin/jbang "$@"
EOF
chmod 0755 %{buildroot}%{_bindir}/jbang
mkdir -p %{_appdir}/bin
install -p -m 755 bin/jbang %{_appdir}/bin/jbang
install -p -m 644 bin/jbang.jar %{_appdir}/bin/jbang.jar
install -p -m 644 bin/jbang.ps1 %{_appdir}/bin/jbang.ps1
install -p -m 644 version.txt %{_appdir}/version.txt
%files
%{_bindir}/%{name}
%{_datadir}/%{name}/bin/jbang
%{_datadir}/%{name}/bin/jbang.jar
%{_datadir}/%{name}/bin/jbang.ps1
%{_datadir}/%{name}/version.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment