mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 03:31:04 +01:00
57ef794864
This commit adds a script (`create-deb-pkg.sh`), which creates a deb package containing the fastfetch and flashfetch executables as well as the bash-completion file. The script must be executed in an environment, where `dpkg-deb` is present (a debian based environment). Because Deb versioning is not compatible with fastfetch version strings, it is adapted to the format: `0:1$FF_VERSION-0`.
33 lines
853 B
Bash
Executable File
33 lines
853 B
Bash
Executable File
#!/bin/sh
|
|
|
|
cd "$(dirname "$0")"
|
|
echo "cleanup"
|
|
rm -rf ./build ./fastfetch fastfetch.deb
|
|
|
|
echo "building fastfetch"
|
|
mkdir build
|
|
cd build
|
|
cmake ../../..
|
|
cmake --build . -j$(nproc)
|
|
|
|
echo "generating package contents"
|
|
# deb versions must start with a number, hence the 1 added before the rXXX
|
|
version="0:1$(./fastfetch --version | cut -d ' ' -f2)-0"
|
|
echo "Using package version: $version"
|
|
cd ..
|
|
|
|
mkdir -p fastfetch/DEBIAN
|
|
sed "s/<VERSION>/$version/g" control-template > fastfetch/DEBIAN/control
|
|
|
|
mkdir -p fastfetch/usr/bin
|
|
cp build/fastfetch fastfetch/usr/bin/
|
|
cp build/flashfetch fastfetch/usr/bin/
|
|
mkdir -p fastfetch/usr/share/bash-completion/completions
|
|
cp ../../completions/bash fastfetch/usr/share/bash-completion/completions/fastfetch
|
|
|
|
echo "building package"
|
|
dpkg-deb --build fastfetch
|
|
echo "package built."
|
|
echo "cleaning up"
|
|
rm -rf build fastfetch
|