labltk/labltk.spec

104 lines
2.9 KiB
RPMSpec
Raw Normal View History

2020-10-21 15:31:42 +08:00
%ifarch %{ocaml_native_compiler}
%global native_compiler 1
%else
%global native_compiler 0
%endif
Name: ocaml-labltk
2023-05-15 17:39:17 +08:00
Version: 8.06.13
2022-04-15 17:55:42 +08:00
Release: 1
2020-10-21 15:31:42 +08:00
Summary: Tcl/Tk interface for OCaml
License: LGPLv2+ with exceptions
URL: https://github.com/garrigue/labltk
2022-04-15 17:55:42 +08:00
Source0: https://github.com/garrigue/labltk/archive/%{version}/labltk-%{version}.tar.gz
2020-10-21 15:31:42 +08:00
# This adds debugging (-g) everywhere.
2023-05-15 17:39:17 +08:00
Patch1: labltk-8.06.13-enable-debugging.patch
2022-04-15 17:55:42 +08:00
Patch2: add_sp.patch
2023-05-15 17:39:17 +08:00
Patch3: labltk-8.06.12-use-fpic-configure.patch
BuildRequires: ocaml tcl-devel tk-devel make
2020-10-21 15:31:42 +08:00
%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}%{?_isa} = %{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.
%prep
2022-04-15 17:55:42 +08:00
%setup -q -n labltk-%{version}
2020-10-21 15:31:42 +08:00
%patch1 -p1
%patch2 -p1
2023-05-15 17:39:17 +08:00
%patch3 -p1
2020-10-21 15:31:42 +08:00
find -name .gitignore -delete
find -type f | xargs sed -i -e 's/-warn-error/-w/g'
2023-05-15 17:39:17 +08:00
# Don't build ocamlbrowser.
mv browser browser.old
mkdir browser
echo -e 'all:\ninstall:\n' > browser/Makefile
2020-10-21 15:31:42 +08:00
%build
2023-05-15 17:39:17 +08:00
./configure -verbose
2020-10-21 15:31:42 +08:00
unset MAKEFLAGS
%if !%{native_compiler}
make byte
%else
2023-05-15 17:39:17 +08:00
make all opt \
SHAREDCCCOMPOPTS="%{optflags} -fPIC" \
TK_LINK="%{__global_ldflags} -ltk8.6 -ltcl8.6"
2020-10-21 15:31:42 +08:00
%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 \
2023-05-15 17:39:17 +08:00
STUBLIBDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs \
RANLIB=:
2020-10-21 15:31:42 +08:00
%if %{native_compiler}
install -m 0644 camltk/*.o $RPM_BUILD_ROOT%{_libdir}/ocaml/labltk
%endif
%files
%doc Changes README.mlTk
%dir %{_libdir}/ocaml/labltk
%{_libdir}/ocaml/labltk/*.cmi
%{_libdir}/ocaml/labltk/*.cma
%{_libdir}/ocaml/labltk/*.cmo
%{_libdir}/ocaml/stublibs/dlllabltk.so
%files devel
%doc README.mlTk
%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
%changelog
2023-05-15 17:39:17 +08:00
* Mon May 15 2023 liyanan <thistleslyn@163.com> - 8.06.13-1
- update version to 8.06.13
2022-04-15 17:55:42 +08:00
* Fri Apr 15 2022 wangkai <wangkai385@h-partners.com> -8.06.11-1
- update to 8.06.11
* Thu Sep 9 2021 gongzhengtang <gongzhengtang@huawei.com> - 8.06.4-2
2021-09-09 20:35:29 +08:00
- fix sp
2020-10-21 15:31:42 +08:00
* Fri Oct 9 2020 maminjie <maminjie1@huawei.com> - 8.06.4-1
- package init