rpms/smc/F-8 dochelper.pl, NONE, 1.1 smc.sh, NONE, 1.1 smc.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Hans de Goede jwrdegoede at rpmfusion.org
Fri Jul 25 21:00:26 CEST 2008


Author: jwrdegoede

Update of /cvs/free/rpms/smc/F-8
In directory se02.es.rpmfusion.net:/tmp/cvs-serv16980

Modified Files:
	.cvsignore sources 
Added Files:
	dochelper.pl smc.sh smc.spec 
Log Message:
* Thu Jul 24 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 1.5-1
- New upstream release 1.5



--- NEW FILE dochelper.pl ---
#!/usr/bin/perl
#
# Helper script to cleanup the scattered mess of text files in the SMC data
# path - to avoid overloading the spec file making it unreadable. It preserves
# the contents of those text files into a single credits file which gets
# installed in a sane location
#
use strict;

# File name
my $LICFILE = "credits.txt";

# Prefix to installed location
my $PREFIX = "/usr/share/smc";

# Starting directory
my $STARTDIR = "data";

# Open credits file
open (LIC, ">$LICFILE");
print LIC "# Generated automatically by dochelper.pl in the smc RPM.\n\n";
print LIC "Additional licenses and credits for Secret Mayro Chronicles.\n";
print LIC "------------------------------------------------------------\n\n";
close (LIC);

&traverse($STARTDIR);

exit 0;

sub traverse
{
    my $cwd = $_[0];
    system("cd $cwd");
    opendir(DIR, $cwd);
    my @entries = readdir(DIR);
    closedir(DIR);

    foreach my $entry (@entries)
    {
        # Don't recurse current or parent
        next if $entry eq '.';
        next if $entry eq '..';

        # If it's a dir, recurse.
	if (-d "$cwd/$entry") {&traverse("$cwd/$entry");} 

        # Filter out none text files.
        next if ($entry !~ m/^.*txt/g);

	# Skip txt files in this dir because they are configs
        if ($cwd ne 'data/levels')
        {
            if ($entry eq 'all.txt')
            {
                system("echo \"$PREFIX/$cwd/\*\" >> $LICFILE ; cat $cwd/all.txt >> $LICFILE ; echo \"\n\" >> $LICFILE; rm -f $cwd/all.txt");
            }
            else
            { 
		my $ext = $entry;
		my $match = 0;
		$ext =~ s/\.txt/\.ogg/g;
		if (-e "$cwd/$ext") { system("echo \"$PREFIX/$cwd/$ext\" >> $LICFILE"); $match = 1;}
		$ext =~ s/\.ogg/\.ttf/g;
		if (-e "$cwd/$ext") { system("echo \"$PREFIX/$cwd/$ext\" >> $LICFILE"); $match = 1;}
		$ext =~ s/\.ttf/\.png/g;
		if (-e "$cwd/$ext") { system("echo \"$PREFIX/$cwd/$ext\" >> $LICFILE"); $match = 1;}
		if ($match == 0) { system("echo \"$PREFIX/$cwd/$entry\" >> $LICFILE"); }
	        system("cat $cwd/$entry >> $LICFILE ; echo \"\n\" >> $LICFILE ; rm -f $cwd/$entry");
            } 
        }
    }
}


--- NEW FILE smc.sh ---
#!/bin/sh
#
# Wrapper script for Secret Mayro Chronicles to ensure it saves various
# files in a sensible location.
#
smcbin='/usr/bin/smc.bin';

#Check binary exists and is executable
if [ ! -x $smcbin ]; then
    echo "error: $smcbin missing or not executable" 1>&2
    exit 1
fi

#Check home exists and is a directory
if [ ! -d $HOME ] ; then
    echo "error: $HOME is missing or not a directory" 1>&2
    exit 2
fi

#Check if ~/.smc/savegames exists and is directory, if not, make it
if [ ! -d "$HOME/.smc/savegames" ] ; then
    mkdir -p "$HOME/.smc/savegames"
fi

# Change to ~/.smc, launch smc, passing in any arguments
cd "$HOME/.smc"
exec $smcbin "$@"


--- NEW FILE smc.spec ---
Name:           smc
Version:        1.5
Release:        1%{?dist}
Summary:        2D platform game that uses OpenGL in a style similar to Super Mario
Group:          Amusements/Games
License:        GPLv3
URL:            http://www.secretmaryo.org
Source0:        http://downloads.sourceforge.net/smclone/%{name}-%{version}.tar.bz2
Source1:        smc.sh
Source2:        dochelper.pl
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  automake
BuildRequires:  boost-devel >= 1.31
BuildRequires:  cegui-devel >= 0.5
BuildRequires:  libGLU-devel
BuildRequires:  pkgconfig >= 0.9.0
BuildRequires:  SDL-devel >= 1.2.10
BuildRequires:  SDL_image-devel >= 1.2.0
BuildRequires:  SDL_ttf-devel >= 2.0
BuildRequires:  SDL_mixer-devel >= 1.2.0
BuildRequires:  SDL_gfx-devel
BuildRequires:  libpng-devel
BuildRequires:  zlib-devel
BuildRequires:  desktop-file-utils
Requires:       hicolor-icon-theme

%description
Secret Maryo Chronicles is a 2D platform game that makes use of OpenGL and is
built upon SDL. It is similar to the classic game Super Mario.


%prep
%setup -q

# Delete useless files to avoid them being installed
rm -f file data/pixmaps/world/tiles/green_1/todo.txt

