cabal-rpm: RPM packaging tool for Haskell Cabal-based packages

[ distribution, gpl, program ] [ Propose Tags ] [ Report a vulnerability ]

This package provides a RPM packaging tool for Haskell Cabal-based packages.

cabal-rpm has commands to generate a RPM spec file and srpm for a package. It can rpmbuild packages, dnf/yum install their dependencies, prep packages, and install them. There are commands to list package dependencies and missing dependencies. The diff command compares the current spec file with a freshly generated one, the update command updates the spec file to latest version from Stackage or Hackage, and the refresh command updates the spec file to the current cabal-rpm packaging. It also handles Hackage revisions of packages. Standalone packages can also be made, built with cabal-install.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
curl

Use curl library to query Stackage instead of http-client

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Versions [RSS] 0.2, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.3.1, 0.3.2, 0.3.3, 0.4, 0.5, 0.5.1, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.7.0, 0.7.1, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8.7, 0.8.8, 0.8.9, 0.8.10, 0.8.11, 0.9, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.5.1, 0.9.6, 0.9.7, 0.9.8, 0.9.9, 0.9.10, 0.9.11, 0.10.0, 0.10.1, 0.11, 0.11.1, 0.11.2, 0.12, 0.12.1, 0.12.2, 0.12.3, 0.12.4, 0.12.5, 0.12.6, 0.13, 0.13.1, 0.13.2, 0.13.3, 1.0.1, 1.0.2, 1.0.3, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.5.1, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.10, 2.0.11, 2.0.11.1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.2.0, 2.2.1 (info)
Change log ChangeLog.md
Dependencies aeson, base (<5), bytestring, Cabal (>1.10 && <3.15), cached-json-file, curl, directory, extra, filepath (>=1.4), http-client (>=0.4.30), http-client-tls, http-query, semigroups, simple-cabal (>=0.1.3), simple-cmd (>=0.2.3), simple-cmd-args (>=0.1.7), text, time (>=1.5), unix [details]
Tested with ghc ==8.0.2, ghc ==8.2.2, ghc ==8.4.4, ghc ==8.6.5, ghc ==8.8.4, ghc ==8.10.7, ghc ==9.0.2, ghc ==9.2.8, ghc ==9.4.8, ghc ==9.6.4, ghc ==9.8.2
License GPL-3.0-only
Copyright 2007-2008 Bryan O'Sullivan <bos@serpentine.com>, 2012-2024 Jens Petersen <juhpetersen@gmail.com>
Author Jens Petersen <juhpetersen@gmail.com>, Bryan O'Sullivan <bos@serpentine.com>
Maintainer Jens Petersen <petersen@fedoraproject.org>
Revised Revision 1 made by JensPetersen at 2024-10-28T05:44:22Z
Category Distribution
Home page https://github.com/juhp/cabal-rpm
Bug tracker https://github.com/juhp/cabal-rpm/issues
Source repo head: git clone https://github.com/juhp/cabal-rpm
Uploaded by JensPetersen at 2024-08-02T09:08:20Z
Distributions Fedora:2.2.0, LTSHaskell:2.2.1, NixOS:2.1.5, Stackage:2.2.1
Reverse Dependencies 1 direct, 0 indirect [details]
Executables cabal-rpm
Downloads 62230 total (151 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2024-08-02 [all 1 reports]

Readme for cabal-rpm-2.2.1

[back to package description]

cabal-rpm

GitHub CI Hackage Stackage LTS Stackage Nightly license

cabal-rpm is a tool for RPM packaging of Haskell Cabal-based packages. Firstly it creates RPM spec files from the .cabal files of Haskell packages. It can also install build dependencies using dnf/yum, it prefers package versions from Stackage, and can build and install packages and their dependencies recursively as rpm packages. It can also update packages and refresh spec files.

Cabal-rpm was originally created by Bryan O'Sullivan (see README.orig) to create spec files, and was later updated by Jens Petersen to work with current Cabal and Fedora Packaging Guidelines replacing cabal2spec, and extended with many new features. It is used by Fedora and earlier by OpenSuSE. It is licensed under the terms of the GPL version 3 (see the COPYING file).

Requirements

cabal-rpm assumes you are using ghc-rpm-macros for Haskell RPM packaging.

Usage

To create a .spec file for a package:

$ cabal-rpm spec somepkg

By default it will use the package version in Stackage LTS or else the latest version from Hackage.

You can also specify a version if you wish

$ cabal-rpm spec somepkg-0.1

which will create a spec file for it.

cabal-rpm also works in an rpm package source directory or inside the source of a Haskell package:

$ cabal-rpm spec

cabal-rpm creates .spec files in the current dir and if a .spec file already exists it will append .cblrpm to the generated filename to avoid overwriting an existing file.

$ cabal-rpm install [pkg][-ver]

will yum/dnf install any available missing dependencies and build rpms of the package. Additionally it will recursively package and install missing Haskell dependencies.

$ cabal-rpm diff

diffs the current spec file with a freshly generated spec file.

$ cabal-rpm update

updates the package to the latest Stackage or Hackage version

$ cabal-rpm refresh

updates the spec file to the current cabal-rpm packaging.

There are more commands: prep, builddep, depends, requires, missingdeps. See the manpage or help output for more details.

Help output

$ cabal-rpm --version

2.2.1

$ cabal-rpm --help

Tool to create RPM packages from Haskell Hackage/Stackage

Usage: cabal-rpm [--version] COMMAND

  See https://github.com/juhp/cabal-rpm#readme

Available options:
  -h,--help                Show this help text
  --version                Show version

Available commands:
  spec                     Generate a spec file
  srpm                     Generate an srpm
  prep                     Unpack source
  local                    Build rpm package locally
  build                    Alias for 'local' - builds rpm locally
  builddep                 Install build dependencies with dnf
  install                  Build and install recursively
  diff                     Diff with pristine generated spec file
  depends                  List Haskell dependencies
  requires                 List buildrequires for package
  missingdeps              List dependencies not available
  refresh                  Refresh spec file to latest packaging
  update                   Update package to latest version

Installation

cabal-rpm is packaged in Fedora and EPEL.

It currently needs at least ghc 8 or newer and Cabal 1.18 or later to build.

The package is on Hackage. If you have cabal-install you can install simply with

$ cabal install cabal-rpm

You can also install it with stack install cabal-rpm.

You can also build and install it from source as normal by running cabal install.

Development

The latest source code is available from: https://github.com/juhp/cabal-rpm

More features are planned and patches welcome. See the TODO file for more details.