Created
July 20, 2022 22:10
-
-
Save rms1000watt/f51472663c2488327709602d32e2870e to your computer and use it in GitHub Desktop.
hello world dpkg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if type -a ryan; then | |
echo ryan already installed | |
sudo apt remove ryan -y | |
fi | |
version="0.0.1" | |
sudo rm -rf "ryan-${version}" ||: | |
mkdir -p "ryan-${version}/DEBIAN" | |
mkdir -p "ryan-${version}/usr/local/bin" | |
cat << EOF > "ryan-${version}/usr/local/bin/ryan" | |
#!/usr/bin/env bash | |
echo hello world from ryan \$(date) | |
EOF | |
sudo chmod a+x "ryan-${version}/usr/local/bin/ryan" | |
cat << EOF > "ryan-${version}/DEBIAN/control" | |
Package: ryan | |
Version: ${version} | |
Architecture: all | |
Maintainer: ryan | |
Depends: | |
Installed-Size: 1 | |
Homepage: github.com/rms1000watt | |
Description: ryan's hello world to dpkg | |
EOF | |
sudo chown -R 0:0 "ryan-${version}" | |
dpkg -b "ryan-${version}" | |
which ryan ||: | |
sudo dpkg -i "ryan-${version}.deb" | |
which ryan | |
ryan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment