Blob Blame History Raw
# generated by cabal-rpm-2.1.2 --subpackage
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Haskell/

%global pkg_name ormolu
%global pkgver %{pkg_name}-%{version}

%global thenv th-env-0.1.1
%global markdownunlit markdown-unlit-0.5.1
%global subpkgs %{markdownunlit} %{thenv}

# Building test suite 'readme' for th-env-0.1.1..
# ghc-9.4.5: could not execute: markdown-unlit
%bcond_with tests

Name:           %{pkg_name}
Version:        0.5.3.0
# can only be reset when all subpkgs bumped
Release:        3%{?dist}
Summary:        A formatter for Haskell source code

License:        BSD-3-Clause
Url:            https://hackage.haskell.org/package/%{name}
# Begin cabal-rpm sources:
Source0:        https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz
Source1:        https://hackage.haskell.org/package/%{thenv}/%{thenv}.tar.gz
Source2:        https://hackage.haskell.org/package/%{markdownunlit}/%{markdownunlit}.tar.gz
Source3:        https://hackage.haskell.org/package/%{pkgver}/%{name}.cabal#/%{pkgver}.cabal
# End cabal-rpm sources

# Begin cabal-rpm deps:
BuildRequires:  dos2unix
BuildRequires:  ghc-Cabal-devel
BuildRequires:  ghc-rpm-macros-extra
BuildRequires:  ghc-Cabal-syntax-devel
BuildRequires:  ghc-Diff-devel
BuildRequires:  ghc-MemoTrie-devel
BuildRequires:  ghc-ansi-terminal-devel
BuildRequires:  ghc-array-devel
BuildRequires:  ghc-base-devel
BuildRequires:  ghc-binary-devel
BuildRequires:  ghc-bytestring-devel
BuildRequires:  ghc-containers-devel
BuildRequires:  ghc-directory-devel
BuildRequires:  ghc-dlist-devel
BuildRequires:  ghc-file-embed-devel
BuildRequires:  ghc-filepath-devel
BuildRequires:  ghc-ghc-lib-parser-devel
BuildRequires:  ghc-megaparsec-devel
BuildRequires:  ghc-mtl-devel
BuildRequires:  ghc-optparse-applicative-devel
BuildRequires:  ghc-syb-devel
BuildRequires:  ghc-text-devel
#BuildRequires:  ghc-th-env-devel
%if %{with ghc_prof}
BuildRequires:  ghc-Cabal-syntax-prof
BuildRequires:  ghc-Diff-prof
BuildRequires:  ghc-MemoTrie-prof
BuildRequires:  ghc-ansi-terminal-prof
BuildRequires:  ghc-array-prof
BuildRequires:  ghc-base-prof
BuildRequires:  ghc-binary-prof
BuildRequires:  ghc-bytestring-prof
BuildRequires:  ghc-containers-prof
BuildRequires:  ghc-directory-prof
BuildRequires:  ghc-dlist-prof
BuildRequires:  ghc-file-embed-prof
BuildRequires:  ghc-filepath-prof
BuildRequires:  ghc-ghc-lib-parser-prof
BuildRequires:  ghc-megaparsec-prof
BuildRequires:  ghc-mtl-prof
BuildRequires:  ghc-optparse-applicative-prof
BuildRequires:  ghc-syb-prof
BuildRequires:  ghc-text-prof
#BuildRequires:  ghc-th-env-prof
%endif
%if %{with tests}
BuildRequires:  ghc-QuickCheck-devel
BuildRequires:  ghc-hspec-devel
BuildRequires:  ghc-hspec-discover-devel
BuildRequires:  ghc-hspec-megaparsec-devel
BuildRequires:  ghc-path-devel
BuildRequires:  ghc-path-io-devel
BuildRequires:  ghc-temporary-devel
%endif
# for missing dep 'th-env':
BuildRequires:  ghc-template-haskell-devel
BuildRequires:  ghc-th-compat-devel
%if %{with ghc_prof}
BuildRequires:  ghc-template-haskell-prof
BuildRequires:  ghc-th-compat-prof
%endif
# for missing dep 'markdown-unlit':
BuildRequires:  ghc-base-compat-devel
%if %{with ghc_prof}
BuildRequires:  ghc-base-compat-prof
%endif
# End cabal-rpm deps

%description
Ormolu is a formatter for Haskell source code.
The project was created with the following goals in mind:

- Using GHC's own parser to avoid parsing problems caused by haskell-src-exts.

- Let some whitespace be programmable. The layout of the input
  influences the layout choices in the output. This means that the
  choices between single-line/multi-line layouts in each particular
  situation are made by the user, not by an algorithm. This makes the
  implementation simpler and leaves some control to the user while
  still guaranteeing that the formatted code is stylistically
  consistent.

- Writing code in such a way so it's easy to modify and maintain.

- Implementing one “true” formatting style which admits no configuration.

- That formatting style aims to result in minimal diffs while still
  remaining very close to “conventional” Haskell formatting people
  use.

- Choose a style compatible with modern dialects of Haskell. As new
  Haskell extensions enter broad use, we may change the style to
  accommodate them.

- Idempotence: formatting already formatted code doesn't change it.

- Be well-tested and robust to the point that it can be used in large
  projects without exposing unfortunate, disappointing bugs here and
  there.


%package -n ghc-%{name}
Summary:        Haskell %{name} library

%description -n ghc-%{name}
This package provides the Haskell %{name} shared library.


%package -n ghc-%{name}-devel
Summary:        Haskell %{name} library development files
Provides:       ghc-%{name}-static = %{version}-%{release}
Provides:       ghc-%{name}-static%{?_isa} = %{version}-%{release}
%if %{defined ghc_version}
Requires:       ghc-compiler = %{ghc_version}
%endif
Requires:       ghc-%{name}%{?_isa} = %{version}-%{release}

%description -n ghc-%{name}-devel
This package provides the Haskell %{name} library development files.


%if %{with haddock}
%package -n ghc-%{name}-doc
Summary:        Haskell %{name} library documentation
BuildArch:      noarch
Requires:       ghc-filesystem

%description -n ghc-%{name}-doc
This package provides the Haskell %{name} library documentation.
%endif


%if %{with ghc_prof}
%package -n ghc-%{name}-prof
Summary:        Haskell %{name} profiling library
Requires:       ghc-%{name}-devel%{?_isa} = %{version}-%{release}
Supplements:    (ghc-%{name}-devel and ghc-prof)

%description -n ghc-%{name}-prof
This package provides the Haskell %{name} profiling library.
%endif


%global main_version %{version}

%if %{defined ghclibdir}
%ghc_lib_subpackage -l BSD-3-Clause %{thenv}
%ghc_lib_subpackage -l MIT %{markdownunlit}
%endif

%global version %{main_version}


%prep
# Begin cabal-rpm setup:
%setup -q -a1 -a2
dos2unix -k -n %{SOURCE3} %{name}.cabal
# End cabal-rpm setup


%build
# Begin cabal-rpm build:
%ghc_libs_build %{subpkgs}
%ghc_lib_build
# End cabal-rpm build


%install
# Begin cabal-rpm install
%ghc_libs_install %{subpkgs}
%ghc_lib_install
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions/
%{buildroot}%{_bindir}/%{name} --bash-completion-script %{name} | sed s/filenames/default/ > %{buildroot}%{_datadir}/bash-completion/completions/%{name}
# End cabal-rpm install

echo %{_bindir}/markdown-unlit >> %{markdownunlit}/ghc-markdown-unlit.files


%check
%if %{with tests}
%cabal_test
%endif


%files
# Begin cabal-rpm files:
%license LICENSE.md
%doc CHANGELOG.md CONTRIBUTING.md README.md
%{_bindir}/%{name}
%{_datadir}/bash-completion/completions/%{name}
# End cabal-rpm files


%files -n ghc-%{name} -f ghc-%{name}.files
# Begin cabal-rpm files:
%license LICENSE.md
# End cabal-rpm files


%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
%doc CHANGELOG.md CONTRIBUTING.md README.md


%if %{with haddock}
%files -n ghc-%{name}-doc -f ghc-%{name}-doc.files
%license LICENSE.md
%endif


%if %{with ghc_prof}
%files -n ghc-%{name}-prof -f ghc-%{name}-prof.files
%endif


%changelog
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Jul 24 2023 Jens Petersen <petersen@redhat.com> - 0.5.3.0-1
- https://hackage.haskell.org/package/ormolu-0.5.3.0/changelog
- subpackage th-env

* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Sun Jan 22 2023 Jens Petersen <petersen@redhat.com> - 0.5.0.1-1
- https://hackage.haskell.org/package/ormolu-0.5.0.1/changelog
- refresh to cabal-rpm-2.1.0 with SPDX migration

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Fri Jun 17 2022 Jens Petersen <petersen@redhat.com> - 0.1.4.1-4
- rebuild

* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Sat Jan 08 2022 Miro Hrončok <mhroncok@redhat.com> - 0.1.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34

* Thu Aug  5 2021 Jens Petersen <petersen@redhat.com> - 0.1.4.1-1
- update to 0.1.4.1

* Thu Aug  5 2021 Jens Petersen <petersen@redhat.com> - 0.1.3.0-4
- setup bash completion

* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Thu Sep 24 22:13:31 +08 2020 Jens Petersen <petersen@redhat.com> - 0.1.3.0-1
- update to 0.1.3.0

* Thu Sep  3 2020 Jens Petersen <petersen@redhat.com> - 0.1.2.0-1
- spec file generated by cabal-rpm-2.0.6
- exclude s390x because ghc-lib-parser not available