Add BPM hook for generating grub config automatically and cleaned up source.sh script

This commit is contained in:
2025-05-02 21:40:58 +03:00
parent bf6e6f126a
commit 0b5e9fe47b
3 changed files with 19 additions and 11 deletions
+13 -10
View File
@@ -34,18 +34,21 @@ build() {
make
}
# The check function is executed in the source directory
# This function is used to run tests to verify the package has been compiled correctly
check() {
make check
}
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
make DESTDIR="$BPM_OUTPUT" install
mkdir -p "$BPM_OUTPUT"/usr/share/bash-completion/completions/
mv -v "$BPM_OUTPUT"/etc/bash_completion.d/grub "$BPM_OUTPUT"/usr/share/bash-completion/completions
mkdir -p "$BPM_OUTPUT"/etc/default/
cp ../grub.default "$BPM_OUTPUT"/etc/default/grub
# Install bash completions
install -dm755 "$BPM_OUTPUT"/usr/share/bash-completion/completions/
mv "$BPM_OUTPUT"/etc/bash_completion.d/grub "$BPM_OUTPUT"/usr/share/bash-completion/completions
# Install grub default file
install -Dm644 "$BPM_WORKDIR"/grub.default "$BPM_OUTPUT"/etc/default/grub
# Install BPM hook
install -Dm644 "$BPM_WORKDIR"/20-grub.bpmhook "$BPM_OUTPUT"/var/lib/bpm/hooks/20-grub.bpmhook
# Install package license
install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/grub/COPYING
}