File erlang-esdl.spec of Package erlang-esdl

# spec file for package erlang-esdl (1.3.1)
# 
# This file and all modifications and additions to the pristine  
# package are under the same license as the package itself.    
#   
# norootforbuild

%define		realname	esdl
%define		erlangdir	%{_libdir}/erlang

Name:		erlang-esdl
Version:	1.3.1
Release:	1
Summary:	Erlang OpenGL/SDL api and utilities
Group:		Development/Libraries/Other
License:	MIT
URL:		http://esdl.sourceforge.net
Source0:	%{realname}-%{version}.src.tar.bz2
BuildRequires:	libSDL-devel
BuildRequires:  libSDL_ttf-devel
BuildRequires:  libSDL_image-devel
BuildRequires:	make
BuildRequires:	gcc
BuildRequires:	Mesa-devel
BuildRequires:	dos2unix
BuildRequires:	erlang
BuildRequires:  erlang-rebar
BuildRequires:	patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-build
Requires:	erlang
Provides:	esdl = %{version}-%{release}

Autoreqprov:	on

%debug_package

%description
A library that gives you access to SDL and OpenGL functionality in
your Erlang program.

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

%description devel
Header and development files for ESDL.

%prep
%setup -q -n %{realname}-%{version}
# Remove spurious-executable-perm 
find . -type f -exec chmod a-x {} \;
/usr/bin/dos2unix Readme
/usr/bin/dos2unix license.terms

# correct deprecated driver_send_term -> erl_drv_send_term
for f in `find . -name "*.c" -exec grep -q driver_send_term {} \; -print`; do
    sed -i -e \
      's/driver_send_term(port/erl_drv_send_term(driver_mk_port(port)/g' $f;
done

%build
rebar compile

%install
install -d %{buildroot}/%{erlangdir}/lib/esdl-%{version}/ebin
install -d %{buildroot}/%{erlangdir}/lib/esdl-%{version}/include
install -d %{buildroot}/%{erlangdir}/lib/esdl-%{version}/src
install -d %{buildroot}/%{erlangdir}/lib/esdl-%{version}/priv

pushd include
for h in *.hrl; do
    install -m 644 $h %{buildroot}/%{erlangdir}/lib/esdl-%{version}/include/$h
done
popd

pushd src
for h in *.?rl; do
    install -m 644 $h %{buildroot}/%{erlangdir}/lib/esdl-%{version}/src/$h
done
popd

pushd ebin
for h in *.beam; do
    install -m 644 $h %{buildroot}/%{erlangdir}/lib/esdl-%{version}/ebin/$h
done
popd

pushd priv
for h in *.so; do
    install -m 644 $h %{buildroot}/%{erlangdir}/lib/esdl-%{version}/priv/$h
done
popd

install -m 644 vsn.mk %{buildroot}/%{erlangdir}/lib/esdl-%{version}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
%{__rm} -rf '%{buildroot}'

%files
%defattr(-,root,root,-)
%doc Readme license.terms
%{erlangdir}/lib/esdl-%{version}
%exclude %{erlangdir}/lib/esdl-%{version}/include
%exclude %{erlangdir}/lib/esdl-%{version}/src

%files devel
%defattr(-,root,root,-)
%doc doc/*.html
%{erlangdir}/lib/esdl-%{version}/include
%{erlangdir}/lib/esdl-%{version}/src

%changelog
openSUSE Build Service is sponsored by