new: Use library functions in other apps as well

This commit is contained in:
Sayantan Santra 2023-09-12 17:12:43 -05:00
parent 54a83856e7
commit 84bc2b595a
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
8 changed files with 42 additions and 52 deletions

View file

@ -25,9 +25,8 @@ package() {
echo Creating the package echo Creating the package
tar -xzf "${name}.tar.gz" -C . tar -xzf "${name}.tar.gz" -C .
# Binary # Binary
install -Dm755 "./${name}" "${pkgdir}/usr/bin/${name}" install-binary "./${name}"
# Autocomplete # Autocomplete
command -v zsh &> /dev/null && install -Dm644 "./zsh_autocomplete" "${pkgdir}/usr/share/zsh/site-functions/_${name}" install-completion zsh "${name}" <"./zsh_autocomplete"
command -v bash &> /dev/null && install -Dm644 "./bash_autocomplete" "${pkgdir}/usr/share/bash-completion/completions/${name}" install-completion bash "${name}" <"./bash_autocomplete"
} }

View file

@ -33,14 +33,14 @@ package() {
echo "Creating the package" echo "Creating the package"
tar -xzf "${name}.tar.gz" -C . tar -xzf "${name}.tar.gz" -C .
# Binaries # Binaries
install -Dm755 "./${name}" "${pkgdir}/usr/bin/${name}" install-binary "./${name}"
install -Dm755 "./${name}-tmux" "${pkgdir}/usr/bin/${name}-tmux" install-binary "./${name}-tmux"
# Manpages # Manpages
install -Dm644 "./${name}.1" "${pkgdir}/usr/share/man/man1/${name}.1" install-manual "./${name}.1"
install -Dm644 "./${name}-tmux.1" "${pkgdir}/usr/share/man/man1/${name}-tmux.1" install-manual "./${name}-tmux.1"
# Autocomplete # Autocomplete
command -v zsh &>/dev/null && install -Dm644 "./${name}.zsh" "${pkgdir}/usr/share/zsh/site-functions/_${name}" install-completion zsh "${name}" <"./${name}.zsh"
command -v bash &>/dev/null && install -Dm644 "./${name}.bash" "${pkgdir}/usr/share/bash-completion/completions/${name}" install-completion bash "${name}" <"./${name}.bash"
# Key-bindings # Key-bindings
command -v fish &>/dev/null && install -Dm644 key-bindings.fish "${pkgdir}/usr/share/fish/vendor_functions.d/${name}_key_bindings.fish" command -v fish &>/dev/null && install -Dm644 key-bindings.fish "${pkgdir}/usr/share/fish/vendor_functions.d/${name}_key_bindings.fish"
command -v bash &>/dev/null && install -Dm644 key-bindings.bash "${pkgdir}/usr/share/${name}/key-bindings.bash" command -v bash &>/dev/null && install -Dm644 key-bindings.bash "${pkgdir}/usr/share/${name}/key-bindings.bash"

View file

@ -25,10 +25,9 @@ package() {
echo "Creating the package" echo "Creating the package"
tar -xzf "${name}.tar.gz" -C . tar -xzf "${name}.tar.gz" -C .
# Binaries # Binaries
install -Dm755 "./${name}" "${pkgdir}/usr/bin/${name}" install-binary "./${name}"
install -Dm755 "./${name}-xray" "${pkgdir}/usr/bin/${name}-xray" install-binary "./${name}-xray"
# Manpages # Manpages
install -Dm644 "./${name}.1" "${pkgdir}/usr/share/man/man1/${name}.1" install-manual "./${name}.1"
install -Dm644 "./${name}-xray.1" "${pkgdir}/usr/share/man/man1/${name}-xray.1" install-manual "./${name}-xray.1"
} }

View file

@ -24,6 +24,6 @@ package() {
# Build package # Build package
echo "Creating the package" echo "Creating the package"
tar -xzf "${name}.tar.gz" -C . tar -xzf "${name}.tar.gz" -C .
# Binaries # Binary
install -Dm755 "./${name}" "${pkgdir}/usr/bin/${name}" install-binary "./${name}"
} }

View file

@ -29,12 +29,11 @@ package() {
echo "Creating the package" echo "Creating the package"
tar -xzf "${name}.tar.gz" -C . tar -xzf "${name}.tar.gz" -C .
# Binary # Binary
install -Dm755 "./${name}" "${pkgdir}/usr/bin/${name}" install-binary "./${name}"
# Manpage # Manpage
install -Dm644 "./${name}.1" "${pkgdir}/usr/share/man/man1/${name}.1" install-manual "./${name}.1"
# Autocomplete # Autocomplete
command -v fish &> /dev/null && install -Dm644 "./${name}.fish" "${pkgdir}/usr/share/fish/completions/${name}.fish" install-completion fish "${name}" <"./${name}.fish"
command -v zsh &> /dev/null && install -Dm644 "./${name}.zsh" "${pkgdir}/usr/share/zsh/site-functions/_${name}" install-completion zsh "${name}" <"./${name}.zsh"
command -v bash &> /dev/null && install -Dm644 "./${name}.bash" "${pkgdir}/usr/share/bash-completion/completions/${name}" install-completion bash "${name}" <"./${name}.bash"
} }

