build: Preparing stuff to create debian package

- Added deb binary target to generate incomplete control file
- Added CLI init option to insert impl_path in config
This commit is contained in:
Alexey 2025-12-19 16:22:02 +03:00
commit 9d1261b74d
4 changed files with 29 additions and 0 deletions

24
src/bin/deb.rs Normal file
View file

@ -0,0 +1,24 @@
//! This binary generates DEBIAN/control text for use in debian package
use std::process::Command;
fn main() {
let version = env!("CARGO_PKG_VERSION");
let homepage = env!("CARGO_PKG_HOMEPAGE");
let dpkg_arch = {
let output = match Command::new("dpkg")
.arg("--print-architecture")
.output() {
Ok(out) => out,
Err(error) => panic!("error running dpkg: {error}"),
};
String::from_utf8(output.stdout).expect("dpkg returned ill UTF-8")
};
println!("Package: squad-quest\n\
Version: {version}-1\n\
Architecture: {dpkg_arch}\
Section: misc\n\
Priority: optional\n\
Homepage: {homepage}\n\
Description: Simple RPG-like system for hosting events\n\
Maintainer: Alexey Mirenkov <2ndbeam@disroot.org>");
}