3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
16 my $output="rockbox.zip";
22 if($ARGV[0] eq "-r") {
28 elsif($ARGV[0] eq "-z") {
34 elsif($ARGV[0] eq "-o") {
40 elsif($ARGV[0] eq "-v") {
52 my $firmdir="$ROOT/firmware";
59 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
60 $atime,$mtime,$ctime,$blksize,$blocks)
67 my $dir = "$ROOT/apps/lang";
69 my @files = grep { /\.lang$/ } readdir(DIR
);
74 $output =~ s/(.*)\.lang/$1.lng/;
75 print "lang $_\n" if($verbose);
76 system ("$ROOT/tools/binlang $dir/english.lang $dir/$_ $outputlang/$output >/dev/null 2>&1");
81 my ($zip, $image, $notplayer)=@_;
86 mkdir ".rockbox", 0777;
87 mkdir ".rockbox/langs", 0777;
88 mkdir ".rockbox/rocks", 0777;
90 mkdir ".rockbox/codepages", 0777;
91 mkdir ".rockbox/codecs", 0777;
92 mkdir ".rockbox/wps", 0777;
93 mkdir ".rockbox/themes", 0777;
94 mkdir ".rockbox/backdrops", 0777;
95 mkdir ".rockbox/eqs", 0777;
97 my $c = 'find apps -name "*.codec" ! -empty -exec cp {} .rockbox/codecs/ \; 2>/dev/null';
100 system("$ROOT/tools/codepages");
101 my $c = 'find . -name "*.cp" ! -empty -exec mv {} .rockbox/codepages/ \; >/dev/null 2>&1';
104 my @call = `find .rockbox/codecs -type f 2>/dev/null`;
106 # no codec was copied, remove directory again
107 rmdir(".rockbox/codecs");
112 $c= 'find apps "(" -name "*.rock" -o -name "*.ovl" ")" ! -empty -exec cp {} .rockbox/rocks/ \;';
115 open VIEWERS
, "$ROOT/apps/plugins/viewers.config" or
116 die "can't open viewers.config";
117 @viewers = <VIEWERS
>;
120 open VIEWERS
, ">.rockbox/viewers.config" or
121 die "can't create .rockbox/viewers.config";
122 mkdir ".rockbox/viewers", 0777;
123 foreach my $line (@viewers) {
124 if ($line =~ /([^,]*),([^,]*),/) {
125 my ($ext, $plugin)=($1, $2);
126 my $r = "${plugin}.rock";
132 # strip off the last slash and file name part
133 $dir =~ s/(.*)\/(.*)/$1/;
134 # store the file name part
137 # get .ovl name (file part only)
139 $oname =~ s/\.rock$/.ovl/;
141 # print STDERR "$ext $plugin $dir $name $r\n";
143 if(-e
".rockbox/rocks/$name") {
144 if($dir ne "rocks") {
145 # target is not 'rocks' but the plugins are always in that
147 `mv .rockbox/rocks/$name .rockbox/$r`;
151 elsif(-e
".rockbox/$r") {
152 # in case the same plugin works for multiple extensions, it
153 # was already moved to the viewers dir
157 if(-e
".rockbox/rocks/$oname") {
158 # if there's an "overlay" file for the .rock, move that as
160 `mv .rockbox/rocks/$oname .rockbox/$dir`;
167 `cp $ROOT/apps/plugins/sokoban.levels .rockbox/rocks/`; # sokoban levels
168 `cp $ROOT/apps/plugins/snake2.levels .rockbox/rocks/`; # snake2 levels
170 mkdir ".rockbox/fonts", 0777;
172 opendir(DIR
, "$ROOT/fonts") || die "can't open dir fonts";
173 my @fonts = grep { /\.bdf$/ && -f
"$ROOT/fonts/$_" } readdir(DIR
);
179 print "FONT: $f\n" if($verbose);
181 $o =~ s/\.bdf/\.fnt/;
182 my $cmd ="$ROOT/tools/convbdf -f -o \".rockbox/fonts/$o\" \"$ROOT/fonts/$f\" >/dev/null 2>&1";
183 print "CMD: $cmd\n" if($verbose);
191 # image is blank when this is a simulator
192 if( filesize
("rockbox.ucl") > 1000 ) {
193 `cp rockbox.ucl .rockbox/`; # UCL for flashing
195 if( filesize
("rombox.ucl") > 1000) {
196 `cp rombox.ucl .rockbox/`; # UCL for flashing
200 mkdir ".rockbox/docs", 0777;
204 `cp $ROOT/docs/$_ .rockbox/docs/$_.txt`;
207 # Now do the WPS dance
209 system("perl $ROOT/wps/wpsbuild.pl -r $ROOT $ROOT/wps/WPSLIST $target");
212 print STDERR
"No wps module present, can't do the WPS magic!\n";
215 # now copy the file made for reading on the unit:
217 # `cp $webroot/docs/Help-JBR.txt .rockbox/docs/`;
220 # `cp $webroot/docs/Help-Stu.txt .rockbox/docs/`;
223 buildlangs
(".rockbox/langs");
226 `find .rockbox | xargs $ziptool $zip >/dev/null`;
229 `$ziptool $zip $image`;
232 # remove the .rockbox afterwards
236 my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
242 $date=sprintf("%04d%02d%02d", $year,$mon, $mday);
243 $shortdate=sprintf("%02d%02d%02d", $year%100,$mon, $mday);
245 # made once for all targets
247 my ($type, $target)=@_;
249 # build a full install zip file
250 buildzip
($output, $target,
251 ($type eq "player")?
0:1);
255 # not specified, guess!
256 if($target =~ /(recorder|ondio)/i) {
259 elsif($target =~ /iriver/i) {
260 $exe = "rockbox.iriver";
262 elsif($target =~ /gmini/i) {
263 $exe = "rockbox.gmini";
269 elsif($exe =~ /rockboxui/) {
270 # simulator, exclude the exe file
274 if($target =~ /player/i) {
275 runone
("player", $exe);
278 runone
("recorder", $exe);