rpms/smc-music/devel dochelper.pl, NONE, 1.1 smc-music.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Hans de Goede jwrdegoede at rpmfusion.org
Thu Jul 24 19:55:33 CEST 2008


Author: jwrdegoede

Update of /cvs/free/rpms/smc-music/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv3039/devel

Modified Files:
	.cvsignore sources 
Added Files:
	dochelper.pl smc-music.spec 
Log Message:
initial smc-music import



--- 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:        1%{?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
* Wed Aug 08 2007 Ian Chapman <packages at 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 at amiga-hardware.com> 3.1-2
- Minor changes due to new data location in smc

* Fri Oct 06 2006 Ian Chapman <packages at amiga-hardware.com> 3.1-1
- Upgrade to 3.1

* Sun Jul 09 2006 Ian Chapman <packages at amiga-hardware.com> 3.0-2
- Corrected EOL chars in credits.txt
- Removed redundant params from %%setup

* Sun Jun 25 2006 Ian Chapman <packages at amiga-hardware.com> 3.0-1
- Initial Release

Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/smc-music/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	1 Jun 2008 13:49:36 -0000	1.1
+++ .cvsignore	24 Jul 2008 17:55:32 -0000	1.2
@@ -0,0 +1 @@
+SMC_music_4.0_high.zip


Index: sources
===================================================================
RCS file: /cvs/free/rpms/smc-music/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	1 Jun 2008 13:49:36 -0000	1.1
+++ sources	24 Jul 2008 17:55:32 -0000	1.2
@@ -0,0 +1 @@
+bb007603c723eddd6ccb007cc5f01cd6  SMC_music_4.0_high.zip



More information about the rpmfusion-commits mailing list