2012-06-06 09:18:01 +00:00
#
2012-11-21 16:46:08 +00:00
# spec file for package ghc-rpm-macros
2012-06-06 09:18:01 +00:00
#
2013-07-31 15:36:43 +00:00
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
2012-01-11 21:21:36 +00:00
#
# 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/
#
2012-06-06 09:18:01 +00:00
2012-01-11 21:21:36 +00:00
2013-12-15 07:33:47 +00:00
%global git_hash 4d2eb25803c01c46ee84cd7f30f1bc5fb4efba52
2013-07-31 15:36:43 +00:00
%global macros_dir %{_sysconfdir} /rpm
2013-10-29 21:02:49 +00:00
%global without_hscolour 1
2012-01-11 21:21:36 +00:00
Name : ghc-rpm-macros
2013-12-15 07:33:47 +00:00
Version : 1.2
2012-11-21 16:46:08 +00:00
Release : 0
2013-07-31 15:36:43 +00:00
Summary : RPM Macros for building packages for GHC
2012-01-23 08:36:22 +00:00
License : GPL-3.0
2012-11-21 16:46:08 +00:00
Group : Development/Libraries/Other
Url : https://fedoraproject.org/wiki/Haskell_SIG
2012-01-11 21:21:36 +00:00
2013-07-31 15:36:43 +00:00
Source0 : http://pkgs.fedoraproject.org/cgit/%{name} .git/snapshot/%{name} -%{git_hash} .tar.bz2
2012-01-11 21:21:36 +00:00
Source4 : macros.ghc-suse
2013-09-26 07:01:11 +00:00
# PATCH-FIX-OPENSUSE suse-disable-debug-packages.patch peter.trommler@ohm-hochschule.de -- openSUSE way to disable debug packages
2012-11-21 16:46:08 +00:00
Patch1 : suse-disable-debug-packages.patch
2013-12-15 07:33:47 +00:00
# PATCH-FIX-OPENSUSE add-group.patch sbahling@suse.com -- Make sure a Group: tag is generated in subpackages; peter.trommler@ohm-hochschule.de: also puts libraries in System/Libraries, see package group guidelines
2013-10-11 19:15:01 +00:00
Patch2 : add-group.patch
# PATCH-FIX-OPENSUSE files-defattr.patch sbahling@suse.com -- Make sure defattr macro used in files sections; peter.trommler@ohm-hochschule.de: see also specfile guidelines, files section, permissions
Patch3 : files-defattr.patch
2013-12-15 07:33:47 +00:00
# PATCH-FIX-OPENSUSE suse-docdir.patch peter.trommler@ohm-hochschule.de -- fix location of docdir
Patch4 : suse-docdir.patch
2013-07-31 15:36:43 +00:00
# PATCH-FIX-SLE sle-sp1-rpmdeps.patch peter.trommler@ohm-hochschule.de -- SLE's RPM is too old in 11 SP1 and SP2
2012-11-21 16:46:08 +00:00
Patch100 : sle-sp1-rpmdeps.patch
2013-10-11 19:15:01 +00:00
2013-12-16 15:28:59 +00:00
# for execstack
Requires : prelink
2012-01-11 21:21:36 +00:00
Requires : rpm
2013-07-31 15:36:43 +00:00
%if %{undefined without_hscolour}
Requires : hscolour
%endif
2012-01-11 21:21:36 +00:00
2012-02-19 19:34:18 +00:00
BuildRoot : %{_tmppath} /%{name} -%{version} -build
2012-01-11 21:21:36 +00:00
%description
2013-07-31 15:36:43 +00:00
A set of macros for building GHC packages following the openSUSE
Haskell Guidelines. ghc needs to be installed in
order to make use of these macros.
2012-01-11 21:21:36 +00:00
2013-07-31 15:36:43 +00:00
%package extra
Summary : Extra RPM macros for building Haskell packages with several libs
Group : Development/Libraries/Other
Requires : %{name} = %{version} -%{release}
%description extra
Set of macros to build ghc packages that contain multiple subpackages.
2012-01-11 21:21:36 +00:00
%prep
2013-07-31 15:36:43 +00:00
%setup -q -n %{name} -%{git_hash}
2012-11-21 16:46:08 +00:00
%patch1 -p1 -b .debug
2013-10-11 19:15:01 +00:00
%patch2 -p1
%patch3 -p1
2013-12-15 07:33:47 +00:00
%patch4 -p1
2012-11-21 16:46:08 +00:00
%if 0%{?sles_version}
%patch -P 100 -p1
2012-02-27 13:11:20 +00:00
%endif
2012-01-11 21:21:36 +00:00
%build
echo no build stage needed
%install
2013-07-31 15:36:43 +00:00
install -p -D -m 0644 ./ghc-rpm-macros.ghc %{buildroot} %{macros_dir} /macros.ghc
install -p -D -m 0644 ./ghc-rpm-macros.ghc-extra ${RPM_BUILD_ROOT} /%{macros_dir} /macros.ghc-extra
install -p -D -m 0644 %{SOURCE4} %{buildroot} %{_sysconfdir} /rpm/macros.ghc-suse
2012-01-11 21:21:36 +00:00
install -p -D -m 0755 ghc-deps.sh %{buildroot} /%{_prefix} /lib/rpm/ghc-deps.sh
2013-07-31 15:36:43 +00:00
install -p -D -m 0755 cabal-tweak-dep-ver %{buildroot} /%{_bindir} /cabal-tweak-dep-ver
install -p -D -m 0755 cabal-tweak-flag %{buildroot} /%{_bindir} /cabal-tweak-flag
2012-01-11 21:21:36 +00:00
# this is why this package is now arch-dependent:
# turn off shared libs and dynamic linking on secondary archs
%ifnarch %{ix86} x86_64
2013-08-01 15:27:07 +00:00
cat >> %{buildroot} %{macros_dir} /macros.ghc <<EOF
2012-01-11 21:21:36 +00:00
# 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
2013-07-31 15:36:43 +00:00
%config %{macros_dir} /macros.ghc
%config %{macros_dir} /macros.ghc-suse
2012-01-11 21:21:36 +00:00
%{_prefix} /lib/rpm/ghc-deps.sh
2012-06-26 16:05:51 +00:00
%{_bindir} /cabal-tweak-dep-ver
2013-07-31 15:36:43 +00:00
%{_bindir} /cabal-tweak-flag
%files extra
%defattr (-,root,root,-)
%config %{macros_dir} /macros.ghc-extra
2012-01-11 21:21:36 +00:00
%changelog