%global soversion %(echo '%{version}' | cut -f 1-2 -d '.') Name: mruby Version: 3.3.0 Release: %autorelease Summary: Lightweight implementation of the Ruby language # License breakdown: # [LicenseRef-Fedora-Public-Domain] # - mrbgems/mruby-bigint/* # - src/fmt_fp.c # - src/readfloat.c # [GPL-3.0-or-later] # - mrbgems/mruby-compiler/core/y.tab.c # Rest is MIT License: MIT AND LicenseRef-Fedora-Public-Domain AND GPL-3.0-or-later URL: https://github.com/mruby/mruby Source0: https://github.com/mruby/mruby/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: rubygem-rake BuildRequires: doxygen BuildRequires: graphviz BuildRequires: web-assets-devel %description Mruby is the lightweight implementation of the Ruby language complying to (part of) the ISO standard with more recent features provided by Ruby 3.x. Also, its syntax is Ruby 3.x compatible except for pattern matching. %package devel Summary: Development libraries and header files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{summary}. %package static Summary: Static library of %{name} Requires: %{name}-devel%{?_isa} = %{version}-%{release} %description static %{summary}. %package doc BuildArch: noarch Summary: Documentation for %{name} Requires: js-jquery %description doc %{summary}. %prep %autosetup -p1 # code used on Windows platform licensed under HPND-Kevlin-Henney rm -r mrbgems/mruby-dir/src/Win %build CFLAGS+='-fpic' LDFLAGS+='-lm' rake -v all pushd build/host rm bin/* ${CC} -shared -o lib/libmruby.so.%{soversion} ${LDFLAGS} -Wl,-soname,libmruby.so.%{soversion} -Wl,--whole-archive lib/libmruby.a -Wl,--no-whole-archive ${CC} ${CFLAGS} -o "bin/mrbc" mrbgems/mruby-bin-mrbc/tools/mrbc/*.o ${LDFLAGS} "lib/libmruby_core.a" ${CC} ${CFLAGS} -o "bin/mirb" mrbgems/mruby-bin-mirb/tools/mirb/*.o ${LDFLAGS} -Llib -Wl,-Bdynamic -lmruby ${CC} ${CFLAGS} -o "bin/mrdb" mrbgems/mruby-bin-debugger/tools/mrdb/*.o ${LDFLAGS} -Llib -Wl,-Bdynamic -lmruby ${CC} ${CFLAGS} -o "bin/mruby" mrbgems/mruby-bin-mruby/tools/mruby/*.o ${LDFLAGS} -Llib -Wl,-Bdynamic -lmruby ${CC} ${CFLAGS} -o "bin/mruby-strip" mrbgems/mruby-bin-strip/tools/mruby-strip/*.o ${LDFLAGS} -Llib -Wl,-Bdynamic -lmruby popd rake -v doc:capi %install export PREFIX=%{buildroot}%{_prefix} rake install mv -T --update=none %{buildroot}%{_prefix}/lib %{buildroot}%{_libdir} ln -s libmruby.so.%{soversion} %{buildroot}%{_libdir}/libmruby.so mkdir -p %{buildroot}%{_docdir}/%{name} rm doc/capi/html/jquery.js ln -s %{_webassetdir}/jquery/latest/jquery.js doc/capi/html/jquery.js mv -t %{buildroot}%{_docdir}/%{name} doc/capi/html %check export LD_LIBRARY_PATH=%{buildroot}%{_libdir} rake test %files %license LICENSE LEGAL %doc README.md %{_bindir}/mirb %{_bindir}/mrbc %{_bindir}/mrdb %{_bindir}/mruby %{_libdir}/libmruby.so.%{soversion} %files devel %{_libdir}/libmruby.so %{_includedir}/* %files static %license LICENSE LEGAL %{_bindir}/mruby-config %{_bindir}/mruby-strip %{_libdir}/libmruby.a %{_libdir}/libmruby_core.a %{_libdir}/libmruby.flags.mak %files doc %license LICENSE LEGAL %{_docdir}/%{name}/ %changelog %autochangelog