simple rpm package for the linux nightly binary #11373
sigmaSd
started this conversation in
Show and tell
Replies: 2 comments 2 replies
-
here is a newer one that downloads the url automaticly Name: zed
Version: nightly
Release: 1%{?dist}
Summary: Zed Nightly App
License: GPL
URL: https://github.com/zed-industries/zed
%define _disable_source_fetch 0
Source0: https://zed.dev/api/releases/nightly/latest/zed-linux-x86_64.tar.gz # NEW
BuildArch: x86_64
%description
Zed Nightly App
%prep
%setup -q -n zed-nightly.app
# Patch desktop file
sed -i 's/Icon=zed/Icon=dev.zed.Zed-Nightly/' share/applications/zed-nightly.desktop
%define debug_package %{nil}
%install
rm -rf %{buildroot}
install -d %{buildroot}/%{_bindir}
install -m 755 bin/zed %{buildroot}/%{_bindir}/zed
install -d %{buildroot}/%{_datadir}/applications
install -m 644 share/applications/zed-nightly.desktop %{buildroot}/%{_datadir}/applications/dev.zed.Zed-Nightly.desktop
install -d %{buildroot}/%{_datadir}/icons/hicolor/1024x1024/apps
install -m 644 share/icons/hicolor/1024x1024/apps/zed.png %{buildroot}/%{_datadir}/icons/hicolor/1024x1024/apps/dev.zed.Zed-Nightly.png
install -d %{buildroot}/%{_datadir}/icons/hicolor/512x512/apps
install -m 644 share/icons/hicolor/512x512/apps/zed.png %{buildroot}/%{_datadir}/icons/hicolor/512x512/apps/dev.zed.Zed-Nightly.png
%files
%{_bindir}/zed
%{_datadir}/applications/dev.zed.Zed-Nightly.desktop
%{_datadir}/icons/hicolor/1024x1024/apps/dev.zed.Zed-Nightly.png
%{_datadir}/icons/hicolor/512x512/apps/dev.zed.Zed-Nightly.png
%changelog
* Fri May 03 2024 sigmasd - nightly
- Initial package Also the version number doesn't seem to be published anywhere for now, so here is a deno script, that update the package by checking last-modifed header (it assumes #!/usr/bin/env -S deno run -A
import { $ } from "jsr:@david/dax@0.41.0";
$.setPrintCommand(true);
String.prototype.pipe = function (cb: any) {
return cb(this);
};
if (import.meta.main) {
const res = await fetch(
"https://zed.dev/api/releases/nightly/latest/zed-linux-x86_64.tar.gz",
);
const lastModified = res.headers.get("last-modified")
?.pipe((date) => new Date(date));
const maybeSavedDate = localStorage.getItem("lastModified");
if (!maybeSavedDate) {
// new update!
console.log("found new zed version");
console.log("update date:", maybeSavedDate);
await updateZed();
localStorage.setItem("lastModified", lastModified.toString());
} else {
if (lastModified > new Date(maybeSavedDate)) {
// new update!
console.log("found new zed version");
console.log("update date:", lastModified);
await updateZed();
localStorage.setItem("lastModified", lastModified.toString());
} else {
console.log("no new zed version");
}
}
}
async function updateZed() {
await $`mkdir -p build/SOURCES`;
await $`rm -rf build/SOURCES/zed-linux-x86_64.tar.gz`.noThrow();
await $`rpmbuild --define '_topdir ${Deno.cwd()}/build' -bb zed-nightly.spec`
.cwd("./build");
await $`sudo rpm -e zed`.noThrow(); // in case its not installed
await $`sudo rpm -i build/RPMS/x86_64/zed-nightly-1.fc41.x86_64.rpm`;
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
Thanks for creating the spec file. Due to missing installation of the libex binary, running
Here's a version of the spec file with the fix and also adding license file: Name: zed
Version: nightly
Release: 1%{?dist}
Summary: Zed Nightly App
License: GPL
URL: https://github.com/zed-industries/zed
%define _disable_source_fetch 0
Source0: https://zed.dev/api/releases/nightly/latest/zed-linux-x86_64.tar.gz
BuildArch: x86_64
%description
Zed Nightly App
%licence licences.md
%prep
%setup -q -n zed-nightly.app
# Patch desktop file
sed -i 's/Icon=zed/Icon=dev.zed.Zed-Nightly/' share/applications/zed-nightly.desktop
%define debug_package %{nil}
%install
rm -rf %{buildroot}
install -d %{buildroot}/%{_bindir}
install -m 755 bin/zed %{buildroot}/%{_bindir}/zed
install -d %{buildroot}/%{_libexecdir}
install -m 755 libexec/zed-editor %{buildroot}/%{_libexecdir}/zed-editor
install -d %{buildroot}/%{_datadir}/applications
install -m 644 share/applications/zed-nightly.desktop %{buildroot}/%{_datadir}/applications/dev.zed.Zed-Nightly.desktop
install -d %{buildroot}/%{_datadir}/icons/hicolor/1024x1024/apps
install -m 644 share/icons/hicolor/1024x1024/apps/zed.png %{buildroot}/%{_datadir}/icons/hicolor/1024x1024/apps/dev.zed.Zed-Nightly.png
install -d %{buildroot}/%{_datadir}/icons/hicolor/512x512/apps
install -m 644 share/icons/hicolor/512x512/apps/zed.png %{buildroot}/%{_datadir}/icons/hicolor/512x512/apps/dev.zed.Zed-Nightly.png
%files
%{_bindir}/zed
%{_libexecdir}/zed-editor
%{_datadir}/applications/dev.zed.Zed-Nightly.desktop
%{_datadir}/icons/hicolor/1024x1024/apps/dev.zed.Zed-Nightly.png
%{_datadir}/icons/hicolor/512x512/apps/dev.zed.Zed-Nightly.png
%changelog
* Fri May 03 2024 sigmasd - nightly
- Initial package |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Beta Was this translation helpful? Give feedback.
All reactions