3 %bcond_without ocaml_opt # native optimized binaries (bytecode is always built)
5 # not yet available on x32 (ocaml 4.02.1), update when upstream will support it
6 %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
7 %undefine with_ocaml_opt
10 Summary: PCRE binding for OCaml
11 Summary(pl.UTF-8): Wiązania PCRE dla OCamla
15 License: LGPL v2.1+ with OCaml linking exception
17 #Source0Download: https://github.com/mmottl/pcre-ocaml/releases
18 Source0: https://github.com/mmottl/pcre-ocaml/releases/download/%{version}/pcre-%{version}.tbz
19 # Source0-md5: 3f91ab553a59b661e5e7debbb876918c
20 URL: http://mmottl.github.io/pcre-ocaml/
21 BuildRequires: ocaml >= 1:4.12
22 BuildRequires: ocaml-dune >= 2.7
23 BuildRequires: ocaml-findlib >= 1.5
24 BuildRequires: pcre-devel
25 %requires_eq ocaml-runtime
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 %if %{without ocaml_opt}
29 %define no_install_post_strip 1
30 # no opt means no native binary, stripping bytecode breaks such programs
31 %define _enable_debug_packages 0
35 This OCaml-library interfaces the PCRE (Perl-compatibility regular
36 expressions) library which is written in C. It can be used for
37 matching regular expressions which are written in "Perl"-style.
39 This package contains files needed to run bytecode executables using
42 %description -l pl.UTF-8
43 Biblioteka zawarta w tym pakiecie umożliwia korzystanie z biblioteki
44 PCRE (wyrażenia regularne kompatybilne z Perlem), która jest z kolei
45 napisana w C. Może być ona używana do dopasowywania wyrażeń
46 regularnych napisanym w ,,stylu Perla''.
48 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
49 używających tej biblioteki.
52 Summary: PCRE binding for OCaml - development part
53 Summary(pl.UTF-8): Wiązania PCRE dla OCamla - część programistyczna
54 Group: Development/Libraries
55 Requires: %{name} = %{version}-%{release}
59 This OCaml-library interfaces the PCRE (Perl-compatibility regular
60 expressions) library which is written in C. It can be used for
61 matching regular expressions which are written in "Perl"-style.
63 This package contains files needed to develop OCaml programs using
66 %description devel -l pl.UTF-8
67 Biblioteka zawarta w tym pakiecie umożliwia korzystanie z biblioteki
68 PCRE (wyrażenia regularne kompatybilne z Perlem), która jest z kolei
69 napisana w C. Może być ona używana do dopasowywania wyrażeń
70 regularnych napisanym w ,,stylu Perla''.
72 Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
76 %setup -q -n pcre-%{version}
79 dune build --display=verbose
82 rm -rf $RPM_BUILD_ROOT
83 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
85 dune install --destdir=$RPM_BUILD_ROOT
88 %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/pcre/*.mli
90 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
91 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
94 %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/pcre/*.ml
96 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/doc/pcre
99 rm -rf $RPM_BUILD_ROOT
102 %defattr(644,root,root,755)
103 %doc CHANGES.md LICENSE.md README.md
104 %dir %{_libdir}/ocaml/pcre
105 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllpcre_stubs.so
106 %{_libdir}/ocaml/pcre/META
107 %{_libdir}/ocaml/pcre/pcre.cma
108 %if %{with ocaml_opt}
109 %attr(755,root,root) %{_libdir}/ocaml/pcre/pcre.cmxs
113 %defattr(644,root,root,755)
114 %{_libdir}/ocaml/pcre/dune-package
115 %{_libdir}/ocaml/pcre/opam
116 %{_libdir}/ocaml/pcre/libpcre_stubs.a
117 %{_libdir}/ocaml/pcre/pcre.cmi
118 %{_libdir}/ocaml/pcre/pcre.cmt
119 %{_libdir}/ocaml/pcre/pcre.cmti
120 %if %{with ocaml_opt}
121 %{_libdir}/ocaml/pcre/pcre.a
122 %{_libdir}/ocaml/pcre/pcre.cmx
123 %{_libdir}/ocaml/pcre/pcre.cmxa
125 %{_examplesdir}/%{name}-%{version}