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

%global pkg_name rpmbuild-order
%global pkgver %{pkg_name}-%{version}

%bcond_without tests

Name:           %{pkg_name}
Version:        0.4.11
Release:        %autorelease
Summary:        Sort RPM packages in dependency order

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
# End cabal-rpm sources

# Begin cabal-rpm deps:
BuildRequires:  ghc-Cabal-devel
BuildRequires:  ghc-rpm-macros
BuildRequires:  ghc-base-devel
BuildRequires:  ghc-case-insensitive-devel
BuildRequires:  ghc-directory-devel
BuildRequires:  ghc-extra-devel
BuildRequires:  ghc-fgl-devel
BuildRequires:  ghc-filepath-devel
BuildRequires:  ghc-graphviz-devel
BuildRequires:  ghc-regex-tdfa-devel
BuildRequires:  ghc-simple-cmd-devel
BuildRequires:  ghc-simple-cmd-args-devel
%if %{with ghc_prof}
BuildRequires:  ghc-base-prof
BuildRequires:  ghc-case-insensitive-prof
BuildRequires:  ghc-directory-prof
BuildRequires:  ghc-extra-prof
BuildRequires:  ghc-fgl-prof
BuildRequires:  ghc-filepath-prof
BuildRequires:  ghc-graphviz-prof
BuildRequires:  ghc-regex-tdfa-prof
BuildRequires:  ghc-simple-cmd-prof
BuildRequires:  ghc-simple-cmd-args-prof
%endif
%if %{with tests}
BuildRequires:  ghc-hspec-devel
BuildRequires:  ghc-unix-devel
%endif
# End cabal-rpm deps
# for rpmspec
Requires:       rpm-build

%description
The rpmbuild-order tool sorts source RPM packages by build dependencies, so
that they can be built in a correct order. It does this by reading RPM package
spec files and then topologically sorts them according to their build
dependencies. The code evolved from cabal-sort by Henning Thielemann.
It can also order the dependencies or reverse depends of one or more packages
among the packages checked out in neighboring directories (which can be useful
to see what packages are affected when a low-level package changes, or which
packages are dependents of one of more packages). It also has support for
setting RPM options for bcond etc, which can affect dependencies. It can also
output dependency graphs. Since version 0.4, a library API is provided.


%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


%prep
# Begin cabal-rpm setup:
%setup -q
# End cabal-rpm setup


%build
# Begin cabal-rpm build:
%ghc_lib_build
# End cabal-rpm build


%install
# Begin cabal-rpm install
%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

install -p -m 0644 -D %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1


%check
%if %{with tests}
PATH=%{buildroot}%{_bindir}:$PATH
%cabal_test
%endif


%files
# Begin cabal-rpm files:
%license LICENSE
%doc ChangeLog.md README.md TODO
%{_bindir}/%{name}
%{_datadir}/bash-completion/completions/%{name}
# End cabal-rpm files
%{_mandir}/man1/%{name}.1*


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


%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
%doc ChangeLog.md README.md TODO


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


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


%changelog
%autochangelog