Create deb package #87

Open
oysteikt wants to merge 1 commits from dpkg-packaging into main
5 changed files with 68 additions and 1 deletions

3
.gitignore vendored
View File

@ -6,3 +6,6 @@ config.toml
/.direnv/
result
result-*
# Packaging
/assets/completions/

View File

@ -2,6 +2,16 @@
name = "mysqladm-rs"
version = "0.1.0"
edition = "2021"
license = "BSD3"
authors = [
"oysteikt@pvv.ntnu.no",
"felixalb@pvv.ntnu.no",
]
repository = "https://git.pvv.ntnu.no/Projects/mysqladm-rs"
description = "A command-line utility for MySQL administration for non-admin users"
categories = ["command-line-interface", "command-line-utilities"]
keywords = ["mysql", "cli", "administration"]
readme = "README.md"
[dependencies]
anyhow = "1.0.95"
@ -54,3 +64,37 @@ anyhow = "1.0.95"
[dev-dependencies]
regex = "1.11.1"
# TODO: package shell completions
[package.metadata.deb]
maintainer = "Programvareverkstedet <projects@pvv.ntnu.no>"
section = "admin"
assets = [
[
"target/release/mysqladm",
"usr/bin/",
"755",
],
[
"example-config.toml",
"etc/mysqladm/config.toml",
"644",
],
[
"assets/completions/_*",
"usr/share/zsh/site-functions/completions/",
"644",
],
[
"assets/completions/*.bash",
"usr/share/bash-completion/completions/",
"644",
],
[
"assets/completions/*.fish",
"usr/share/fish/vendor_completions.d/",
"644",
],
]
conf-files = ["etc/mysqladm/config.toml"]
depends = []

19
create-deb.sh Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
cargo build --release
mkdir -p assets/completions
./target/release/mysqladm generate-completions --shell bash > assets/completions/mysqladm.bash
./target/release/mysqladm generate-completions --shell zsh > assets/completions/_mysqladm
./target/release/mysqladm generate-completions --shell fish > assets/completions/mysqladm.fish
./target/release/mysqladm generate-completions --shell bash --command mysql-dbadm > assets/completions/mysql-dbadm.bash
./target/release/mysqladm generate-completions --shell zsh --command mysql-dbadm > assets/completions/_mysql-dbadm
./target/release/mysqladm generate-completions --shell fish --command mysql-dbadm > assets/completions/mysql-dbadm.fish
./target/release/mysqladm generate-completions --shell bash --command mysql-useradm > assets/completions/mysql-useradm.bash
./target/release/mysqladm generate-completions --shell zsh --command mysql-useradm > assets/completions/_mysql-useradm
./target/release/mysqladm generate-completions --shell fish --command mysql-useradm > assets/completions/mysql-useradm.fish
cargo deb

View File

@ -19,4 +19,4 @@ port = 3306
username = "root"
password = "secret"
timeout = 2 # seconds
timeout = 2 # seconds

View File

@ -48,6 +48,7 @@
mysql-client
cargo-nextest
cargo-deny
cargo-deb
];
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";