File ragel.spec of Package ragel

%define realname ragel
%define realver  6.10
%define srcext   tar.gz

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          %{realname}
Version:       %{realver}
Release:       %{?extraver:0.}1%{?dist}
License:       GPL-2.0
Group:         Development/Tools/Other
URL:           http://www.colm.net/open-source/ragel/
Summary:       State Machine Compiler

# Build-time parameters
BuildRequires: gcc-c++
BuildRequires: ruby
BuildRequires: go
### %if 0%{?suse_version}
### BuildRequires: java-1_8_0-openjdk-devel
### %else
### BuildRequires: java-1.8.0-openjdk-devel
### %endif
BuildRoot:     %{_tmppath}/%{name}-root
Source:        http://www.colm.net/files/ragel/%{realname}-%{realver}%{?extraver}.%{srcext}

%description
Ragel compiles executable finite state machines from regular languages. Ragel
targets C, C++, Obj-C, C#, D, Java, Go and Ruby. Ragel state machines can not
only recognize byte sequences as regular expression machines do, but can also
execute code at arbitrary points in the recognition of a regular language. Code
embedding is done using inline operators that do not disrupt the regular
language syntax.

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}

%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro %{?gcc_lto}'
%configure \
 --disable-static \
 CFLAGS="$_CFLAGS" \
 CXXFLAGS="$_CFLAGS" \
 LDFLAGS="$_LDFLAGS"
%{__make} %{?_smp_mflags}

%install
%{__make} install DESTDIR=%{buildroot}
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}%{_datadir}/doc

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%license COPYING
%doc CREDITS ChangeLog
%{_bindir}/*
%doc %{_mandir}/man1/*

%changelog
openSUSE Build Service is sponsored by