1
0
ghc-rpm-macros/ghc-rpm-macros.spec
2012-11-21 16:46:08 +00:00

93 lines
2.7 KiB
RPMSpec

#
# spec file for package ghc-rpm-macros
#
# Copyright (c) 2012 SUSE LINUX Products 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 macros_file %{_sysconfdir}/rpm/macros.ghc
Name: ghc-rpm-macros
Version: 0.95.5.1
Release: 0
Summary: Macros for building packages for GHC
License: GPL-3.0
Group: Development/Libraries/Other
Url: https://fedoraproject.org/wiki/Haskell_SIG
# This is a Fedora maintained package which is specific to
# our distribution. Thus the source is only available from
# within this srpm.
Source0: ghc-rpm-macros.ghc
Source1: COPYING
Source2: AUTHORS
Source3: ghc-deps.sh
Source4: macros.ghc-suse
Source5: cabal-tweak-dep-ver
Patch: buildService.patch
Patch1: suse-disable-debug-packages.patch
Patch100: sle-sp1-rpmdeps.patch
#Requires: redhat-rpm-config
Requires: rpm
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
A set of macros for building GHC packages following the Haskell Guidelines
of the Fedora Haskell SIG. ghc needs to be installed in order to make use of
these macros.
%prep
%setup -c -T
cp %{SOURCE1} %{SOURCE2} .
cp %{SOURCE0} %{SOURCE3} .
%patch -p1 -b .obs
%patch1 -p1 -b .debug
%if 0%{?sles_version}
%patch -P 100 -p1
%endif
%build
echo no build stage needed
%install
install -p -D -m 0644 ./ghc-rpm-macros.ghc ${RPM_BUILD_ROOT}/%{macros_file}
install -p -D -m 0644 %{SOURCE4} ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc-suse
install -p -D -m 0755 ghc-deps.sh %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh
install -p -D -m 0755 %{SOURCE5} %{buildroot}/%{_bindir}/cabal-tweak-dep-ver
# this is why this package is now arch-dependent:
# turn off shared libs and dynamic linking on secondary archs
%ifnarch %{ix86} x86_64
cat >> %{buildroot}/%{macros_file} <<EOF
# shared libraries are only supported on primary intel archs
%%ghc_without_dynamic 1
%%ghc_without_shared 1
EOF
%endif
%files
%defattr(-,root,root,-)
%doc COPYING AUTHORS
%config(noreplace) %{macros_file}
%config(noreplace) %{_sysconfdir}/rpm/macros.ghc-suse
%{_prefix}/lib/rpm/ghc-deps.sh
%{_bindir}/cabal-tweak-dep-ver
%changelog