New package Tesseract Trainer needs packager

Nils Philippsen nphilipp at redhat.com
Fri Jun 10 16:02:48 UTC 2005


On Fri, 2005-06-10 at 16:07 +0100, Andy Southgate wrote:
> >> I've written a package called Tesseract Trainer.  It appears to work and is
> >> getting a reasonable response here:
> >> 
> >> http://www.happypenguin.org/show?Tesseract%20Trainer
> >> 
> >> The problem is that I don't have time to go through Fedora's submission
> >> process myself, as I'm going to be writing more stuff.  I'm trying to
> >> pioneer a new era of 4D gaming, which is a tall order at the best of times.
> >> So, if somebody would like to package it for me I'd be very grateful.
> >> Hopefully it's a case of taking the Mandrake .spec file and Fedora-ising it.
> >> If you fancy the job, a selection of source packages can be found at
> >> http://mushware.com/dload.php?action=category&cat_id=7.
> >  
> >
> >that package being shareware pretty much precludes it from being part of
> >Fedora.
> 
> Sorry I should have mentioned.  It's not real shareware - the licence
> is GPL.  Is there anything else I need to do to make it
> Fedora-friendly?

Well, it seems that all that "shareware", "$8" and "download demo
version" stuff scared me off initially ;-).

The following came to mind when looking at the spec file to get it
Fedora-ized:

--- 8< ---
> %define name tesseracttrainer
> %define version 0.1.4
> %define release 1

Don't do that here, just set name, version, release below (Name:,
Version:, Release:), the macros get set anyway.

> %define RUNFILE %{_bindir}/tesseracttrainer
> %define RUNFILESAFE %{_bindir}/tesseracttrainer-recover
> 
> Summary: Tesseract Trainer

Usually the package name shouldn't be repeated in the summary, but I
guess in this instance it is the shortest way to describe it,
unfortunately most people won't know what a tesseract is (I didn't until
now).

> Name: %{name}
> Version: %{version}
> Release: %{release}

See above.

> Source0: http://www.mushware.com/files/%{name}-%{version}.tar.bz2
> URL: http://www.mushware.com/
> Copyright: GPL

Using "Copyright: ..." is deprecated, use "License: ...".

> Group: Games/Other

For Fedora, that would be "Amusements/Games".

> BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
> Prefix: %{_prefix}

Unnecessary, this is set implicitely.

> Provides: %{name}-%{version}-%{release}

Ditto.

What's missing here are the BuildRequires.

> 
> %description
> Tesseract Trainer generates a full screen real time display of a rotating
> tesseract - the equivalent of the cube in 4 dimensions. This app also adds
> point textures, which give you a feel of what each of the eight faces are
> doing. There's a stereoscopic option which adds 3D depth to the projection
> from 4D, music and numerous options to play with. I'm very keen to get
> feedback as to whether anyone can 'see' the 4D effect here.

You should elaborate who is keen here, remember people may see only the
description alone. "I" in this context can be the upstream author but
also the packager.

> The application contains a number of interesting features.  Point textures
> convey the orientation of each of the faces as the hypercube rotates.  The
> two invariant planes of the rotation are shown.  Any number of faces can be
> drawn, so each can be followed in turn.  The facets of each face can be
> textured, and faces on each axis are shown in different colours to distinguish
> them.  A manual is provided in PDF format, together with key control help
> whilst the application is running.  Display resolution can be selected to
> match the display.  Finally, some experimental seven-time music creates a bit
> of atmosphere.
> 
> %prep
> rm -rf ${RPM_BUILD_ROOT}

Don't do that here...(*)

> 
> %setup -q
> 
> %build
> %configure --program-transform-name=""

IIUC, this option is a noop so "%configure" alone should suffice...(**)

> # App seen to segfault when throwing an exception if omit-frame-pointers is used
> CXXFLAGS=`echo $CXXFLAGS | sed 's/-fomit-frame-pointer//'`
> make CXXFLAGS="$CXXFLAGS"

(**)... but you can achieve what you want albeit a bit more cleanly like this:

CXXFLAGS="$(echo %optflags | sed 's/-fomit-frame-pointer//g')" \
%configure
make

Ensure that you "BuildRequire: sed" above.

> 
> %install

(*)... but rather here.

> %makeinstall
> 
> %clean
> rm -rf $RPM_BUILD_ROOT
> 
> %files
> %defattr(-,root,root)
> %doc README COPYING NEWS AUTHORS data-tesseracttrainer/About_Tesseract_Trainer.pdf
> %{_datadir}/tesseracttrainer
> %{_bindir}/tesseracttrainerbinary
> %{RUNFILE}
> %{RUNFILESAFE}
> %{_mandir}/man6/%{name}*.6*
> 
> %post
> rm -f %{RUNFILE}

Ouch!...(***)

> echo #!/bin/sh > %{RUNFILE}
> echo cd %{_datadir}/%{name}/system >> %{RUNFILE}
> echo exec %{_bindir}/tesseracttrainerbinary >> %{RUNFILE}
> chmod 0755 %{RUNFILE}
> rm -f %{RUNFILESAFE}
> echo #!/bin/sh > %{RUNFILESAAFE}
> echo cd %{_datadir}/%{name}/system >> %{RUNFILESAFE}
> echo "exec %{_bindir}/tesseracttrainerbinary \"load('start_safe.txt')\"" >> %{RUNFILESAFE}
> chmod 0755 %{RUNFILESAFE}

(***)... rather include these two files as source files and install them
in %install.

> %postun 

No need to have an empty %postun.

> %changelog
> * Tue Jun  9 2005 Andy Southgate <andy.southgate at mushware.com> 0.1.4-1
> - Initial generic RPM
--- >8 ---

HTH,
Nils
-- 
     Nils Philippsen    /    Red Hat    /    nphilipp at redhat.com
"They that can give up essential liberty to obtain a little temporary
 safety deserve neither liberty nor safety."     -- B. Franklin, 1759
 PGP fingerprint:  C4A8 9474 5C4C ADE3 2B8F  656D 47D8 9B65 6951 3011




More information about the fedora-extras-list mailing list