diff --git a/labltk-8.06.13.tar.gz b/labltk-8.06.13.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d72da4602e02abe34f69fab70dcd67798d94dc6e Binary files /dev/null and b/labltk-8.06.13.tar.gz differ diff --git a/ocaml-labltk.spec b/ocaml-labltk.spec new file mode 100644 index 0000000000000000000000000000000000000000..e7ea43ac05f7869678673fc55d8989c9627efb28 --- /dev/null +++ b/ocaml-labltk.spec @@ -0,0 +1,119 @@ +%define anolis_release 1 + +%undefine _package_note_flags +%ifarch %{ocaml_native_compiler} +%global native_compiler 1 +%else +%global native_compiler 0 +%endif + +Name: ocaml-labltk +Version: 8.06.13 +Release: %{anolis_release}%{?dist} +Summary: Tcl/Tk interface for OCaml +License: LGPLv2+ with exceptions +URL: https://github.com/garrigue/labltk +Source0: https://github.com/garrigue/labltk/archive/%{version}/labltk-%{version}.tar.gz + +BuildRequires: make +BuildRequires: ocaml +BuildRequires: ocaml-srpm-macros +BuildRequires: tcl-devel, tk-devel + +%description +labltk or mlTk is a library for interfacing OCaml with the scripting +language Tcl/Tk (all versions since 8.0.3, but no betas). + +%package devel +Summary: Tcl/Tk interface for OCaml +Requires: %{name} = %{version}-%{release} + +%description devel +labltk or mlTk is a library for interfacing OCaml with the scripting +language Tcl/Tk (all versions since 8.0.3, but no betas). + +This package contains the development files. + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{EVR} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + +%prep +%setup -q -n labltk-%{version} + +# Remove version control files which might get copied into documentation. +find -name .gitignore -delete + +# Kill -warn-error. +find -type f | xargs sed -i -e 's/-warn-error/-w/g' + +# Don't build ocamlbrowser. +mv browser browser.old +mkdir browser +echo -e 'all:\ninstall:\n' > browser/Makefile + +%build +./configure -verbose + +# Build does not work in parallel. +unset MAKEFLAGS + +%if !%{native_compiler} +make byte +%else +make all opt \ + SHAREDCCCOMPOPTS="%{optflags} -fPIC" \ + TK_LINK="%{__global_ldflags} -ltk8.6 -ltcl8.6" +%endif + +%install +mkdir -p $RPM_BUILD_ROOT%{_bindir} +mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml/labltk +mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs +make install \ + BINDIR=$RPM_BUILD_ROOT%{_bindir} \ + INSTALLDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml/labltk \ + STUBLIBDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs \ + RANLIB=: +%if %{native_compiler} +# The *.o files are not installed by the Makefile. AIUI +# that prevents linking with native code programs. +install -m 0644 camltk/*.o $RPM_BUILD_ROOT%{_libdir}/ocaml/labltk +%endif + +%generate_compatibility_deps + +%files +%dir %{_libdir}/ocaml/labltk +%{_libdir}/ocaml/labltk/*.cmi +%{_libdir}/ocaml/labltk/*.cma +%{_libdir}/ocaml/labltk/*.cmo +%{_libdir}/ocaml/stublibs/dlllabltk.so +%dir %{abidir} +%{abidir}/dlllabltk.dump + +%files devel +%doc examples_camltk +%doc examples_labltk +%{_bindir}/labltk +%{_libdir}/ocaml/labltk/labltktop +%{_libdir}/ocaml/labltk/pp +%{_libdir}/ocaml/labltk/tkcompiler +%{_libdir}/ocaml/labltk/*.a +%if %{native_compiler} +%{_libdir}/ocaml/labltk/*.cmxa +%{_libdir}/ocaml/labltk/*.cmx +%{_libdir}/ocaml/labltk/*.o +%endif +%{_libdir}/ocaml/labltk/*.mli + +%files doc +%doc Changes README.mlTk + +%changelog +* Mon Mar 20 2023 Yuanhong Peng - 8.06.13-1 +- Init from upstream