Blob Blame History Raw
# Prevent RPM from stripping the binaries, which breaks them:
%define __strip /bin/true

%define _default_patch_fuzz 2

Name:           nekovm
Version:        2.0.0
Release:        4%{?dist}
Summary:        Neko embedded scripting language and virtual machine

Group:          Development/Libraries
License:        LGPLv2+
URL:            http://nekovm.org/
Source0:        http://nekovm.org/_media/neko-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# Disable the Apache and mod_tora packages for now.
Patch0:         nekovm-no-apache.patch
Patch1:         nekovm-no-mod_tora.patch

# Search /usr/lib64 for libraries.
Patch2:         nekovm-library-paths.patch

# Search /usr/lib64/neko for NDLL files.  (XXX only on x86-64?)
Patch3:         nekovm-ndll-paths.patch

# Link against libmysqlclient.so, not .a
Patch4:         nekovm-libmysqlclient.so.patch

# Set the soname correctly on the shared library.
Patch5:         nekovm-set-soname.patch

# Allow extra CFLAGS to be passed.
Patch6:         nekovm-extra-cflags.patch

BuildRequires:  gc-devel
BuildRequires:  pcre-devel
BuildRequires:  gtk2-devel
BuildRequires:  mysql-devel
BuildRequires:  sqlite-devel >= 3
BuildRequires:  dos2unix


%description
Neko is a high-level dynamically typed programming language which can
also be used as an embedded scripting language. It has been designed
to provide a common runtime for several different languages. Neko is
not only very easy to learn and use, but also has the flexibility of
being able to extend the language with C libraries. You can even write
generators from your own language to Neko and then use the Neko
Runtime to compile, run, and access existing libraries.

If you need to add a scripting language to your application, Neko
provides one of the best tradeoffs available between simplicity,
extensibility and speed.

Neko allows the language designer to focus on design whilst reusing a
fast and well constructed runtime, as well as existing libraries for
accessing filesystem, network, databases, xml...

Neko has a compiler and virtual machine. The Virtual Machine is both
very lightweight and extremely well optimised so that it can run very
quickly. The VM can be easily embedded into any application and your
libraries are directly accessible using the C foreign function
interface.

The compiler converts a source .neko file into a bytecode .n file that
can be executed with the Virtual Machine. Although the compiler is
written in Neko itself, it is still very fast. You can use the
compiler as standalone commandline executable separated from the VM,
or as a Neko library to perform compile-and-run for interactive
languages.

Note that the Fedora package does not yet include the Apache modules
(mod_neko and mod_tora) owing to the difficulty in getting them to
compile.


%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}


%description    devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.


%prep
%setup -q -n neko-%{version}

for f in CHANGES LICENSE `find -name '*.[ch]' -o -name 'install.neko'`; do
  dos2unix --keepdate $f
  chmod -x $f
done

%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1

# Fedora only supports SSE on x86_64
%ifnarch x86_64
sed -i.sse 's/-msse2 -mfpmath=sse //g' Makefile
%endif

%build
# Avoid a compiler stack-overflow when building on 64 bit.
ulimit -s unlimited

# MAKEFLAGS=-jN breaks the build.
unset MAKEFLAGS

# Add the RPM flags to CFLAGS.
make EXTRA_CFLAGS="$RPM_OPT_FLAGS"


%check
make test


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mkdir -p $RPM_BUILD_ROOT%{_includedir}

make INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} install

# Put the lib files in the Fedora _libdir:
if [ %{_prefix}/lib != %{_libdir} ]; then
  mv $RPM_BUILD_ROOT%{_prefix}/lib/* $RPM_BUILD_ROOT%{_libdir}
  rmdir $RPM_BUILD_ROOT%{_prefix}/lib
fi

# Make libneko.so be a link, not a copy, of libneko.so.1.
pushd $RPM_BUILD_ROOT%{_libdir}
rm libneko.so
ln -s libneko.so.1 libneko.so
popd

# Stop prelink from stripping the binaries - they contain bytecode.
mkdir -p $RPM_BUILD_ROOT/etc/prelink.conf.d
echo '-b /usr/bin/neko*' > $RPM_BUILD_ROOT/etc/prelink.conf.d/nekovm.conf

# Remove nekoml.std - what's it for?
rm $RPM_BUILD_ROOT%{_bindir}/nekoml.std


%clean
rm -rf $RPM_BUILD_ROOT


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc LICENSE
%{_bindir}/neko
%{_bindir}/nekoc
%{_bindir}/nekoml
#{_bindir}/nekoml.std
%{_bindir}/nekotools
%{_libdir}/libneko.so
%{_libdir}/libneko.so.1
%{_libdir}/neko/
%config(noreplace) /etc/prelink.conf.d/nekovm.conf


%files devel
%defattr(-,root,root,-)
%doc CHANGES
%{_includedir}/*.h


%changelog
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Jul  1 2013 Richard W.M. Jones <rjones@redhat.com> - 2.0.0-1
- New upstream version 2.0.0 (RHBZ#979806).
- Rebase patches.
- Unset MAKEFLAGS before build.
- Make libneko.so be a symlink to libneko.so.1.

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Jul  5 2012 Peter Robinson <pbrobinson@fedoraproject.org> - 1.8.2-3
- Only build SSE on x86_64 to fix FTBFS

* Fri Feb 10 2012 Petr Pisar <ppisar@redhat.com> - 1.8.2-2
- Rebuild against PCRE 8.30

* Mon Jan 16 2012 Richard W.M. Jones <rjones@redhat.com> - 1.8.2-1
- New upstream version 1.8.2.
- Rebase and fix soname patch.
- Run 'make test'.
- A cleaner way to rewrite CFLAGS.

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Nov  7 2011 Richard W.M. Jones <rjones@redhat.com> - 1.8.1-5
- Rebuild for updated libpng 1.5.

* Wed Mar 23 2011 Dan HorĂ¡k <dan@danny.cz> - 1.8.1-4
- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Mon Dec 27 2010 Richard W.M. Jones <rjones@redhat.com> - 1.8.1-2
- Bump and rebuild.

* Thu Jan 14 2010 Richard W.M. Jones <rjones@redhat.com> - 1.8.1-1
- New upstream version 1.8.1.
- Rebase nekovm-library-paths.patch.
- Recheck package with rpmlint.

* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 1.8.0-6
- rebuilt with new openssl

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri Jan 23 2009 Richard W.M. Jones <rjones@redhat.com> - 1.8.0-3
- Rebuild to get updated mysql dep.

* Tue Dec 16 2008 Richard W.M. Jones <rjones@redhat.com> - 1.8.0-2
- New upstream release 1.8.0.
- Use dos2unix --keepdate.
- Use scriptlets to run ldconfig.
- Use _libdir instead of _prefix/lib.
- Set the soname correctly and include libneko.so.1.

* Wed Sep  3 2008 Richard W.M. Jones <rjones@redhat.com> - 1.7.1-7
- prelink conf file DOESN'T use prefixes, need to use a glob instead.

* Tue Sep  2 2008 Richard W.M. Jones <rjones@redhat.com> - 1.7.1-6
- BR sqlite-devel
- Remove DOS line-endings and executable bits from the source.
- Add RPM CFLAGS.
- *.ndll files are always installed in /usr/lib/neko (even on 64 bit).
- Search /usr/lib64 directory for libraries when building.
- When building, link against libmysqlclient.so (not .a).
- Avoid a compiler stack overflow when building on 64 bit.
- Stop prelink from stripping the binaries.

* Mon Sep  1 2008 Richard W.M. Jones <rjones@redhat.com> - 1.7.1-3
- Better way to strip the binaries.

* Sun Aug 31 2008 Richard W.M. Jones <rjones@redhat.com> - 1.7.1-2
- Initial RPM release.