From ec21f1f4f2f1d2d04bb1cf8b1f7a8b9b3d0eaae1 Mon Sep 17 00:00:00 2001 From: madomado Date: Tue, 6 Feb 2024 17:18:22 +0800 Subject: [PATCH] add: ollama --- anda/langs/go/ollama/anda.hcl | 5 ++ .../golang-github-jmorganca-ollama.spec | 62 +++++++++++++++++++ anda/langs/go/ollama/update.rhai | 1 + 3 files changed, 68 insertions(+) create mode 100644 anda/langs/go/ollama/anda.hcl create mode 100644 anda/langs/go/ollama/golang-github-jmorganca-ollama.spec create mode 100644 anda/langs/go/ollama/update.rhai diff --git a/anda/langs/go/ollama/anda.hcl b/anda/langs/go/ollama/anda.hcl new file mode 100644 index 0000000000..b185d67511 --- /dev/null +++ b/anda/langs/go/ollama/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "golang-github-jmorganca-ollama.spec" + } +} diff --git a/anda/langs/go/ollama/golang-github-jmorganca-ollama.spec b/anda/langs/go/ollama/golang-github-jmorganca-ollama.spec new file mode 100644 index 0000000000..7d23cb9ea3 --- /dev/null +++ b/anda/langs/go/ollama/golang-github-jmorganca-ollama.spec @@ -0,0 +1,62 @@ +# Generated by go2rpm 1.9.0 +%bcond_without check + +# https://github.com/jmorganca/ollama +%global goipath github.com/jmorganca/ollama +Version: 0.1.23 + +%gometa -f + + +%global common_description %{expand: +Get up and running with Llama 2, Mistral, and other large language models +locally.} + +%global golicenses LICENSE +%global godocs docs examples README.md app/README.md\\\ + llm/ext_server/README.md + +Name: %{goname} +Release: %autorelease +Summary: Get up and running with Llama 2, Mistral, and other large language models locally + +License: MIT AND Apache-2.0 +URL: %{gourl} +Source: %{gosource} + +%description %{common_description} + +%gopkg + +%prep +%goprep +%autopatch -p1 +go mod download + +%build +for cmd in cmd/* ; do + go build -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -s -w -extldflags '--static-pie'" -buildmode=pie -tags 'osusergo,netgo,static_build' -v -x -o %{gobuilddir}/bin/$(basename $cmd) . + go tool buildid -w %{gobuilddir}/bin/$(basename $cmd) +done +go build -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -s -w -extldflags '--static-pie'" -buildmode=pie -tags 'osusergo,netgo,static_build' -v -x -o %{gobuilddir}/bin/ollama . +go tool buildid -w %{gobuilddir}/bin/ollama + +%install +%gopkginstall +install -m 0755 -vd %{buildroot}%{_bindir} +install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ + +%if %{with check} +%check +%gocheck +%endif + +%files +%license LICENSE +%doc docs examples README.md app/README.md llm/ext_server/README.md +%{_bindir}/* + +%gopkgfiles + +%changelog +%autochangelog diff --git a/anda/langs/go/ollama/update.rhai b/anda/langs/go/ollama/update.rhai new file mode 100644 index 0000000000..ae91bbdbed --- /dev/null +++ b/anda/langs/go/ollama/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("ollama/ollama"));