include *.{a,cmx,cmxa} only in opt builds

add support for _ignore_exclusive_arch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:ocaml/ocaml-pcre?expand=0&rev=4
This commit is contained in:
Olaf Hering 2013-01-08 14:41:11 +00:00 committed by Git OBS Bridge
parent f6a4e9dd00
commit 7dc3603f19

View File

@ -28,6 +28,8 @@
# norootforbuild
%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
Name: ocaml-pcre
Version: 7.0.2
Release: 1
@ -35,10 +37,13 @@ Summary: Perl compatibility regular expressions (PCRE) for OCaml
Group: Development/Libraries/Other
License: LGPL-2.0
URL: http://www.ocaml.info/home/ocaml_sources.html#pcre-ocaml
URL: https://bitbucket.org/mmottl/pcre-ocaml
Source0: https://bitbucket.org/mmottl/pcre-ocaml/downloads/pcre-ocaml-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
ExcludeArch: sparc64 s390 s390x
%if "%{_ignore_exclusive_arch}" != ""
%else
ExclusiveArch: %ix86 x86_64
%endif
BuildRequires: ocaml >= 3.10.2
BuildRequires: ocaml-ocamldoc
@ -86,9 +91,11 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%doc COPYING.txt README.md
%{_libdir}/ocaml/pcre
%if %opt
%exclude %{_libdir}/ocaml/pcre/*.a
%exclude %{_libdir}/ocaml/pcre/*.cmx
%exclude %{_libdir}/ocaml/pcre/*.cmxa
%endif
%exclude %{_libdir}/ocaml/pcre/*.mli
%{_libdir}/ocaml/stublibs/*.so
%{_libdir}/ocaml/stublibs/*.so.owner
@ -96,9 +103,11 @@ rm -rf $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root,-)
%if %opt
%{_libdir}/ocaml/pcre/*.a
%{_libdir}/ocaml/pcre/*.cmx
%{_libdir}/ocaml/pcre/*.cmxa
%endif
%{_libdir}/ocaml/pcre/*.mli