Skip to content

Commit d9f888d

Browse files
committed
cleaned up tarball structure and updated install script
1 parent 90ec1f9 commit d9f888d

File tree

4 files changed

+79
-19
lines changed

4 files changed

+79
-19
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,24 @@ jobs:
216216
# Copy binary
217217
cp bin/yabb "${ARCHIVE_NAME}/"
218218
219-
# Copy completions
220-
cp completions/yabb.bash "${ARCHIVE_NAME}/"
221-
cp completions/yabb.fish "${ARCHIVE_NAME}/"
222-
cp completions/yabb.zsh "${ARCHIVE_NAME}/"
219+
# Create shell_completions directory and copy completions
220+
mkdir -p "${ARCHIVE_NAME}/shell_completions"
221+
cp completions/yabb.bash "${ARCHIVE_NAME}/shell_completions/"
222+
cp completions/yabb.fish "${ARCHIVE_NAME}/shell_completions/"
223+
cp completions/yabb.zsh "${ARCHIVE_NAME}/shell_completions/"
224+
225+
# Create scripts directory and copy scripts
226+
mkdir -p "${ARCHIVE_NAME}/scripts"
227+
cp scripts/install.sh "${ARCHIVE_NAME}/scripts/"
228+
chmod +x "${ARCHIVE_NAME}/scripts/install.sh"
229+
cp scripts/yabb-update.conf "${ARCHIVE_NAME}/scripts/"
230+
cp scripts/yabb.service "${ARCHIVE_NAME}/scripts/"
231+
cp scripts/yabb.timer "${ARCHIVE_NAME}/scripts/"
232+
cp scripts/yabb-update.service "${ARCHIVE_NAME}/scripts/"
233+
cp scripts/yabb-update.timer "${ARCHIVE_NAME}/scripts/"
234+
235+
# Create symlink for install.sh at root
236+
ln -s scripts/install.sh "${ARCHIVE_NAME}/install.sh"
223237
224238
# Copy and rename sample config
225239
cp config/yabb.toml.example "${ARCHIVE_NAME}/yabb.conf"

Install.txt

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Use this if you downloaded the release tarball manually.
8282

8383
1. Extract and install the binary:
8484

85-
tar xzf yabb-*.tar.gz
85+
zstd -d -c yabb-*.tar.zst | tar -xf -
8686
mkdir -p ~/.local/bin
8787
cp yabb-*/yabb ~/.local/bin/
8888
chmod +x ~/.local/bin/yabb
@@ -126,17 +126,17 @@ SHELL COMPLETIONS (User Installation)
126126
-------------------------------------
127127
For Bash (add to ~/.bashrc):
128128
mkdir -p ~/.local/share/bash-completion/completions
129-
cp yabb-*/yabb.bash ~/.local/share/bash-completion/completions/yabb
129+
cp yabb-*/shell_completions/yabb.bash ~/.local/share/bash-completion/completions/yabb
130130
# Restart your shell or run: source ~/.local/share/bash-completion/completions/yabb
131131

132132
For Zsh (add to ~/.zshrc):
133133
mkdir -p ~/.local/share/zsh/site-functions
134-
cp yabb-*/yabb.zsh ~/.local/share/zsh/site-functions/_yabb
134+
cp yabb-*/shell_completions/yabb.zsh ~/.local/share/zsh/site-functions/_yabb
135135
# Restart your shell or run: exec zsh
136136

137137
For Fish:
138138
mkdir -p ~/.config/fish/completions
139-
cp yabb-*/yabb.fish ~/.config/fish/completions/yabb.fish
139+
cp yabb-*/shell_completions/yabb.fish ~/.config/fish/completions/yabb.fish
140140
# Restart your shell or run: exec fish
141141

142142

@@ -148,7 +148,7 @@ This installs yabb for all users on the system.
148148

149149
1. Extract and install to /opt:
150150

151-
tar xzf yabb-*.tar.gz
151+
zstd -d -c yabb-*.tar.zst | tar -xf -
152152
sudo mkdir -p /opt/yabb
153153
sudo cp yabb-*/yabb /opt/yabb/
154154
sudo chmod +x /opt/yabb/yabb
@@ -179,17 +179,17 @@ This installs yabb for all users on the system.
179179
SHELL COMPLETIONS (System-Wide)
180180
-------------------------------
181181
For Bash:
182-
sudo cp yabb-*/yabb.bash /etc/bash_completion.d/yabb
182+
sudo cp yabb-*/shell_completions/yabb.bash /etc/bash_completion.d/yabb
183183
# Restart your shell or run: source /etc/bash_completion.d/yabb
184184

185185
For Zsh:
186186
sudo mkdir -p /usr/local/share/zsh/site-functions
187-
sudo cp yabb-*/yabb.zsh /usr/local/share/zsh/site-functions/_yabb
187+
sudo cp yabb-*/shell_completions/yabb.zsh /usr/local/share/zsh/site-functions/_yabb
188188
# Restart your shell or run: exec zsh
189189

190190
For Fish:
191191
sudo mkdir -p /usr/share/fish/vendor_completions.d
192-
sudo cp yabb-*/yabb.fish /usr/share/fish/vendor_completions.d/yabb.fish
192+
sudo cp yabb-*/shell_completions/yabb.fish /usr/share/fish/vendor_completions.d/yabb.fish
193193
# Restart your shell or run: exec fish
194194

195195

@@ -262,6 +262,16 @@ in /opt/yabb/. Copy them to systemd:
262262
sudo mkdir -p /etc/yabb
263263
sudo cp /opt/yabb/yabb-update.conf /etc/yabb/update.conf
264264