#Fix EOL chars
sed -i 's/\r//' docs/style.css docs/*.html docs/*.txt

# ./autogen.sh


%build
%configure
make %{?_smp_mflags}

# Generate the credit list from lots of little text files scattered around the
# installation. Very messy! A helper script is used to avoid over-complicating
# the spec. Additional processing is done on the credits to fix character
# encoding and to strip 'data/' from the paths because the installation
# location is now different and it's far simpler that altering dochelper.pl
cp %{SOURCE2} . && perl dochelper.pl
sed -i 's/\r//' credits.txt
sed -i 's|data/||g' credits.txt
iconv -f iso8859-1 credits.txt -t utf8 > credits.conv
mv credits.conv credits.txt

# Build desktop file
cat >%{name}.desktop <<EOF
[Desktop Entry]
Encoding=UTF-8
Name=Secret Maryo Chronicles
GenericName=Platform game
Comment=%{summary}
Exec=%{name}
Icon=%{name}
Terminal=false
Type=Application
Categories=Game;ActionGame;
EOF


%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/32x32/apps
install -pm0644 data/icon/window_32.png \
  %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
mv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}.bin
install -pm0755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}

desktop-file-install --vendor dribble \
                     --dir %{buildroot}%{_datadir}/applications \
                     %{name}.desktop


%clean
rm -rf %{buildroot}


%post
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi


%postun
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi


%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_bindir}/%{name}.bin
%{_datadir}/%{name}
%{_datadir}/applications/dribble-%{name}.desktop
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%doc credits.txt docs/*.html docs/license.txt docs/SMC.txt docs/style.css
%doc docs/todo*


%changelog
* Thu Jul 24 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 1.5-1
- New upstream release 1.5

* Tue Jan 08 2008 Ian Chapman <packages[AT]amiga-hardware.com> 1.4.1-1
- Upgrade to 1.4.1

* Sat Dec 02 2007 Ian Chapman <packages[AT]amiga-hardware.com> 1.3-1
- Upgrade to 1.3
- Minor update to .desktop file due to new validation rules

* Sat Oct 20 2007 Ian Chapman <packages[AT]amiga-hardware.com> 1.2-1
- Upgrade to 1.2

* Fri Sep 28 2007 Ian Chapman <packages[AT]amiga-hardware.com> 1.1-1
- Upgrade to 1.1
- SPEC cleanups as latest version allows us to streamline the install a bit

* Wed Aug 08 2007 Ian Chapman <packages[AT]amiga-hardware.com> 1.0-1
- Upgrade to 1.0
- Changed license field to match new guidelines

* Sat Jun 23 2007 Ian Chapman <packages[AT]amiga-hardware.com> 0.99.7-1
- Upgrade to 0.99.7

* Sat Jun 02 2007 Ian Chapman <packages[AT]amiga-hardware.com> 0.99.6.1-1
- Upgrade to 0.99.6.1
- Dropped all patches as they are no longer needed.
- Changed .desktop category to Action Games
- Changed .desktop icon as it's now supplied with one.

* Tue Oct 24 2006 Ian Chapman <packages[AT]amiga-hardware.com> 0.99.2-1
- Upgrade to 0.99.2
- Dropped fonts patch in favour of using sed
- Updated fiximageset patch
- Added patch to fix the globals header

* Mon Oct 23 2006 Ian Chapman <packages[AT]amiga-hardware.com> 0.99.1-2
- Rebuild against latest libraries, seems to fix segfault on some machines

* Thu Sep 07 2006 Ian Chapman <packages[AT]amiga-hardware.com> 0.99.1-1
- Upgrade to 0.99.1
- Dropped smc-0.99-fixuint.patch, fixed upstream

* Wed Aug 02 2006 Ian Chapman <packages[AT]amiga-hardware.com> 0.99-1
- Upgraded to 0.99
- Fixpaths patch reduced, fewer files need to be fixed
- Added patch to fix location of headers
- Added patch to convert uint to CEGUI::uint to avoid conflict
- Split imageset and fonts into separate patches for easier maintenance

* Sun Jul 16 2006 Ian Chapman <packages[AT]amiga-hardware.com> 0.98.1-3
- Added libpng-devel buildrequire for building under mock for fc5

* Sat Jul 08 2006 Ian Chapman <packages[AT]amiga-hardware.com> 0.98.1-2
- Corrected EOL chars in additional-licenses.txt
- Removed redundant params from %%setup
- Added automake buildrequire
- Removed pkgconfig buildrequire (required by cegui-devel)
- Moved icon installation to make it freedesktop compliant
- Added %%post and %%postun sections to update icon cache at installation
- Minor cleanups to smc.sh wrapper script
- Moved smc binary installation from /usr/games to /usr/bin/smc.bin
- Enhanced the description

* Sat Jun 24 2006 Ian Chapman <packages[AT]amiga-hardware.com> 0.98.1-1
- Initial Release


Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/smc/F-8/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	1 Jun 2008 13:47:23 -0000	1.1
+++ .cvsignore	25 Jul 2008 19:00:25 -0000	1.2
@@ -0,0 +1 @@
+smc-1.5.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/free/rpms/smc/F-8/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	1 Jun 2008 13:47:23 -0000	1.1
+++ sources	25 Jul 2008 19:00:25 -0000	1.2
@@ -0,0 +1 @@
+72d10648435c349988dcd053e5fe64fe  smc-1.5.tar.bz2



More information about the rpmfusion-commits mailing list