Skip to content

Repository files navigation

rpmbuild

Simple RPM Build library on top of rpmpack to make CI/CD processing easy

[ WARNING ]

Until a versioned release (not currently planned) the API could change, please understand 🙇‍♂️

If you would like to see a stable release, or if you would like me to update something please let me know and I will try to accomadate you.

Example

Currently go still uses the go binary to build the application, and unless there is a good reason why not I will likely stick with that for convenience... (we need go anyway to generate)

As you may be able to guess by now, this can give you packaging ability using only our existing go binary and a very little bit of code.

main.go

//go:generate go run cmd/package_app.go...

cmd/package_app.go

package main
import (
"github.com/google/rpmpack""github.com/rustysys-dev/rpmbuild"
)
varapp= rpmbuild.Builder{
BinDir: "bin",
DistDir: "dist",
RPMMetaData: rpmpack.RPMMetaData{
Name: "your_package",
Summary: "your package's summary",
Description: "your package's description",
Version: "1.0.0", // version used in the output filenameRelease: "1", // revision used in the output filenameArch: "x86_64", // CPU architecture used in the output filenamePackager: "your name <your@email.dev>",
Licence: "MIT",
Compressor: "zstd",
Provides: []*rpmpack.Relation{{
Name: "some_binary_you_provide",
Version: "1.0.0",
}},
},
// Scripts should be `/bin/sh` executable contents and not a filenameScripts: rpmbuild.Scripts{
PreTransact: "",
PostTransact: "",
PreInstall: "",
PostInstall: "",
PreUninstall: "",
PostUninstall: "",
},
Files: []rpmbuild.PackageFile{
{
Source: "bin/your_package",
Destination: "/usr/bin/your_package",
},
{
Source: "scripts/systemd/your_package.service",
Destination: "/usr/lib/systemd/user/your_package.service",
},
},
}
funcmain() {
iferr:=app.Build(); err!=nil {
panic(err)
}
iferr:=app.Package(); err!=nil {
panic(err)
}
}

About

Simple RPM Build library on top of rpmpack to make CI/CD processing easy

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages