4 include 'blfs-include.php';
7 $CHAPTERS = 'Chapters 45-47';
8 $START_PACKAGE = 'audacious';
9 $STOP_PACKAGE = 'libisofs';
11 //$current="cdrtools"; // For debugging
16 $ignores[ 'freetts1' ] = '';
19 $regex[ 'gvolwheel' ] = "/^.*Download gvolwheel-(\d[\d\.]+\d).tar.*$/";
20 $regex[ 'simpleburn' ] = "/^.*SimpleBurn-(\d[\d\.]+\d).*$/";
24 array( 'pkg' => 'mpg123',
26 'replace' => "http://sourceforge.net/projects/mpg123/files" ),
28 array( 'pkg' => 'lame',
30 'replace' => "http://sourceforge.net/projects/lame/files" ),
32 array( 'pkg' => 'freetts',
34 'replace' => "http://sourceforge.net/projects/freetts/files" ),
36 array( 'pkg' => 'amarok',
38 'replace' => "http://download.kde.org/stable/amarok" ),
40 array( 'pkg' => 'libisoburn',
42 'replace' => "https://dev.lovelyhq.com/libburnia/libisoburn/releases" ),
44 array( 'pkg' => 'libisofs',
46 'replace' => "https://dev.lovelyhq.com/libburnia/libisofs/releases" ),
48 array( 'pkg' => 'libburn',
50 'replace' => "https://dev.lovelyhq.com/libburnia/libburn/releases" ),
52 array( 'pkg' => 'gvolwheel',
54 'replace' => "http://sourceforge.net/projects/gvolwheel/files" ),
56 array( 'pkg' => 'pavucontrol',
58 'replace' => "https://freedesktop.org/software/pulseaudio/pavucontrol" ),
60 array( 'pkg' => 'transcode',
62 'replace' => "http://ftp.osuosl.org/pub/blfs/conglomeration/transcode" ),
64 array( 'pkg' => 'vlc',
66 'replace' => "http://download.videolan.org/vlc/" ),
68 array( 'pkg' => 'xine-ui',
70 'replace' => "https://sourceforge.net/projects/xine/files/xine-ui" ),
71 #'replace' => "https://www.xine-project.org/home" ),
73 array( 'pkg' => 'cdrdao',
75 'replace' => "http://sourceforge.net/projects/cdrdao/files" ),
77 array( 'pkg' => 'pnmixer-v',
79 'replace' => "https://github.com/nicklan/pnmixer/releases" ),
81 array( 'pkg' => 'MPlayer',
83 'replace' => "http://www.mplayerhq.hu/MPlayer/releases" ),
85 array( 'pkg' => 'Clearlooks',
87 'replace' => "http://www.mplayerhq.hu/MPlayer/skins" ),
89 array( 'pkg' => 'kwave',
91 'replace' => "http://download.kde.org/stable/release-service" ),
93 array( 'pkg' => 'simpleburn',
95 'replace' => "http://simpleburn.tuxfamily.org/-Download-" ),
97 array( 'pkg' => 'cdrtools',
99 'replace' => "https://sourceforge.net/projects/cdrtools/files/alpha" ),
102 function get_packages( $package, $dirpath )
110 if ( isset( $current ) && $book_index != "$current" ) return 0;
112 // Fix up directory path
113 foreach ( $url_fix as $u )
115 $replace = $u[ 'replace' ];
116 $match = $u[ 'match' ];
118 if ( isset( $u[ 'pkg' ] ) )
120 if ( $package == $u[ 'pkg' ] )
122 $dirpath = preg_replace( "/$match/", "$replace", $dirpath );
128 if ( preg_match( "/$match/", $dirpath ) )
130 $dirpath = preg_replace( "/$match/", "$replace", $dirpath );
137 if ( preg_match( "/^ftp/", $dirpath ) )
140 $lines = http_get_file( "$dirpath/" );
144 $lines = http_get_file( $dirpath );
145 if ( ! is_array( $lines ) ) return $lines;
148 if ( isset( $regex[ $package ] ) )
150 // Custom search for latest package name
151 foreach ( $lines as $l )
153 if ( preg_match( '/^\h*$/', $l ) ) continue;
154 $ver = preg_replace( $regex[ $package ], "$1", $l );
156 if ( $ver == $l ) continue;
157 return $ver; // Return first match of regex
160 return 0; // This is an error
163 if ( $package == "cdparanoia-III" )
164 return find_max( $lines, "/^.*cdparanoia-III-/",
165 "/^.*cdparanoia-III-([\d\.]+).src.tgz.*$/" );
167 if ( $package == "transcode" )
168 return find_max( $lines, "/transcode/", "/^.*transcode-([\d\.]+).tar.*$/" );
170 if ( $package == "amarok" )
171 return find_max( $lines, "/\d\./", "/^.*;([\d\.]+)\/.*$/", TRUE );
173 if ( $package == "xine-ui" )
174 return find_max( $lines, "/\d\.\d/", "/^\s*(\d\.[\d\.]+)\s*\d{4}.*$/" );
176 if ( $package == "freetts" )
177 return find_max( $lines, "/freetts/", "/^.*freetts-([\d\.]+)-bin.*$/" );
179 if ( $package == "lame" )
180 return find_max( $lines, "/Latest/", "/^.*Version ([\d\.]+) sources.*$/" );
182 if ( $package == "kwave" )
183 return find_max( $lines, "/^\d\d\./", "/^(\d\d\.[\d\.]+)\/.*$/" );
185 if ( $package == "dvd+rw-tools" )
186 return find_max( $lines, "/dvd\+/", "/^.*dvd\+rw-tools-([\d\.]+).tar.*$/" );
188 if ( $package == "vlc" )
190 $max = find_max( $lines, "/\d\.[\d\.]+\//", "/^([\d\.]+)\/.*$/" );
191 if ( $max == "3.0.12.1" ) $max = "3.0.12";
195 if ( $package == "cdrtools" )
196 return find_max( $lines, "/$package/", "/^.*$package-([\d\.]+a?\d*)\.tar.*$/" );
198 if ( $package == "cdrtools" )
199 return find_max( $lines, "/cdrtools-[\d\.]+/", "/^.*cdrtools-([\d\.]+a?\d?).tar.*$/" );
201 if ( $book_index == "pavucontrol" )
202 return find_max( $lines, "/Version/", "/^.*Version ([\d\.]+\d) released.*$/" );
204 if ( $package == "pnmixer-v" )
205 return find_max( $lines, "/pnmixer-v/", "/^.*pnmixer-v([\d\.]+).tar.*$/" );
207 if ( $package == "libburn" ||
208 $package == "libisoburn" ||
209 $package == "libisofs" )
210 return find_max( $lines, "/release-\d/", "/^.*release-([\d\.]+)$/" );
212 // Most packages are in the form $package-n.n.n
213 // Occasionally there are dashes (e.g. 201-1)
215 $max = find_max( $lines, "/$package/", "/^.*$package-([\d\.]*\d)\.tar.*$/" );
219 function get_pattern( $line )
222 array( 'pkg' => 'mpg123',
223 'regex' => "/^.*mpg123-(\d[\d\.]+).*$/" ),
225 array( 'pkg' => 'kwave',
226 'regex' => "/^.*kwave-(\d[\d\.]+).*$/" ),
228 array( 'pkg' => 'mplayer',
229 'regex' => "/^.*mplayer-(SVN-r\d+).*$/" ),
231 array( 'pkg' => 'pnmixer',
232 'regex' => "/^.*pnmixer-v(\d[\d\.]+).*$/" ),
235 foreach( $match as $m )
239 if ( preg_match( "/$pkg/", $line ) )
240 return $m[ 'regex' ];
243 return "/\D*(\d.*\d)\D*$/";
246 get_current(); // Get what is in the book
248 // Get latest version for each package
249 foreach ( $book as $pkg => $data )
253 $base = $data[ 'basename' ];
254 $url = $data[ 'url' ];
255 $bver = $data[ 'version' ];
257 echo "book index: $book_index $bver $url \n";
259 $v = get_packages( $book_index, $url );
260 $vers[ $book_index ] = $v;
263 html(); // Write html output