View file

@ -26,12 +26,11 @@ package() {
tar -xzf "${name}.tar.gz" -C . tar -xzf "${name}.tar.gz" -C .
cd "./${name}-${version}-x86_64-unknown-linux-musl" cd "./${name}-${version}-x86_64-unknown-linux-musl"
# Binary # Binary
install -Dm755 "./${name}" "${pkgdir}/usr/bin/${name}" install-binary "./${name}"
# Manpage # Manpage
install -Dm644 "./${name}.1" "${pkgdir}/usr/share/man/man1/${name}.1" install-manual "./${name}.1"
# Autocomplete # Autocomplete
command -v fish &> /dev/null && install -Dm644 "./autocomplete/${name}.fish" "${pkgdir}/usr/share/fish/completions/${name}.fish" install-completion fish "${name}" <"./autocomplete/${name}.fish"
command -v zsh &> /dev/null && install -Dm644 "./autocomplete/_${name}" "${pkgdir}/usr/share/zsh/site-functions/_${name}" install-completion zsh "${name}" <"./autocomplete/_${name}"
command -v bash &> /dev/null && install -Dm644 "./autocomplete/${name}.bash-completion" "${pkgdir}/usr/share/bash-completion/completions/${name}" install-completion bash "${name}" <"./autocomplete/${name}.bash-completion"
} }

View file

@ -11,7 +11,7 @@ sources_amd64=("${homepage}/releases/download/${version}/${name}.tar.gz")
checksums_amd64=('6f93c6e442afe6a64e8cf6c641e1a20174f6aebd9a557f39ae13d1c41e4a6f6a') checksums_amd64=('6f93c6e442afe6a64e8cf6c641e1a20174f6aebd9a557f39ae13d1c41e4a6f6a')
package() { package() {
# Binary # Binary
install -Dm755 ./${name} "${pkgdir}/usr/bin/${name}" install-binary "./${name}"
# Manpage # Manpage
install -Dm644 ./${name}.1 "${pkgdir}/usr/share/man/man1/${name}.1" install-manual "./${name}.1"
} }

View file

@ -1,6 +1,6 @@
name="topgrade" name="topgrade"
version=12.0.2 version=12.0.2
release=2 release=3
desc="Invoke the upgrade procedure of multiple package managers" desc="Invoke the upgrade procedure of multiple package managers"
architectures=('amd64' 'aarch64' 'armv7') architectures=('amd64' 'aarch64' 'armv7')
maintainer='SinTan1729' maintainer='SinTan1729'
@ -16,22 +16,16 @@ checksums_aarch64=('683805723bcce9c0a7cc1ecf06edf49a6becaf24ea59a0e6d1bfc697b54a
checksums_armv7=('5f4ceb90fe374d1c03bef0b9b3cdc995c5ea5e7d0cb5feb5c893a6cd50c13623') checksums_armv7=('5f4ceb90fe374d1c03bef0b9b3cdc995c5ea5e7d0cb5feb5c893a6cd50c13623')
package() { package() {
# install binary # install binary
install -Dm755 ./topgrade "$pkgdir/usr/bin/topgrade" install-binary "./${name}"
# manpage # manpage
./topgrade --gen-manpage | sed 's/.TH Topgrade 1/.TH Topgrade 8/' >topgrade.8 "./${name}" --gen-manpage | sed 's/.TH Topgrade 1/.TH Topgrade 8/' >"${name}.8"
install -Dm644 ./topgrade.8 "$pkgdir/usr/share/man/man8/topgrade.8" install-manual "./${name}.8"
# completions # completions
if $(command -v fish &>/dev/null) && [ $(echo $(fish --version | awk '{print $3}')$'\n'3.4.0 | sort -V | head -n1) != '3.4.0' ]; then if [ $(echo $(fish --version | awk '{print $3}')$'\n'3.4.0 | sort -V | head -n1) != '3.4.0' ]; then
./topgrade --gen-completion fish >topgrade.fish install-completion fish "${name}" | "${name}" --gen-completion fish
install -Dm644 ./topgrade.fish "${pkgdir}/usr/share/fish/completions/topgrade.fish"
fi
if $(command -v bash &>/dev/null); then
./topgrade --gen-completion bash >topgrade.bash
install -Dm644 ./topgrade.bash "${pkgdir}/usr/share/bash-completion/completions/topgrade"
fi
if $(command -v zsh &>/dev/null); then
./topgrade --gen-completion zsh >topgrade.zsh
install -Dm644 ./topgrade.zsh "${pkgdir}/usr/share/zsh/site-functions/_topgrade"
fi fi
install-completion zsh "${name}" | "${name}" --gen-completion zsh
install-completion bash "${name}" | "${name}" --gen-completion bash
echo "Please add 'no_self_update = true' to your 'topgrade.toml' file to disable self updates, as it won't work with this installation" echo "Please add 'no_self_update = true' to your 'topgrade.toml' file to disable self updates, as it won't work with this installation"
} }