diff --git a/ghc-X11.spec b/ghc-X11.spec index 5d5a57e..235a011 100644 --- a/ghc-X11.spec +++ b/ghc-X11.spec @@ -4,8 +4,8 @@ %define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{pkg_name}-%{version} %define pkg_docdir %{_docdir}/ghc/libraries/%{pkg_name} -%define build_prof 1 -%define build_doc 1 +%bcond_without prof +%bcond_without doc # ghc does not emit debug information %define debug_package %{nil} @@ -24,7 +24,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # ghc has only been bootstrapped on the following archs: ExclusiveArch: i386 x86_64 ppc BuildRequires: ghc = %{ghc_version} -%if %{build_prof} +%if %{with prof} BuildRequires: ghc-prof = %{ghc_version} %endif BuildRequires: libX11-devel, libXinerama-devel, libXext-devel, libXt-devel @@ -42,7 +42,7 @@ documentation of these calls, refer to "The Xlib Programming Manual", available online at . -%if %{build_prof} +%if %{with prof} %package prof Summary: Profiling libraries for %{name} Group: Development/Libraries @@ -65,13 +65,13 @@ This package contains profiling libraries for ghc %{ghc_version}. %build %cabal_configure --ghc \ -%if %{build_prof} +%if %{with prof} -p %else %{nil} %endif %cabal build -%if %{build_doc} +%if %{with doc} %cabal haddock %endif %ghc_gen_scripts @@ -90,7 +90,7 @@ rm -rf $RPM_BUILD_ROOT %post %ghc_postinst_script -%if %{build_doc} +%if %{with doc} %ghc_reindex_haddock %endif @@ -101,7 +101,7 @@ rm -rf $RPM_BUILD_ROOT %postun if [ "$1" -eq 0 ] ; then -%if %{build_doc} +%if %{with doc} %ghc_reindex_haddock %endif fi @@ -110,12 +110,12 @@ fi %files -f %{name}.files %defattr(-,root,root,-) %doc LICENSE -%if %{build_doc} +%if %{with doc} %{pkg_docdir} %endif -%if %{build_prof} +%if %{with prof} %files prof -f %{name}-prof.files %defattr(-,root,root,-) %endif