--- ragel.spec.orig	2015-06-18 22:12:28.000000000 +0000
+++ ragel.spec	2016-01-20 14:49:53.980327766 +0000
@@ -1,17 +1,20 @@
-Name:           ragel   
+Name:           scylla-ragel   
+%define orig_name ragel
 Version:        6.8
 Release:        5%{?dist}
 Summary:        Finite state machine compiler
 
 Group:          Development/Tools
 License:        GPLv2+
-URL:            http://www.complang.org/%{name}/
-Source0:        http://www.complang.org/%{name}/%{name}-%{version}.tar.gz
+URL:            http://www.complang.org/%{orig_name}/
+Source0:        http://www.complang.org/%{orig_name}/%{orig_name}-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 # for documentation building
 BuildRequires:  gcc-objc, autoconf, gcc-c++
+Requires:	scylla-env
 Requires:       gawk
+%define _prefix /opt/scylladb
 
 %description
 Ragel compiles finite state machines from regular languages into executable C,
@@ -21,7 +24,7 @@
 done using inline operators that do not disrupt the regular language syntax.
 
 %prep
-%setup -q
+%setup -q -n %{orig_name}-%{version}
 
 # Pass fedora cflags correctly
 sed -i.flags \
@@ -34,7 +37,7 @@
 
 %build
 # set the names of the other programming commandline programs
-%configure --docdir=%{_docdir}/%{name} RUBY=ruby JAVAC=javac GMCS=gmcs 
+%configure --docdir=%{_docdir}/%{name}-%{version} RUBY=ruby JAVAC=javac GMCS=gmcs 
 
 make %{?_smp_mflags}
 
