Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(just): move default distrobox manifests into ujust rpm #200

Merged
merged 1 commit into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build/ublue-os-just/30-distrobox.just
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
alias assemble := distrobox-assemble

# Create distroboxes from a defined manifest
distrobox-assemble CONTAINER="prompt" ACTION="create" FILE="/usr/etc/distrobox/distrobox.ini":
distrobox-assemble CONTAINER="prompt" ACTION="create" FILE="/etc/distrobox/distrobox.ini":
#!/usr/bin/bash
# Distroboxes are gathered from distrobox.ini, please add them there
source /usr/lib/ujust/ujust.sh
Expand Down Expand Up @@ -104,4 +104,4 @@ setup-distrobox-app CONTAINER="prompt":
install-obs-studio-portable:
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
AssembleList create "/usr/etc/distrobox/apps.ini" "obs-studio-portable"
AssembleList create "/etc/distrobox/apps.ini" "obs-studio-portable"
2 changes: 2 additions & 0 deletions build/ublue-os-just/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ cp ${SCRIPT_DIR}/lib-ujust/libcolors.sh /tmp/ublue-os/rpmbuild/SOURCES
cp ${SCRIPT_DIR}/lib-ujust/libformatting.sh /tmp/ublue-os/rpmbuild/SOURCES
cp ${SCRIPT_DIR}/lib-ujust/libfunctions.sh /tmp/ublue-os/rpmbuild/SOURCES
cp ${SCRIPT_DIR}/lib-ujust/libdistrobox.sh /tmp/ublue-os/rpmbuild/SOURCES
cp ${SCRIPT_DIR}/etc-distrobox/apps.ini /tmp/ublue-os/rpmbuild/SOURCES
cp ${SCRIPT_DIR}/etc-distrobox/distrobox.ini /tmp/ublue-os/rpmbuild/SOURCES

rpmbuild -ba \
--define '_topdir /tmp/ublue-os/rpmbuild' \
Expand Down
4 changes: 2 additions & 2 deletions build/ublue-os-just/lib-ujust/libdistrobox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Distrobox (){
## Function to assemble pre-defined distrobox containers from manifest files
########
## Assemble all containers defined in an ini file without confirmation
# Assemble noconfirmcreate "/usr/etc/distrobox/distrobox.ini"
# Assemble noconfirmcreate "/etc/distrobox/distrobox.ini"
# Assemble noconfirmcreate "" ALL
## Assemble ubuntu from default ini manifest, with confirmation
# Assemble confirm "" ubuntu
Expand All @@ -45,7 +45,7 @@ function Distrobox (){
function Assemble(){
# Set defaults
ACTION="create"
FILE="/usr/etc/distrobox/distrobox.ini"
FILE="/etc/distrobox/distrobox.ini"
NAME=""

# If an action is provided
Expand Down
13 changes: 12 additions & 1 deletion build/ublue-os-just/ublue-os-just.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: ublue-os-just
Packager: ublue-os
Vendor: ublue-os
Version: 0.23
Version: 0.24
Release: 1%{?dist}
Summary: ublue-os just integration
License: MIT
Expand All @@ -27,6 +27,8 @@ Source13: libcolors.sh
Source14: libformatting.sh
Source15: libfunctions.sh
Source16: libdistrobox.sh
Source17: apps.ini
Source18: distrobox.ini

%global sub_name %{lua:t=string.gsub(rpm.expand("%{NAME}"), "^ublue%-os%-", ""); print(t)}

Expand Down Expand Up @@ -62,6 +64,11 @@ install -Dm644 %{SOURCE14} %{buildroot}/%{_exec_prefix}/lib/ujust
install -Dm644 %{SOURCE15} %{buildroot}/%{_exec_prefix}/lib/ujust
install -Dm644 %{SOURCE16} %{buildroot}/%{_exec_prefix}/lib/ujust

# Add default manifest files for distrobox
mkdir -p -m0755 %{buildroot}/%{_sysconfdir}/distrobox
install -Dm644 %{SOURCE17} %{buildroot}/%{_sysconfdir}/distrobox
install -Dm644 %{SOURCE18} %{buildroot}/%{_sysconfdir}/distrobox

%files
%dir %attr(0755,root,root) %{_datadir}/%{VENDOR}/%{sub_name}
%attr(0755,root,root) %{_sysconfdir}/profile.d/ublue-os-just.sh
Expand All @@ -71,13 +78,17 @@ install -Dm644 %{SOURCE16} %{buildroot}/%{_exec_prefix}/lib/ujust
%attr(0755,root,root) %{_bindir}/ugum
%attr(0644,root,root) %{_exec_prefix}/lib/ujust/ujust.sh
%attr(0644,root,root) %{_exec_prefix}/lib/ujust/lib*.sh
%attr(0644,root,root) %{_sysconfdir}/distrobox/*.ini

%post
# Generate ujust bash completion
just --completions bash | sed -E 's/([\(_" ])just/\1ujust/g' > %{_datadir}/bash-completion/completions/ujust
chmod 644 %{_datadir}/bash-completion/completions/ujust

%changelog
* Sat Jan 20 2024 HikariKnight <[email protected]> - 0.24
- Add default distrobox manifests as part of rpm

* Thu Jan 18 2024 HikariKnight <[email protected]> - 0.23
- Added tooling for distrobox

Expand Down