Author: mherger
Date: Mon Jan 30 09:10:39 2012
New Revision: 33777
URL: http://svn.slimdevices.com/slim?rev=33777&view=rev
Log:
Bug: 17852
Description: add build target readynasv2
Modified:
7.7/trunk/buildme.pl
Modified: 7.7/trunk/buildme.pl
URL: http://svn.slimdevices.com/slim/7.7/trunk/buildme.pl?rev=33777&r1=33776&r2=33777&view=diff
==============================================================================
--- 7.7/trunk/buildme.pl (original)
+++ 7.7/trunk/buildme.pl Mon Jan 30 09:10:39 2012
@@ -35,8 +35,9 @@
my $dirsToIncludeForLinuxNoCpanLightTarball = "EN.*html/images CPAN/HTML";
my $dirsToExcludeForMacOSX = "i386-freebsd-64int i386-linux x86_64-linux MSWin32 arm-linux powerpc-linux PreventStandby sparc-linux";
my $dirsToExcludeForWin32 = "5.8 5.10 5.12 i386-freebsd-64int i386-linux x86_64-linux darwin sparc-linux arm-linux powerpc-linux OS/Debian.pm OS/Linux.pm OS/Unix.pm OS/OSX.pm OS/ReadyNAS.pm OS/RedHat.pm OS/Suse.pm OS/SlimService.pm OS/Synology.pm OS/SqueezeOS.pm icudt46b.dat";
-my $dirsToExcludeForReadyNasi386 = "i386-freebsd-64int sparc-linux x86_64 darwin-thread-multi MSWin32-x86 arm-linux powerpc-linux 5.10 5.12 5.14 PreventStandby icudt46b.dat";
-my $dirsToExcludeForReadyNasSparc = "i386-freebsd-64int i386 x86_64 darwin-thread-multi arm-linux MSWin32-x86 powerpc-linux 5.10 5.12 5.14 PreventStandby icudt46l.dat";
+my $dirsToExcludeForReadyNasi386 = "i386-freebsd-64int sparc-linux x86_64 darwin-thread-multi darwin MSWin32-x86 arm-linux powerpc-linux 5.10 5.12 5.14 PreventStandby icudt46b.dat";
+my $dirsToExcludeForReadyNasSparc = "i386-freebsd-64int i386 x86_64 darwin-thread-multi darwin arm-linux MSWin32-x86 powerpc-linux 5.10 5.12 5.14 PreventStandby icudt46l.dat";
+my $dirsToExcludeForReadyNasARM = "i386-freebsd-64int sparc-linux i386 x86_64 darwin-thread-multi darwin MSWin32-x86 powerpc-linux 5.8 5.12 5.14 PreventStandby icudt46b.dat";
## Initialize some variables we'll use later
my ($build, $destName, $destDir, $buildDir, $sourceDir, $version, $noCPAN, $fakeRoot, $light, $freebsd, $arm, $ppc, $releaseType, $release, $archType);
@@ -96,7 +97,7 @@
exit(1);
};
- if ($build eq "tarball" || $build eq "readynas" || $build eq "debian" || $build eq "rpm" || $build eq "macosx" || $build eq "win32") {
+ if ($build eq "tarball" || $build =~ /^readynas/ || $build eq "debian" || $build eq "rpm" || $build eq "macosx" || $build eq "win32") {
## releaseType is an option, but if its not there, we need
## to default it to 'nightly'
if (!$releaseType) {
@@ -278,8 +279,12 @@
buildTarball($dirsToExcludeForLinuxTarball, "$destDir/$destName");
}
} elsif ($build eq "readynas") {
- ## Next, we'll build the debian package...
+ ## Next, we'll build the ReadyNAS/debian package...
buildReadyNas();
+
+ } elsif ($build eq "readynasv2") {
+ ## Next, we'll build the ReadyNAS add-in...
+ buildReadyNasV2();
} elsif ($build eq "debian") {
## Build a Debian Package
@@ -363,6 +368,17 @@
print " (optional) or you're building a nightly-style package\n";
print " --fakeroot (optional) - Whether to use fakeroot to run the build or not. \n";
print "\n";
+ print "--- Building a ReadyNas Add-On\n";
+ print " --build readynasv2 <required opts below>\n";
+ print " --buildDir <dir> - The directory to do temporary work in\n";
+ print " --sourceDir <dir> - The location of the source code repository\n";
+ print " that you've checked out from SVN\n";
+ print " --destDir <dir> - The destination you'd like your files \n";
+# print " --releaseType <nightly/release>- Whether you're building a 'release' package, \n";
+# print " (optional) or you're building a nightly-style package\n";
+# print " --archType <i386/sparc>- Pick the right architecture because \n";
+# print " ONLY the libraries for that ARCH will be included\n";
+ print "\n";
print "--- Building a ReadyNas Deb. Package\n";
print " --build readynas <required opts below>\n";
print " --buildDir <dir> - The directory to do temporary work in\n";
@@ -371,8 +387,8 @@
print " --destDir <dir> - The destination you'd like your files \n";
print " --releaseType <nightly/release>- Whether you're building a 'release' package, \n";
print " (optional) or you're building a nightly-style package\n";
- print " --archType <i386/sparc>- Pick the right architecture because \n";
- print " ONLY the libraries for that ARCH will be included\n";
+ print " --archType <i386/sparc> - Pick the right architecture because \n";
+ print " ONLY the libraries for that ARCH will be included\n";
print "\n";
print "--- Building a Mac OSX Package\n";
print " --build macosx <required opts below>\n";
@@ -380,7 +396,7 @@
print " --sourceDir <dir> - The location of the source code repository\n";
print " that you've checked out from SVN\n";
print " --destDir <dir> - The destination you'd like your files \n";
- print " --destName <filename> - The name of the OSX Package Name, do not \n";
+ print " --destName <filename> - The name of the OSX Package Name, do not \n";
print " (optional) include the .dmg\n";
print "\n";
print "--- Building a Windows Package\n";
@@ -637,6 +653,65 @@
system("mv $buildDir/platforms/readynas/squeezeboxserver_addon_$archType/*.bin $destDir/");
+}
+
+##############################################################################################
+## Build the ReadyNas Add-On based on the second generation add-on packager ##
+##############################################################################################
+sub buildReadyNasV2 {
+ print "INFO: Building package for ReadyNas Add-On... \n";
+
+ $archType ||= 'arm';
+
+ ## Check if a specific architecture was selected ...
+ my $dirsToExcludeForReadyNas;
+ if ($archType eq "i386") {
+ ## Since i386 was selected, lets make sure to remove sparc libs
+ print "INFO: \$archType was provided as [$archType], other files...\n";
+ $dirsToExcludeForReadyNas = $dirsToExcludeForReadyNasi386;
+ } elsif ($archType =~ /arm/) {
+ ## Since i386 was selected, lets make sure to remove sparc libs
+ print "INFO: \$archType was provided as [$archType], removing other files...\n";
+ $dirsToExcludeForReadyNas = $dirsToExcludeForReadyNasARM;
+ } else {
+ ## Fail if no architecture was specified...
+ die("No valid archType was specified. I got [$archType] submitted, but did not recognize it.");
+ }
+
+ ## First, lets make sure we get rid of the files we don't need for this install
+ my @dirsToExclude = split(/ /, $dirsToExcludeForReadyNas);
+ my $n = 0;
+ while ($dirsToExclude[$n]) {
+ print "INFO: Removing $dirsToExclude[$n] files from buildDir...\n";
+ system("find $buildDir | grep -i $dirsToExclude[$n] | xargs rm -rf ");
+ $n++;
+ }
+
+ my $baseDir = "$buildDir/platforms/readynas";
+ my $workDir = "$baseDir/addons_sdk/SQUEEZEBOX/files";
+ my $share = "usr/share/squeezeboxserver";
+ my $varlib = "c/.squeezeboxserver";
+
+ print "INFO: Preparing add-on build environment...\n";
+ system("mv $baseDir/addon_template $baseDir/addons_sdk/SQUEEZEBOX");
+
+ system("install -d -m0755 $workDir/etc/default/ && install -d -m0755 $workDir/etc/init.d/ && install -d -m0755 $workDir/etc/squeezeboxserver/ && install -d -m0755 $workDir/usr/sbin/");
+ system("install -d -m0755 $workDir/usr/share/perl5/ && install -d -m0755 $workDir/$share/ && install -d -m0755 $workDir/usr/share/doc/squeezeboxserver/ && install -d -m0755 $workDir/$varlib/prefs");
+ system("install -d -m0755 $workDir/$varlib/cache && install -d -m0755 $workDir/$varlib/log");
+
+ system("install -m0755 $buildDir/server/slimserver.pl $workDir/usr/sbin/squeezeboxserver && install -m0755 $buildDir/server/scanner.pl $workDir/usr/sbin/squeezeboxserver-scanner");
+
+ system("mv $buildDir/server/Slim $workDir/usr/share/perl5/");
+ system("mv $buildDir/server/CPAN $buildDir/server/lib $buildDir/server/Firmware $buildDir/server/Graphics $buildDir/server/HTML $workDir/$share/");
+ system("mv $buildDir/server/IR $buildDir/server/SQL $buildDir/server/strings.txt $buildDir/server/MySQL $buildDir/server/icudt46*.dat $buildDir/server/Bin $workDir/$share/");
+
+ ## Build the addon now
+ print "INFO: Executing build_addon.sh...\n";
+# system("cd $buildDir/platforms/readynas/squeezeboxserver_addon_$archType/; ./build_addon.sh");
+
+ ## Move the final addon into place
+# print "INFO: Moving the final addon into [$destDir]\n";
+# system("mv $buildDir/platforms/readynas/squeezeboxserver_addon_$archType/*.bin $destDir/");
}
##############################################################################################
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.