ghc-rpm-macros/ghc-rpm-macros.spec

94 lines
2.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for ghc-rpm-macros
#
# Copyright (c) 2012 Peter Trommler peter.trommler@ohm-hochschule.de
#
# 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 debug_package %{nil}
%global macros_file %{_sysconfdir}/rpm/macros.ghc
Name: ghc-rpm-macros
Version: 0.90
Release: 1
Summary: Macros for building packages for GHC
Group: Development/Libraries/Other
License: GPL-3.0
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
Patch: buildService.patch
Patch1: 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
%if %{defined sles_version}
%patch1 -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
# 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
#%{_prefix}/lib/rpm/magic
%changelog