Conditionally define use_prebuilt_docs macro

Depending on the distribution, define use_prebuilt_docs
macro in a single place with a single logic.

This replaces the part where "%if 0%{?fedora}" was formerly
treated as the logical negation of "%if 0%{?el4}%{?el5}%{?el6}".
This commit is contained in:
Hans Ulrich Niedermann 2011-04-01 00:57:34 +02:00
parent a086b7a931
commit 37167bfd7e

View File

@ -13,6 +13,12 @@
%bcond_without doc %bcond_without doc
%if 0%{fedora}
%define use_prebuilt_docs 0
%else
%define use_prebuilt_docs 1
%endif
%global n_uvr %{name}-%{upstream_ver}-%{upstream_rel_for_rpm} %global n_uvr %{name}-%{upstream_ver}-%{upstream_rel_for_rpm}
Name: erlang Name: erlang
@ -24,7 +30,7 @@ Group: Development/Languages
License: ERPL License: ERPL
URL: http://www.erlang.org URL: http://www.erlang.org
Source0: http://www.erlang.org/download/otp_src_%{upstream_ver}%{upstream_rel}.tar.gz Source0: http://www.erlang.org/download/otp_src_%{upstream_ver}%{upstream_rel}.tar.gz
%if 0%{?el4}%{?el5}%{?el6} %if %{use_prebuilt_docs}
Source1: http://erlang.org/download/otp_doc_html_%{upstream_ver}%{upstream_rel}.tar.gz Source1: http://erlang.org/download/otp_doc_html_%{upstream_ver}%{upstream_rel}.tar.gz
Source2: http://erlang.org/download/otp_doc_man_%{upstream_ver}%{upstream_rel}.tar.gz Source2: http://erlang.org/download/otp_doc_man_%{upstream_ver}%{upstream_rel}.tar.gz
%endif %endif
@ -93,7 +99,8 @@ BuildRequires: zlib-devel
BuildRequires: flex BuildRequires: flex
BuildRequires: m4 BuildRequires: m4
%if %{with doc} %if %{with doc}
%if 0%{?fedora} %if %{use_prebuilt_docs}
%else
BuildRequires: fop BuildRequires: fop
BuildRequires: libxslt BuildRequires: libxslt
# Required for building docs (escript) # Required for building docs (escript)
@ -1044,7 +1051,8 @@ popd
make make
%if %{with doc} %if %{with doc}
%if 0%{?fedora} %if %{use_prebuilt_docs}
%else
make docs make docs
%endif %endif
%endif %endif
@ -1083,7 +1091,7 @@ install -m 0644 xemacs-erlang/*.elc "$RPM_BUILD_ROOT%{_xemacs_sitelispdir}/erlan
make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT install
%if %{with doc} %if %{with doc}
%if 0%{?el4}%{?el5}%{?el6} %if %{use_prebuilt_docs}
# extract prebuilt docs and man-pages # extract prebuilt docs and man-pages
tar xf %{SOURCE1} -C $RPM_BUILD_ROOT%{_libdir}/erlang tar xf %{SOURCE1} -C $RPM_BUILD_ROOT%{_libdir}/erlang
tar xf %{SOURCE2} -C $RPM_BUILD_ROOT%{_libdir}/erlang tar xf %{SOURCE2} -C $RPM_BUILD_ROOT%{_libdir}/erlang