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:
parent
46af205aef
commit
9d1261b74d
4 changed files with 29 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ members = ["cli", "discord"]
|
|||
version = "0.10.0"
|
||||
edition = "2024"
|
||||
repository = "https://2ndbeam.ru/git/2ndbeam/squad-quest"
|
||||
homepage = "https://2ndbeam.ru/git/2ndbeam/squad-quest"
|
||||
license = "MIT"
|
||||
|
||||
[package]
|
||||
|
|
@ -13,6 +14,7 @@ edition.workspace = true
|
|||
version.workspace = true
|
||||
repository.workspace = true
|
||||
license.workspace = true
|
||||
homepage.workspace = true
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.228", features = ["derive"] }
|
||||
|
|
|
|||
|
|
@ -40,4 +40,6 @@ pub enum Objects {
|
|||
pub struct InitArgs {
|
||||
#[arg(long,short)]
|
||||
pub path: Option<PathBuf>,
|
||||
#[arg(long,short)]
|
||||
pub implpath: Option<PathBuf>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ fn main() {
|
|||
|
||||
let config = Config {
|
||||
path: path.clone(),
|
||||
impl_path: args.implpath.clone(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
|
|
|||
24
src/bin/deb.rs
Normal file
24
src/bin/deb.rs
Normal 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>");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue