Skip to main content

Convert Go packages to RPM

Project description

go2rpm

go2rpm is a Python application designed to assist in the creation of RPM specfiles for Go (Golang) projects. It automates the process of fetching project details, determining dependencies, and generating a specfile.

Features

  • Automatic Specfile Generation: go2rpm automatically generates RPM specfiles based on the Go project's details and structure.
  • Support for Various Forges: go2rpm works with different code hosting platforms such as GitHub, GitLab, Bitbucket, Pagure, and Gitea.
  • Up to commit level spec generation: go2rpm can create a spec file based on a project's latest release or tag (default) or a custom version, tag, or commit.

Usage

To use go2rpm, execute the application with the necessary parameters:

go2rpm [OPTIONS] GO_IMPORT_PATH

Options

  • -r, --rpmautospec: Use autorelease and autochangelog features (default)
  • -n, --no-rpmautospec: Use static release and changelog instead of rpmautospec
  • -L, --use-new-versioning: Enable new naming scheme for versioned compat packages (default)
  • --no-use-new-versioning: Use older naming scheme for versioned compat packages
  • --no-auto-changelog-entry: Do not generate a changelog entry
  • --dynamic-buildrequires: Use dynamic BuildRequires feature (default)
  • -R, --no-dynamic-buildrequires: Do not use dynamic BuildRequires feature
  • -C, --clean: Clean cache for chosen Go import path (default)
  • --no-clean: Do not clean the cache
  • --clean-all: Clean all cached Go imports
  • -d, --create-directory: Save the final specfile output to NAME/NAME.spec
  • --name: Use a specific name for the spec file
  • --print-name: Print the generated package name and exit
  • -q, --no-spec-warnings: Exclude warning comments from generated specfile
  • -t, --tag: Use especified package tag
  • -a, --altipaths: Include alternate import paths
  • -c, --commit: Use especified package commit
  • -f, --forge: Forge URLs
  • -v, --version: Use especified package versions
  • --stdout: Print spec into stdout

Examples

# Generate specfile a project hosted on GitHub
go2rpm github.com/rhysd/actionlint

# Generate specfile for a project where import path doesn't match the repository
go2rpm --forge https://github.com/kubernetes/api k8s.io/api

# Generate specfile for a project using a specific commit
go2rpm --commit c2c7a15d6c994356c68dc7a14868c3519836286b --forge 'https://git.sr.ht/~emersion/go-scfg' 'git.sr.ht/~emersion/go-scfg'

# Generate specfile for a project using a specific version
go2rpm -v 2.1.0 github.com/hashicorp/hcl/v2

# Generate specfile with a custom name. This is useful for application packages.
go2rpm --name gh -f https://github.com/cli/cli github.com/cli/cli/v2

Requirements

  • Python 3
  • Git
  • Askalono (a license detection tool)
  • Aiohttp (for asynchronous HTTP requests)

License

This application is licensed under the MIT License. Feel free to modify and distribute it in accordance with the license terms.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

go2rpm-1.13.1.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

go2rpm-1.13.1-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file go2rpm-1.13.1.tar.gz.

File metadata

  • Download URL: go2rpm-1.13.1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.3

File hashes

Hashes for go2rpm-1.13.1.tar.gz
Algorithm Hash digest
SHA256 70532d33a9a3991f334f4171dc3777cd97fee5842ebddca92007cfe8cf765868
MD5 ce5dfa0f2c97f85bcdcefedd8ac4b4f2
BLAKE2b-256 4c148716a5d93adc2c5721bda35bacaa375f892b94909144403eac199cfb57a4

See more details on using hashes here.

File details

Details for the file go2rpm-1.13.1-py3-none-any.whl.

File metadata

  • Download URL: go2rpm-1.13.1-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.3

File hashes

Hashes for go2rpm-1.13.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0825c0fc3cea97771f682d9661086b9a675f17fd20ce9524447680edf9d7b2ae
MD5 72cb05ab6f61355483e64e73fd60cb72
BLAKE2b-256 229e42f163d9d6ec4440bb7603190c4befd15ccc2525d5b27b639b8116633ef8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page