File ghc-mod.spec of Package ghc-mod.openSUSE_Leap_42.2_Update

#
# spec file for package ghc-mod
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%global pkg_name ghc-mod
%bcond_with tests
Name:           %{pkg_name}
Version:        5.5.0.0
Release:        0
Summary:        Happy Haskell Programming
License:        AGPL-3.0+ AND BSD-3-Clause
Group:          Development/Languages/Other
Url:            https://hackage.haskell.org/package/%{name}
Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
Source1:        https://hackage.haskell.org/package/%{name}-%{version}/revision/1.cabal#/%{name}.cabal
BuildRequires:  chrpath
BuildRequires:  ghc-Cabal-devel
BuildRequires:  ghc-binary-devel
BuildRequires:  ghc-bytestring-devel
BuildRequires:  ghc-cabal-helper-devel
BuildRequires:  ghc-containers-devel
BuildRequires:  ghc-deepseq-devel
BuildRequires:  ghc-directory-devel
BuildRequires:  ghc-djinn-ghc-devel
BuildRequires:  ghc-extra-devel
BuildRequires:  ghc-fclabels-devel
BuildRequires:  ghc-filepath-devel
BuildRequires:  ghc-ghc-devel
BuildRequires:  ghc-ghc-paths-devel
BuildRequires:  ghc-ghc-syb-utils-devel
BuildRequires:  ghc-haskell-src-exts-devel
BuildRequires:  ghc-hlint-devel
BuildRequires:  ghc-monad-control-devel
BuildRequires:  ghc-monad-journal-devel
BuildRequires:  ghc-mtl-devel
BuildRequires:  ghc-old-time-devel
BuildRequires:  ghc-optparse-applicative-devel
BuildRequires:  ghc-pipes-devel
BuildRequires:  ghc-pretty-devel
BuildRequires:  ghc-process-devel
BuildRequires:  ghc-rpm-macros
BuildRequires:  ghc-safe-devel
BuildRequires:  ghc-split-devel
BuildRequires:  ghc-syb-devel
BuildRequires:  ghc-temporary-devel
BuildRequires:  ghc-text-devel
BuildRequires:  ghc-time-devel
BuildRequires:  ghc-transformers-base-devel
BuildRequires:  ghc-transformers-devel
Suggests:       emacs-haskell-mode
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{with tests}
BuildRequires:  ghc-doctest-devel
BuildRequires:  ghc-hspec-devel
%endif

%description
Ghc-mod is a backend program to enrich Haskell programming in editors.
It strives to offer most of the features one has come to expect from modern
IDEs in any editor. ghc-mod provides a library for other haskell programs to
use as well as a standalone program for easy editor integration. All of the
fundamental functionality of the frontend program can be accessed through the
library however many implementation details are hidden and if you want to
significantly extend ghc-mod you should submit these changes upstream instead
of implementing them on top of the library. For more information, please see
its home page.

%package -n ghc-%{name}
Summary:        Haskell %{name} library
Group:          System/Libraries

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

%package -n ghc-%{name}-devel
Summary:        Haskell %{name} library development files
Group:          Development/Libraries/Other
Requires:       ghc-%{name} = %{version}-%{release}
Requires:       ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
Requires(postun): ghc-compiler = %{ghc_version}

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

%prep
%setup -q
cp -p %{SOURCE1} %{name}.cabal

%build
%define cabal_configure_options --libexecdir=%{_libexecdir}
%ghc_lib_build

%install
%ghc_lib_install
%ghc_fix_rpath %{pkg_name}-%{version}
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
echo 'export cabal_helper_libexecdir=%{_libexecdir}' > %{buildroot}%{_sysconfdir}/profile.d/ghc-mod.sh
echo 'setenv cabal_helper_libexecdir %{_libexecdir}' > %{buildroot}%{_sysconfdir}/profile.d/ghc-mod.csh
rm %{buildroot}%{_datadir}/%{name}-%{version}/LICENSE
rm %{buildroot}%{_datadir}/%{name}-%{version}/COPYING.AGPL3
rm %{buildroot}%{_datadir}/%{name}-%{version}/COPYING.BSD3

%check
%cabal_test

%post -n ghc-%{name}-devel
%ghc_pkg_recache

%postun -n ghc-%{name}-devel
%ghc_pkg_recache

%files
%defattr(-,root,root,-)
%doc LICENSE
%doc COPYING.BSD3
%doc COPYING.AGPL3
%{_bindir}/%{name}
%{_bindir}/ghc-modi
%{_datadir}/%{name}-%{version}
%config %{_sysconfdir}/profile.d/ghc-mod.sh
%config %{_sysconfdir}/profile.d/ghc-mod.csh

%files -n ghc-%{name} -f ghc-%{name}.files
%defattr(-,root,root,-)
%doc LICENSE
%doc COPYING.BSD3
%doc COPYING.AGPL3

%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
%defattr(-,root,root,-)

%changelog
openSUSE Build Service is sponsored by