SPEC file for building Irrlicht 1.3.1 RPM´s

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply

Should I keep updateing the spec file - or am I wasting my time?

Keep updateing the spec file.
4
100%
You are wasting your time.
0
No votes
 
Total votes: 4

StickyBit
Posts: 94
Joined: Mon Jul 05, 2004 3:40 am
Location: Sønderup, Denmark
Contact:

SPEC file for building Irrlicht 1.3.1 RPM´s

Post by StickyBit »

Hi guys

Here is a SPEC file for building RPM´s containing Irrlicht. The SPEC file was created for Fedora Core, but should work just fine on all RPM based Linux distributions. I suggest that the SPEC file is to be included within the Irrlicht distribution, and that changes are made to Irrlicht, so that the patch would no longer be necessary.


irrlicht-1.3.1.spec

Code: Select all

Summary: High performance realtime 3D engine
Name: irrlicht
Version: 1.3.1
Release: 0
License: The Irrlicht Engine License
Group: Development/Libraries
Source: http://prdownload.sourceforge.net/irrlicht/irrlicht-1.3.1.zip
BuildRequires: mesa-libGLU-devel mesa-libGL-devel libXxf86vm-devel
BuildRoot: /var/tmp/%{name}-buildroot
Requires: mesa-libGL mesa-libGLU
Provides: libIrrlicht
Patch0: irrlicht-1.3.1.Examples.patch

%description
The Irrlicht Engine is a high performance realtime 3D engine.

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

%description devel
This package contains the header files, static libraries and include files for %{name}

%package examples
Summary: Exmaple binaries and media for %{name} %{version}
Group: Development/Libraries
Requires: %{name} = %{version}

%description examples
This package contains the Irrlicht examples and the required media

%prep
%setup -q
%patch0 -p1

%build
cd source/Irrlicht; make; make sharedlib; cd -
cd examples/01.HelloWorld; make; cd -
cd examples/02.Quake3Map; make; cd -
cd examples/03.CustomSceneNode; make; cd -
cd examples/04.Movement; make; cd -
cd examples/05.UserInterface; make; cd -
cd examples/06.2DGraphics; make; cd -
cd examples/07.Collision; make; cd -
cd examples/08.SpecialFX; make; cd -
cd examples/09.Meshviewer; make; cd -
cd examples/10.Shaders; make; cd -
cd examples/11.PerPixelLighting; make; cd -
cd examples/12.TerrainRendering; make; cd -
cd examples/13.RenderToTexture; make; cd -
# (Windows only) cd examples/14.Win32Window; make; cd -
cd examples/15.LoadIrrFile; make; cd -
cd examples/16.Quake3MapShader; make; cd -
cd bin/Linux; rm -f readme.txt; strip *; cd -

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/lib
mkdir -p $RPM_BUILD_ROOT/usr/include/irrlicht
mkdir -p $RPM_BUILD_ROOT/usr/share/irrlicht/media
mkdir -p $RPM_BUILD_ROOT/usr/bin
install -m 644 source/Irrlicht/libIrrlicht.a $RPM_BUILD_ROOT/usr/lib/libIrrlicht.a
install -m 644 source/Irrlicht/libIrrlicht.so.%{version} $RPM_BUILD_ROOT/usr/lib/libIrrlicht.so.%{version}
ln -s libIrrlicht.so.%{version} $RPM_BUILD_ROOT/usr/lib/libIrrlicht.so
install -m 644 include/* $RPM_BUILD_ROOT/usr/include/irrlicht
install -m 644 media/* $RPM_BUILD_ROOT/usr/share/irrlicht/media
install -m 755 bin/Linux/* $RPM_BUILD_ROOT/usr/bin

%files
/usr/lib/libIrrlicht.so.%{version}
/usr/lib/libIrrlicht.so
%doc doc/irrlicht.chm

%files devel
/usr/lib/libIrrlicht.a
/usr/include/irrlicht/*

%files examples
/usr/share/irrlicht/media/*
/usr/bin/*

%changelog
* Sun Jul 01 2007 Søren Schimkat <www.mansoft.dk>
- Updated to release 1.3.1
* Fri Jun 08 2007 Søren Schimkat <www.mansoft.dk>
- Initial Release

The needed patch is created using the following commands:

Code: Select all

unzip irrlicht-1.3.1.zip
cp -r irrlicht-1.3.1 irrlicht-1.3.1.orig

perl -i -p -e 's/1\.3\.0/1\.3\.1/' irrlicht-1.3.1/source/Irrlicht/Makefile
perl -i -p -e 's/(Target\s+=\s+)(\d+\..+)/$1irrlicht\.$2/g' irrlicht-1.3.1/examples/*/Makefile
perl -i -p -e 's/\.\.\/\.\.\/media/\/usr\/share\/irrlicht\/media/g' irrlicht-1.3.1/examples/*/main.cpp
perl -i -p -e 's/\(\w{1}\)\sDirect[^\\]+\\n\s{1}//g;' irrlicht-1.3.1/examples/*/main.cpp
perl -i -p -e 's/^.+case.+video::EDT_DIRECT3D.+$//;' irrlicht-1.3.1/examples/*/main.cpp

diff -uNr irrlicht-1.3.1.orig irrlicht-1.3.1 > irrlicht-1.3.1.Examples.patch

rm -rf irrlicht-1.3.1 irrlicht-1.3.1.orig

That´s about it. Now it´s time to get Irrlicht included in all the known distributions. Happy packageing. :-)

Regards Stickybit
Post Reply