rustmon/build/debian/debian.sh

31 lines
687 B
Bash
Raw Normal View History

2024-03-25 03:28:53 +08:00
#!/bin/sh
2024-03-25 12:52:40 +08:00
# TODO: check for rust dependency
2024-03-25 03:28:53 +08:00
# create a directory structure that mirrors tha final structure of the installed package
2024-03-25 15:21:59 +08:00
mkdir -p rustmon/DEBIAN
mkdir -p rustmon/usr/bin
2024-03-25 03:28:53 +08:00
# build the executable
cd ../..
cargo build --release
cd build/debian
# copy the executable
2024-03-25 15:21:59 +08:00
cp ../../target/release/rustmon rustmon/usr/bin/
2024-03-25 03:28:53 +08:00
# create the control file
2024-03-25 15:21:59 +08:00
touch rustmon/DEBIAN/control
2024-03-25 03:28:53 +08:00
# edit the control file
2024-03-25 15:21:59 +08:00
echo "Package: rustmon
2024-03-25 03:28:53 +08:00
Version: 1.0.0
Section: base
Priority: optional
Architecture: amd64
Maintainer: Vomitblood <tohyouxuan@gmail.com>
2024-03-25 15:21:59 +08:00
Description: "Pokemon Colorscripts written in Rust"" > rustmon/DEBIAN/control
2024-03-25 03:28:53 +08:00
# actually build the thing
echo $(pwd)
2024-03-25 15:21:59 +08:00
dpkg-deb --build rustmon