cabal2spec
Convert Cabal files into rpm spec files
https://github.com/peti/cabal2spec
| LTS Haskell 24.67: | 2.7.1@rev:1 |
| Stackage Nightly 2026-11-19: | 2.9.0 |
| Latest on Hackage: | 2.9.0 |
GPL-3.0-only licensed by Peter Simons, Bryan O'Sullivan, Jens Petersen
Maintained by [email protected]
This version can be pinned in stack with:
cabal2spec-2.9.0@sha256:f2d98be283ed358ef193abdf05aa4b5838879f49cac787a96676d57933127ea9,2067Module documentation for 2.9.0
Depends on 6 packages(full list with versions):
Used by 1 package in nightly-2026-11-19(full list with versions):
cabal2spec
The cabal2spec utility converts a given Cabal file into an RPM spec
file that
builds that package with the RPM package manager. This tool is used to generate
various Haskell package sets for the SUSE and
openSUSE familiy of distributions. Plenty of
examples for generated spec files can be found in the openSUSE Haskell
development
project.
Changes
Revision history for cabal2spec
2.9.0 (2026-11-18)
- Generated spec files now wrap every reference to profiling packages in
%if %{with ghc_prof}: the-profbuild dependencies, including those of the test suite; the-profsub-package; and its%filessection. Packages now build even when profiling is disabled. - Emit
%bcond_with ghc_prof, so that profiling can be enabled with--with ghc_prof. Without this declaration, the option had no effect. - Generated spec files require
ghc-rpm-macros >= 2.9.2. - Stop excluding dependencies on
ghc-bignum. Since GHC 9.14,baseno longer depends on it, soghc-base-develdoesn’t pull it in any more, and packages that use it need an explicitghc-ghc-bignumdependency. - Always generate
%autosetup -p1, so that adding a patch only requires declaring it. - Escape every
%inSummary:and%descriptionas%%, so that rpm shows the text literally instead of trying to expand macros. - Mark license files that appear among the documentation files with
%licenseinstead of%doc. - Use
LicenseRef-SUSE-Public-Domainfor public domain packages. - Match the output of the current
spec-cleanermore closely:- Use the new SUSE copyright header (“SUSE LLC and contributors”).
- Refer to
%pkg_namewithout braces inName:,pkgver,%ghc_fix_rpath, and the-docand-profsub-package definitions. - Define
pkgverafter theRelease:tag. - Emit
ExcludeArch:after the unconditional build dependencies. - Sort the
-profbuild dependencies and theRequires:of the-develpackage. - List
Requires:beforeBuildArch:in the-docsub-package. - Collapse consecutive blank lines in descriptions.
2.8.2 (2026-11-15)
- Revert the
%{with ghc_prof}guards that were accidentally added in 2.8.1. This change requires a major version bump and should not have landed in 2.8.x.
2.8.1 (2026-11-15): DEPRECATED on hackage.haskell.org
- Support Cabal 3.16.x and 3.18.x.
- Wrap all references to profiling packages in
%if %{with ghc_prof}.
2.8.0 (2025-07-23)
- Support Cabal 3.12 and later, which uses the new
SymbolicPathtype.
2.7.1 (2024-03-26)
- Support GHC 9.8.x.
2.7.0 (2023-03-30)
- Adapt the generated spec files to the new
ghc-rpm-macrosfor GHC 9.4.x: libraries get separate-docand-profsub-packages, and the build dependencies list both-develand-profpackages. - Name the
-docand-profsub-packages explicitly (ghc-%{pkg_name}-doc,ghc-%{pkg_name}-prof). This fixes packages whose primary package is an executable that also provides a library. - Don’t generate
-docand-profsub-packages for packages that have no library. - List the package’s actual license files in the
-docsub-package instead of a hard-codedLICENSE. - Exclude
ghc-bignum(notbignum) from the dependencies, because it ships with the compiler. - Build Haddock documentation for packages with internal sub-libraries,
and stop emitting the unused
has_internal_sub_librariesdefine.
2.6.4 (2023-02-02)
- Build with Cabal 3.6 and 3.8.
2.6.3 (2022-02-04)
- Add
ExcludeArch: %{ix86}, because Haskell packages are not built for 32-bit x86 any more. - Use
httpsfor the openSUSE Bugzilla URL in the spec file header. - Build with Cabal 3.4 and 3.6.
2.6.2 (2020-08-18)
- Use
%autosetupin the%prepphase.
2.6.1 (2020-06-09)
- Change the copyright holder in the spec file header to “SUSE LLC”.
- Map the
pqsystem library topostgresql-server-devel.
2.6 (2020-04-01)
- Support Cabal 3.2.x.
2.5 (2020-01-28)
- Require
base >= 4.8. (This release fixes the version number of 2.4.2, which should have been a major bump.)
2.4.2 (2020-01-26)
- New
--copyright-yearflag to set the year in the spec file header.createSpecFileandcabal2spectake an extra argument for it.
2.4.1 (2020-01-10)
- Support GHC 8.10.x and Cabal 3.1.x.
2.4 (2019-10-24)
- Stop emitting
Group:tags, because openSUSE no longer supports them.
2.3 (2019-09-06)
- Require Cabal 3.0.x.
2.2.2.1 (2019-01-16)
- No user-visible changes.
2.2.2 (2018-09-23)
- Ignore test suites that aren’t buildable when collecting test dependencies.
2.2.1 (2018-07-19)
- Fix the command-line tool, which ignored the
--compilerand--platformflags.
2.2.0 (2018-07-17)
- New
--enable-testsflag to run the test suite by default (%bcond_without tests).
2.1.1 (2018-05-23)
- Replace
[and]in%filesentries with?so that rpm doesn’t read them as glob character classes (e.g. pandoc’s[Content_Types].xml). - Add system library mappings for
odbcandsnappy. - Match the output of
spec-cleanermore closely.
2.1 (2018-04-18)
- Support internal sub-libraries.
- Use SPDX license identifiers.
- Mark license files with
%license. - Don’t run Haddock for libraries that expose no modules.
- Match the output of
spec-cleanermore closely.
2.0.2 (2018-03-12)
- Require Cabal 2.2.x.
- Fix the command-line handling of Cabal flags (
--flag). - Only consider buildable components when collecting dependencies.
- Add a system library mapping for
gsl.
2.0.1 (2018-03-05)
- Sort all
%fileslists alphabetically. - Add a system library mapping for
re2.
2.0.0 (2018-01-25)
- First release as a standalone package, with a command-line tool and a library.