This is not a how to do it but a what I did…
2 spec files
#
# spec file for package FlightGear (Version 1.9.1)
#
# norootforbuild
Name: FlightGear
%if 0%{?suse_version}
BuildRequires: freeglut-devel gcc-c++ libjpeg-devel openal-devel libOpenSceneGraph-devel plib-devel update-desktop-files xorg-x11
# Be aware that in Build Service games repo
# it is built within games libraries where freealut is split off from openal.
BuildRequires: freealut-devel
# fgrun needs fltk
BuildRequires: fltk-devel
%if %suse_version >= 1010
BuildRequires: libdrm-devel
%endif
# openal is splitted in 10.2 into openal and freealut.
# Reccomends tag is handled in SuSE > 1010
%if %suse_version > 1000
Recommends: FlightGear-startup-manual
%endif
# others distributions then SuSE
%else
%if 0%{?mandriva_version}
BuildRequires: freeglut-devel gcc-c++ libjpeg-devel libdrm-devel openal-devel plib-devel
BuildRequires: fltk-devel
%else
%if 0%{?fedora_version}
BuildRequires: freeglut-devel freealut-devel gcc-c++ libjpeg-devel libdrm-devel openal-devel plib-devel
BuildRequires: fltk-devel
%endif
%endif
%endif
License: GPL
Group: Amusements/Games/3D/Simulation
Autoreqprov: on
Version: 1.9.1
Release: 17.19
Provides: flightgr
Obsoletes: flightgr
PreReq: /bin/ln
Summary: FlightGear Flight Simulator
URL: http://www.flightgear.org/
Source: %{name}-1.9.1.tar.gz
%define simgear SimGear-1.9.1
Source1: %{simgear}.tar.gz
#URL http://www.flightgear.org/Docs/getstart/getstart.html
Source2: FG_getstart.pdf.tar.bz2
#URL: http://sourceforge.net/project/showfiles.php?group_id=65363
Source3: fgrun-1.5.1.tar.gz
# icons
Source4: fg-icons.tgz
%define fgrunversion 1.5.1
# FlightGear patches
#Patch1: %{name}-1.0.0-browser.patch
#Patch2: %{name}-1.0.0-plib_version.patch
# SimGear patches
#Patch11: %{simgear}-strict_alias.patch
#Patch12: %{simgear}-plib_version.patch
# FGrun patches
Patch21: fgrun-suse_prefs.patch
#Patch22: fgrun-missing_include.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: FlightGear-data = %version
%description
The Flight Gear Flight Simulator project is a free, Open Source,
multi-platform, cooperative flight simulator development project.
Authors:
--------
Raoul Alonzo <amil@las.es>
Michele America <nomimarketing@mail.telepac.pt>
Michael Basler <pmb@knUUt.de>
Jon S. Berndt <jsb@hal-pc.org>
Paul Bleisch <pbleisch@acm.org>
Jim Brennan <jjb@foothill.net>
Bernie Bright <bbright@c031.aone.net.au>
Bernhard H. Buckel <buckel@wmad95.mathematik.uni-wuerzburg.de>
Gene Buckle <geneb@nwlink.com>
Didier Chauveau <chauveau@math.univ-mlv.fr>
Oliver Delise <delise@rp-plus.de>
Dave Eberly <eberly@magic-software.com>
Francine Evans <evans@cs.sunysb.edu>
Oscar Everitt <bigoc@premier.net>
Jean-loup Gailly and Mark Adler <zlib@quest.jpl.nasa.gov>
Thomas Gellekum <tg@ihf.rwth-aachen.de>
Jeff Goeke-Smith <jgoeke@voyager.net>
Michael I. Gold <gold@puck.asd.sgi.com>
Charlie Hotchkiss <chotchkiss@namg.us.anritsu.com>
Bruce Jackson of NASA <e.b.jackson@larc.nasa.gov>
Richard Kaszeta <bofh@me.umn.edu>
Tom Knienieder <knienieder@ms.netwing.at>
Reto Koradi <kor@mol.biol.ethz.ch>
Bob Kuehne <rpk@sgi.com>
Christian Mayer <Vader@t-online.de>
David Megginson <david@megginson.com>
Eric Mitchell <mitchell@mars.ark.com>
Anders Morken <amrken@online.no>
Alan Murta <amurta@cs.man.ac.uk>
Alexei Novikov <anovikov@heron.itep.ru>
Curt Olson <curt@flightgear.org>
Tony Peden <apeden@earthlink.net>
Robin Peel <robinp@mindspring.com>
Friedemann Reinhard <mpt218@faupt212.physik.uni-erlangen.de>
Petter Reinholdtsen <pere@games.no>
William Riley <riley@technologist.com>
Paul Schlyter <pausch@saaf.se>
Chris Schoeneman <crs@millpond.engr.sgi.com>
Phil Schubert <philings@zedley.com>
Jonathan R Shewchuk <Jonathan_R_Shewchuk@ux4.sp.cs.cmu.edu>
Gordan Sikic <gsikic@public.srce.hr>
Michael Smith <msmith99@flash.net>
Durk Talsma <pn_talsma@macmail.psy.uva.nl>
Mark Vallevand <Mark.Vallevand@UNISYS.com>
Gary R. Van Sickle <tiberius@braemarinc.com>
Norman Vine <nhv@laserplot.com>
Roland Voegtli <webmaster@sanw.unibe.ch>
Carmelo Volpe <carmelo.volpe@csb.ki.se>
Darrell Walisser <dwaliss1@purdue.edu>
Robert Allan Zeh <raz@cmg.FCNBD.COM>
%package startup-manual
License: GPL
Group: Amusements/Games/3D/Simulation
URL: http://www.flightgear.org/Docs/getstart/getstart.html
Version: 1.9.1
Release: 17.19
Summary: FlightGear Manual
%description startup-manual
The FlightGear Manual Version 1.9.1 December 15, 2007
For FlightGear version 1.9.1.
Authors:
--------
Michael Basler, Martin Spott,
Stuart Buchanan, Jon Berndt,
Bernhard Buckel, Cameron Moore,
Curt Olson, Dave Perry,
Michael Selig, Darrell Walisser,
and others
%package fgrun
License: GPL
Group: Amusements/Games/3D/Simulation
URL: http://sourceforge.net/project/showfiles.php?group_id=65363
Version: 1.5.1
Release: 17.19
Summary: FlightGear Graphical Launcher
Requires: FlightGear = 1.9.1
%description fgrun
The FlightGear Graphical Launcher
Authors:
--------
Bernie Bright <bbright@users.sourceforge.net>
Original author.
Frederic Bouvier <fredb@users.sourceforge.net>
Project admin,
%prep
#
# build only for SuSE 10.0 and higher
# because of need to have uptodate some packages (e.g. openal)
# or use a libs subproject in games project in Build Service
#
%setup -n FlightGear-1.9.1 -q -b 1 -b 3 -a 2 -a 4
# fgrun patches
pushd ../fgrun-%{fgrunversion}
%patch21
#%patch22
popd
# SimGear patches
pushd ../%{simgear}
#%patch11
popd
# FlightGear patches
#%patch1
rm -fv docs-mini/README.MSVC*
rm -fv docs-mini/README.IRIX docs-mini/README.MacOS
%build
rm -rf /var/tmp/tmpinstall
mkdir /var/tmp/tmpinstall
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
# beware where is the X libraries installed (X.org 6.9 vs. 7.x)
%if "%(xft-config --prefix)" == "/usr"
CONFIGURE_OPTIONS="--prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \
--infodir=%{_infodir} --sysconfdir=%{_sysconfdir} --without-logging \
--x-includes=/usr/include --x-libraries=/usr/%{_lib}"
%else
CONFIGURE_OPTIONS="--prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \
--infodir=%{_infodir} --sysconfdir=%{_sysconfdir} --without-logging"
%endif
#
# SimGear build and install
# don't use make %{?jobs:-j%jobs}, fails on some archs everytime
#
cd ../%{simgear}
%{?suse_update_config:%{suse_update_config -f}}
autoreconf --force --install
CPPFLAGS="-I /var/tmp/tmpinstall/%{_includedir}" ./configure $CONFIGURE_OPTIONS \
--with-jpeg-factory LDFLAGS=-L/var/tmp/tmpinstall/usr/%{_lib}
make %{?jobs:-j%jobs}
make DESTDIR=$RPM_BUILD_ROOT install
make DESTDIR=/var/tmp/tmpinstall install
cd ../%{name}-1.9.1*
#
# FlightGear finally
# don't use make %{?jobs:-j%jobs}, fails sometimes on every archs.
# should be fixed now
autoreconf --force --install
%{?suse_update_config:%{suse_update_config -f}}
# beware where is the X libraries installed (X.org 6.9 vs. 7.x)
%if "%(xft-config --prefix)" == "/usr"
./configure $CONFIGURE_OPTIONS --with-x --with-simgear=/var/tmp/tmpinstall/usr \
--enable-osgviewer \
LDFLAGS=-L/var/tmp/tmpinstall/usr/%{_lib} \
--x-includes=/usr/include --x-libraries=/usr/%{_lib}
%else
./configure $CONFIGURE_OPTIONS --with-x --with-simgear=/var/tmp/tmpinstall/usr \
--enable-osgviewer \
LDFLAGS=-L/var/tmp/tmpinstall/usr/%{_lib}
%endif
make %{?jobs:-j%jobs}
# use sdl instead of glut if some problems to run FG, no need to do so now, freeglut is fixed in Suse
# --enable-sdl
# install icons and their License
for i in 16 32 48 64 128; do
install -D -m 0644 icons/fg-${i}.png $RPM_BUILD_ROOT/usr/share/icons/hicolor/${i}x${i}/apps/FG.png
done
install -D -m 0644 icons/README $RPM_BUILD_ROOT/usr/share/doc/packages/FlightGear/README_icons
# now build fgrun application
cd ../fgrun-%{fgrunversion}
%{?suse_update_config:%{suse_update_config -f}}
%if "%(xft-config --prefix)" == "/usr"
%configure --with-simgear=/var/tmp/tmpinstall/usr --with-x LDFLAGS=-L/var/tmp/tmpinstall/usr/%{_lib} \
--x-includes=/usr/include --x-libraries=/usr/%{_lib}
%else
%configure --with-simgear=/var/tmp/tmpinstall/usr --with-x LDFLAGS=-L/var/tmp/tmpinstall/usr/%{_lib}
%endif
make %{?jobs:-j%jobs}
%install
make DESTDIR=$RPM_BUILD_ROOT install
mkdir SimGear
mkdir FGrun
cp ../%{simgear}/{AUTHORS,COPYING,NEWS,README,TODO} SimGear
cp ../fgrun-%{fgrunversion}/{AUTHORS,COPYING,ChangeLog,NEWS,README} FGrun
# fgrun
pushd ../fgrun-%{fgrunversion}
make DESTDIR=$RPM_BUILD_ROOT install
popd
%if 0%{?suse_version} > 0
%suse_update_desktop_file -c %name FlightGear "Flight Simulator" fgfs "FG" Game Simulation
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr (-, root, root)
%doc AUTHORS COPYING ChangeLog NEWS README Thanks SimGear/ docs-mini/
%doc %{_mandir}/man1/*
/usr/bin/*
%exclude /usr/bin/fgrun
/usr/include/*
/usr/%{_lib}/lib*
%if 0%{?suse_version} > 0
/usr/share/applications/%name.desktop
%endif
/usr/share/icons/hicolor
%exclude /usr/%{_lib}/*.a
%exclude /usr/include/simgear/*.h
%exclude /usr/include/simgear/*/*.h
%exclude /usr/include/simgear/*/*.hxx
%exclude /usr/include/simgear/*/*/*.hxx
%files startup-manual
%defattr (-, root, root)
%doc FG_getstart.pdf
%files fgrun
%defattr (-, root, root)
%doc FGrun
/usr/bin/fgrun
/usr/share/locale/*/LC_MESSAGES/fgrun.mo
%changelog
* Tue Jul 1 2008 lmichnovic@suse.cz
- excluding header files in /usr/include/simgear/*
* Tue Jul 1 2008 lmichnovic@suse.cz
- fixed missing include (fgrun-missing_include.patch)
* Mon Jun 30 2008 lmichnovic@suse.cz
- added icons from Josh Babcock (GPL licensed)
- added icon name to desktop file
* Wed Apr 30 2008 lmichnovic@suse.cz
- switched to OSG viewer instead of plib
- enabled jpeg support in Simgear (libjpeg-devel -> BuildReq)
* Mon Apr 28 2008 lmichnovic@suse.cz
- update fgrun to version 1.0.1
* program internationalized
* dutch, french, german, italian, polish and portugese localisations
* fix a crash when "Default" button was pressed
* fix clock_freeze option
* added a combo to choose bpp in the wizard
* added aircraft status and author in the wizard
* Wed Mar 5 2008 lmichnovic@suse.cz
- added fgrun 1.0.0 application as subpackage
needs fltk-devel in BuildReq
It needs manual setting ;(
* Thu Jan 3 2008 lmichnovic@suse.cz
- updated FlightGear, SimGear and get_start manual to version 1.0.0
obsoleted patches SG-include.patch, FG-includes.patch
* Wed Nov 21 2007 lmichnovic@suse.cz
- added OpenSceneGraph-devel to BuildReq
- new subpackage startup-manual which contains manual in pdf
* Tue Oct 16 2007 lmichnovic@suse.cz
- update to cvs version 20071016
- obsoletes FG patches: *64bit.patch, *test.patch
* array_overflow.patch
- obsoletes SG: *uninitialized.patch
Name: FlightGear-data
Summary: FlightGear base scenery and data files
Version: 1.9.1
Release: 3%{?dist}
Provides: FlightGear-data
License: GPLv2+
Group: Amusements/Games
Source0: %{name}-1.9.1.tar.gz
URL: http://www.flightgear.org/
BuildRoot: %{_tmppath}/%{name}-{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Obsoletes: fgfs-base < 1.9.0-1
%description
This package contains the base scenery for FlightGear and must be
installed
%prep
%build
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/%{_datadir}/FlightGear/
tar zxvf %{SOURCE0} -C $RPM_BUILD_ROOT/%{_datadir}/FlightGear/
# cleanup temporary files and fix permissions
find $RPM_BUILD_ROOT/%{_datadir}/FlightGear -name '*#*' -exec rm {} \;
find $RPM_BUILD_ROOT/%{_datadir}/FlightGear -type f -exec chmod 644 {} \;
# fix wrong eol encoding on some doc files
for f in data/Docs/FGShortRef.css data/Docs/README.kln89.html data/Docs/FGShortRef.html \
data/Docs/README.submodels data/Docs/README.yasim data/Docs/README.xmlparticles
do
sed -i 's/\r//' $RPM_BUILD_ROOT/%{_datadir}/FlightGear/$f
done
# remove hidden dirs
for d in data/Aircraft/c172/Panels/Textures/.xvpics \
Textures/Runway/.xvpics
do
rm -rf $RPM_BUILD_ROOT/%{_datadir}/FlightGear/$d
done
# fix files not in utf-8
for f in data/Thanks data/Docs/README.xmlparticles
do
path=$RPM_BUILD_ROOT/%{_datadir}/FlightGear/$f
iconv -f iso-8859-1 -t utf-8 -o ${path}.utf8 $path
mv -f ${path}.utf8 ${path}
done
# put documentation and license in the proper location
mkdir -p $RPM_BUILD_ROOT/%{_docdir}/%{name}-%{version}
for f in data/COPYING data/AUTHORS data/NEWS data/README /data/Thanks data/Docs
do
mv $RPM_BUILD_ROOT/%{_datadir}/FlightGear/$f \
$RPM_BUILD_ROOT/%{_docdir}/%{name}-%{version}
done
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root, 0755)
%doc %{_docdir}/%{name}-%{version}
%{_datadir}/FlightGear/
%changelog
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Tue Jan 06 2009 Fabrice Bellet <fabrice@bellet.info> 1.9.0-1
- new upstream release
* Mon Jan 7 2008 Fabrice Bellet <fabrice@bellet.info> 1.0.0-1
- new upstream release
* Sun Sep 23 2007 Fabrice Bellet <fabrice@bellet.info> 0.9.11-0.2.pre1
- update License tag
* Wed Jun 27 2007 Fabrice Bellet <fabrice@bellet.info> 0.9.11-0.1.pre1
- new upstream (pre-)release
* Sat Apr 7 2007 Fabrice Bellet <fabrice@bellet.info> 0.9.10-3
- use sed instead of dos2unix to correct end-of-line encoding
* Mon Apr 2 2007 Fabrice Bellet <fabrice@bellet.info> 0.9.10-2
- Move documentation and license to a better place and mark it as %%doc
- Fix wrong end-of-line encoding in some doc files
* Tue Mar 20 2007 Fabrice Bellet <fabrice@bellet.info> 0.9.10-1
- Initial packaging
ls in SOURCES
FG_getstart.pdf.tar.bz2
fg-icons.tgz
fgrun-1.5.1.tar.gz
fgrun-suse_prefs.patch
FlightGear-1.9.1.tar.gz
FlightGear-data-1.9.1.tar.gz
FlightGear.desktop
SimGear-1.9.1.tar.gz
So sources in /usr/src/packages/SOURCES ditto SPECS then as user
rpmbuild -bb /all/the/path/to.spec
…