Author: jwrdegoede
Update of /cvs/free/rpms/smc-music/F-8
In directory se02.es.rpmfusion.net:/tmp/cvs-serv2247
Added Files:
dochelper.pl smc-music.spec
Log Message:
* Fri Jul 25 2008 Hans de Goede <j.w.r.degoede(a)hhs.nl> 4.0-2
- Release bump for rpmfusion
--- 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-music.spec ---
%define datapath %{_datadir}/smc/
Name: smc-music
Version: 4.0
Release: 2%{?dist}
Summary: Additional music for Secret Maryo Chronicles
Group: Amusements/Games
License: GPLv3
URL:
http://www.secretmaryo.org
Source0:
http://dl.sf.net/smclone/SMC_music_%{version}_high.zip
Source1: dochelper.pl
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Requires: smc >= 0.99.7
%description
Additional music for the game Secret Maryo Chronicles
%prep
%setup -qc
#Fix EOL chars
sed -i 's/\r//' docs/license.txt
%build
# 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 strip 'data/' from
# the paths because the installation location is now different and it's far
# simpler that altering dochelper.pl
cp %{SOURCE1} . && perl dochelper.pl
sed -i 's/\r//' credits.txt
sed -i 's|data/||g' credits.txt
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{datapath}/music/{game,land,overworld,story}
install -pm0644 data/music/game/*.ogg %{buildroot}%{datapath}/music/game
install -pm0644 data/music/land/*.ogg %{buildroot}%{datapath}/music/land
install -pm0644 data/music/overworld/*.ogg %{buildroot}%{datapath}/music/overworld
install -pm0644 data/music/story/*.ogg %{buildroot}%{datapath}/music/story
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{datapath}/music/*/*.ogg
# Note this dir is intentionally owned by this rpm and not smc as smc doesn't
# have it by default.
%dir %{datapath}/music/story
%doc credits.txt docs/license.txt
%changelog
* Fri Jul 25 2008 Hans de Goede <j.w.r.degoede(a)hhs.nl> 4.0-2
- Release bump for rpmfusion
* Wed Aug 08 2007 Ian Chapman <packages(a)amiga-hardware.com> 4.0-1
- Upgrade to 4.0
- Changed license field due to match new guidelines
* Sat Jun 02 2007 Ian Chapman <packages(a)amiga-hardware.com> 3.1-2
- Minor changes due to new data location in smc
* Fri Oct 06 2006 Ian Chapman <packages(a)amiga-hardware.com> 3.1-1
- Upgrade to 3.1
* Sun Jul 09 2006 Ian Chapman <packages(a)amiga-hardware.com> 3.0-2
- Corrected EOL chars in credits.txt
- Removed redundant params from %%setup
* Sun Jun 25 2006 Ian Chapman <packages(a)amiga-hardware.com> 3.0-1
- Initial Release