mirror of
https://github.com/fosskers/cargo-aur.git
synced 2026-04-28 23:07:31 -05:00
Produce entire PKGBUILD except md5sums
This commit is contained in:
@@ -13,6 +13,7 @@ categories = ["cargo-plugins", "command-line-utilities"]
|
||||
|
||||
[dependencies]
|
||||
auto_from = "0.3"
|
||||
itertools = "0.9"
|
||||
toml = "0.5"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
|
||||
21
src/main.rs
21
src/main.rs
@@ -1,4 +1,5 @@
|
||||
use auto_from::From;
|
||||
use itertools::Itertools;
|
||||
use serde_derive::Deserialize;
|
||||
use std::{fmt, fs, io, process};
|
||||
|
||||
@@ -20,6 +21,7 @@ struct Package {
|
||||
authors: Vec<String>,
|
||||
description: String,
|
||||
homepage: String,
|
||||
repository: String,
|
||||
license: String,
|
||||
}
|
||||
|
||||
@@ -69,6 +71,7 @@ fn cargo_config() -> Result<Config, Error> {
|
||||
fn pkgbuild(package: Package) -> String {
|
||||
format!(
|
||||
r#"
|
||||
{}
|
||||
pkgname={}-bin
|
||||
pkgver={}
|
||||
pkgrel=1
|
||||
@@ -78,12 +81,28 @@ license=('{}')
|
||||
arch=('x86_64')
|
||||
provides=('{}')
|
||||
options=('strip')
|
||||
source=({}/releases/download/v$pkgver/{}-$pkgver-x86_64.tar.gz)
|
||||
md5sums=('{}')
|
||||
|
||||
package() {{
|
||||
mkdir -p "$pkgdir/usr/bin/"
|
||||
install -m 755 {} "$pkgdir/usr/bin/"
|
||||
}}
|
||||
"#,
|
||||
package
|
||||
.authors
|
||||
.iter()
|
||||
.map(|a| format!("# Maintainer: {}", a))
|
||||
.join("\n"),
|
||||
package.name,
|
||||
package.version,
|
||||
package.description,
|
||||
package.homepage,
|
||||
package.license,
|
||||
package.name
|
||||
package.name,
|
||||
package.repository,
|
||||
package.name,
|
||||
"Uh oh!",
|
||||
package.name,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user