-%define ocaml_ver 1:3.09.2
+#
+# Conditional build:
+%bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built)
+
+# not yet available on x32 (ocaml 4.02.1), remove when upstream will support it
+%ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9
+%undefine with_ocaml_opt
+%endif
+
Summary: Polimorphic XML Parser for OCaml
Summary(pl.UTF-8): Polimorficzny analizator składniowy XML-a dla OCamla
Name: ocaml-pxp
-Version: 1.1.6
-Release: 10
+Version: 1.2.9
+Release: 2
License: distributable
Group: Libraries
-Source0: http://www.ocaml-programming.de/packages/pxp-%{version}.tar.gz
-# Source0-md5: 8f1c26e348405fb7f064b4bc2584ab59
-URL: http://www.ocaml-programming.de/programming/pxp.html
-BuildRequires: ocaml >= %{ocaml_devel}
+Source0: http://download.camlcity.org/download/pxp-%{version}.tar.gz
+# Source0-md5: 8002253eade813b8355500f4c59f8da8
+URL: http://projects.camlcity.org/projects/pxp.html
+BuildRequires: ocaml >= 1:3.09.2
+BuildRequires: ocaml-camlp4
BuildRequires: ocaml-findlib
-BuildRequires: ocaml-net-netstring-devel >= 1.1.1-2
-BuildRequires: ocaml-wlex-devel
+BuildRequires: ocaml-ocamldoc-devel
+BuildRequires: ocaml-net-netstring-devel >= 3.6-2
+BuildRequires: ocaml-net-netsys-devel >= 3.6-2
+BuildRequires: ocaml-net-netunidata-devel
+BuildRequires: ocaml-ulex
BuildRequires: sed >= 4.0
-%requires_eq ocaml-wlex
+BuildConflicts: ocaml-wlex-devel
+%requires_eq ocaml-ulex
%requires_eq ocaml-runtime
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Group: Development/Libraries
%requires_eq ocaml
%requires_eq ocaml-net-netstring-devel
-%requires_eq ocaml-wlex-devel
%description devel
PXP is a validating parser for XML 1.0 which has been written entirely
%build
./configure \
- -with-lex-iso88591 \
- -with-lex-utf8 \
- -with-wlex
+ -with-lex \
+ -with-ulex \
+ -without-wlex \
+ -with-pp
sed -i -e 's/-g//' Makefile.rules
%{__make} -j1 \
- all opt
+ all %{?with_ocaml_opt:opt}
%install
rm -rf $RPM_BUILD_ROOT
fi
done
cd $dir
-rm $RPM_BUILD_ROOT%{_libdir}/ocaml/pxp/*.{o,mli}
install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
%files devel
%defattr(644,root,root,755)
-%doc doc/ABOUT-FINDLIB doc/EXTENSIONS doc/README doc/RELEASE-NOTES doc/SPEC
-%doc doc/design.txt LICENSE doc/manual/html
+%doc doc/README doc/SPEC
+%doc doc/design.txt doc/manual/html
%dir %{_libdir}/ocaml/pxp
-%{_libdir}/ocaml/pxp/*
+%{_libdir}/ocaml/pxp/*.cm[xi]
+%{_libdir}/ocaml/pxp/*.cma
+%{_libdir}/ocaml/pxp/*.cmo
+%{_libdir}/ocaml/pxp/*.mli
+%if %{with ocaml_opt}
+%{_libdir}/ocaml/pxp/*.[ao]
+%{_libdir}/ocaml/pxp/*.cmxa
+%endif
%{_examplesdir}/%{name}-%{version}
%{_libdir}/ocaml/site-lib/*