265+
If you installed from tarball (Option B/C), the service files are in the
266+
scripts/ directory of the extracted archive:
267+
268+
sudo cp yabb-*/scripts/yabb.service /etc/systemd/system/
269+
sudo cp yabb-*/scripts/yabb.timer /etc/systemd/system/
270+
sudo cp yabb-*/scripts/yabb-update.service /etc/systemd/system/
271+
sudo cp yabb-*/scripts/yabb-update.timer /etc/systemd/system/
272+
sudo mkdir -p /etc/yabb
273+
sudo cp yabb-*/scripts/yabb-update.conf /etc/yabb/update.conf
274+
265275
Reload systemd and enable the timers:
266276

267277
sudo systemctl daemon-reload

scripts/install.sh

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,15 +672,45 @@ install_files() {
672672
if [[ ${DRY_RUN} == true ]]; then
673673
log_info "[DRY-RUN] Would install: ${INSTALL_DIR}/${comp}"
674674
installed+=1
675-
elif [[ -f ${extract_dir}/${comp} ]]; then
676-
cp "${extract_dir}/${comp}" "${INSTALL_DIR}/"
675+
elif [[ -f ${extract_dir}/shell_completions/${comp} ]]; then
676+
cp "${extract_dir}/shell_completions/${comp}" "${INSTALL_DIR}/"
677677
register_created_file "${INSTALL_DIR}/${comp}"
678678
installed+=1
679679
fi
680680
done
681681
log_success "Installed ${installed} completion file(s) to ${INSTALL_DIR}/"
682682
fi
683683

684+
# Install systemd service files
685+
log_info "Installing systemd service files..."
686+
local -a systemd_files=(
687+
"yabb.service"
688+
"yabb.timer"
689+
"yabb-update.service"
690+
"yabb-update.timer"
691+
"yabb-update.conf"
692+
)
693+
local sfile
694+
for sfile in "${systemd_files[@]}"; do
695+
if [[ ${DRY_RUN} == true ]]; then
696+
log_info "[DRY-RUN] Would install: ${INSTALL_DIR}/${sfile}"
697+
elif [[ -f ${extract_dir}/scripts/${sfile} ]]; then
698+
cp "${extract_dir}/scripts/${sfile}" "${INSTALL_DIR}/"
699+
register_created_file "${INSTALL_DIR}/${sfile}"
700+
fi
701+
done
702+
log_success "Installed systemd files to ${INSTALL_DIR}/"
703+
704+
# Install install.sh itself for future updates
705+
if [[ ${DRY_RUN} == true ]]; then
706+
log_info "[DRY-RUN] Would install: ${INSTALL_DIR}/install.sh"
707+
elif [[ -f ${extract_dir}/scripts/install.sh ]]; then
708+
cp "${extract_dir}/scripts/install.sh" "${INSTALL_DIR}/"
709+
chmod +x "${INSTALL_DIR}/install.sh"
710+
register_created_file "${INSTALL_DIR}/install.sh"
711+
log_success "Installed: ${INSTALL_DIR}/install.sh"
712+
fi
713+
684714
# Handle configuration
685715
if [[ ${INSTALL_CONFIG} == true ]]; then
686716
# Always copy sample config to install dir as reference
@@ -783,13 +813,19 @@ remove_step_binary() {
783813
}
784814

785815
remove_step_completions() {
786-
log_step "2/3" "Removing shell completions and sample config"
816+
log_step "2/3" "Removing shell completions, systemd files, and sample config"
787817

788818
local -a files_to_remove=(
789819
"${INSTALL_DIR}/yabb.bash"
790820
"${INSTALL_DIR}/yabb.fish"
791821
"${INSTALL_DIR}/yabb.zsh"
792822
"${INSTALL_DIR}/yabb.conf"
823+
"${INSTALL_DIR}/yabb.service"
824+
"${INSTALL_DIR}/yabb.timer"
825+
"${INSTALL_DIR}/yabb-update.service"
826+
"${INSTALL_DIR}/yabb-update.timer"
827+
"${INSTALL_DIR}/yabb-update.conf"
828+
"${INSTALL_DIR}/install.sh"
793829
)
794830

795831
local file

yabb.nimble

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Package
22

3-
version = "0.4.8"
3+
version = "0.4.9"
44
author = "Aryan Ameri"
55
description = "Yet Another BTRFS Backup"
66
license = "MPL 2.0"
@@ -143,9 +143,9 @@ task releasePpc64le, "Build static binary for PowerPC 64-bit LE Linux":
143143

144144
task releaseLoong64, "Build static binary for LoongArch64 Linux":
145145
exec "nim c " & releaseFlags & " " & zigccFlags & " " & "--cpu:loongarch64 " &
146-
"--passC:'-target loongarch64-linux-musl' " & "--passL:'-target loongarch64-linux-musl' " &
147-
"--passC:-march=loongarch64 " & ltoFlags &
148-
" -o:bin/yabb-linux-loong64 src/yabb.nim"
146+
"--passC:'-target loongarch64-linux-musl' " &
147+
"--passL:'-target loongarch64-linux-musl' " & "--passC:-march=loongarch64 " &
148+
ltoFlags & " -o:bin/yabb-linux-loong64 src/yabb.nim"
149149
exec "llvm-strip -s bin/yabb-linux-loong64"
150150
echo "Built: bin/yabb-linux-loong64"
151151

0 commit comments

Comments
 (0)