sync
[www.jankratochvil.net.git] / project / staticbuild / Index.pm
1 # $Id$
2 # Main page of 'My::Project::staticbuild'
3 # Copyright (C) 2005 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 package project::staticbuild::Index;
20 require 5.6.0;  # at least 'use warnings;' but we need some 5.6.0+ modules anyway
21 our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
22 our $CVS_ID=q$Id$;
23 use strict;
24 use warnings;
25
26 use My::Web;
27 Wuse 'project::Lib';
28
29
30 our @ListItem=(
31                 "name"=>"staticbuild",
32                 "platform"=>"unixdevel",
33                 "priority"=>495,
34                 "download-source patches"=>"dist/staticbuild-2006-01-26-00.tar.gz",
35                 "download-Fedora Core 4 i386 binaries"=>"dist/staticbuild-2006-01-26-00-bin.tar.gz",
36                 "summary"=>"Fully static binaries build - GNU/Linux vendor independence",
37                 "license"=>"GPL",
38                 "maintenance"=>"ready",
39                 "language"=>"C",
40                 "description"=><<"HERE",
41 <p>There exists too many GNU/Linux distributions - vendors - and any produced
42 binary is not compatible with all of them due to the shared libraries and
43 configuration files dependencies. Due to many hardcoded shared libraries it is
44 no longer possible to just use <b>gcc -static</b>. These patches provide the
45 functionality you would expect from: <b>gcc -static</b></p>
46 HERE
47                 );
48
49 sub handler
50 {
51 project::Lib->init();
52
53
54 print <<"HERE";
55 <p>This static build framework is based on @{[ a_href 'http://fedora.redhat.com/','Fedora Core' ]}&nbsp;4
56 (@{[ a_href 'http://download.fedora.redhat.com/pub/fedora/linux/core/4/SRPMS/','SRPMS' ]}
57 and @{[ a_href 'http://download.fedora.redhat.com/pub/fedora/linux/core/updates/4/SRPMS/','SRPMS updates' ]}).
58 In fact it is not important which distribution the static build is based on as the final binaries
59 should run on any GNU/Linux system vendor/version. Just I decided for
60 @{[ a_href 'http://fedora.redhat.com/','Fedora Core' ]}.</p>
61 <p><b>You must use the same package versions on the main (dynamic) build system
62 as the static libraries are built for!</b> Therefore you must use
63 @{[ a_href 'http://fedora.redhat.com/','Fedora Core' ]}&nbsp;4 if using the
64 unchanged sources or even the binaries provided here.</p>
65 <p>This static build does not provide threading - neither POSIX threads nor LinuxThreads.
66 I did not need it anywhere and it gets everything simpler and smaller this way.</p>
67 <p>You should build your sources statically (using <i>automake</i>(1) <b>--enable-static</b>)
68 although without <b>gcc -static</b>. As the last step you should relink the binaries against
69 this <i>staticbuild</i> libraries by hand - it is not much possible to convince
70 <i>automake</i>(1) to properly relink it the minized way for you. Check the
71 '@{[ a_href 'http://git.jankratochvil.net/?p=captive.git;a=blob_plain;hb=HEAD;f=build-static','build-static' ]}'
72 script for an example.</p>
73 <p>This package has been used in its current or former versions for my projects:</p>
74 HERE
75 sub projectname($)
76 {
77 my($name)=@_;
78
79         return a_href "/project/$name/",project::Lib->title(project::Lib->name_to_hashref($name));
80 }
81 print <<"HERE";
82 <ul>
83         <li>@{[ projectname "captive" ]}</li>
84         <li>@{[ projectname "udpgate" ]}</li>
85 </ul>
86 HERE
87
88
89 my $gnome="http://bugzilla.gnome.org/show_bug.cgi?id=";
90 my $sources="http://sources.redhat.com/bugzilla/show_bug.cgi?id=";
91
92 sub bug($$$)
93 {
94 my($prefix,$id,$desc)=@_;
95
96         return "Bug ".a_href($prefix.$id,$id)." - $desc";
97 }
98
99 my @bugs=(
100         "GConf2-2.10.0-4"=>[],
101         "atk-1.9.1-1"=>[],
102         "fontconfig-2.2.3-13"=>[],
103         "fuse-2.4.2-2.fc4"=>[],
104         "glib2-2.6.6-1"=>[],
105         "glibc-2.3.5-10.3"=>[
106                 bug($sources,1043,"--enable-static-nss false warnings"),
107                 bug($sources,1044,'--enable-static-nss nsswitch "compat"'),
108                 bug($sources,1045,"--disable-shared / --enable-static-nss build fix"),
109                 bug($sources,1050,"new --enable-static-gconv"),
110                 ],
111         "gnome-vfs2-2.10.0-5"=>[
112                 bug($gnome, 47053,"new --with-included-filesystems"),
113                 ],
114         "gtk2-2.6.10-2.fc4.4"=>[],
115         "libbonobo-2.8.1-1"=>[
116                 bug($gnome,309504,"new --disable-threads"),
117                 ],
118         "libgnome-2.10.0-3"=>[],
119         "libxml2-2.6.20-1.FC4"=>[],
120         "pango-1.8.1-2"=>[],
121         "xorg-x11-6.8.2-37.FC4.49.2"=>[],
122         );
123
124
125 print <<"HERE";
126 <table border="1" class="margin-center">
127         <tr><th>Patched Package</th><th>Patches Submitted as Bugs</th></tr>
128 HERE
129 while (@bugs) {
130         my $package=shift @bugs;
131         my @buglist=@{shift @bugs};
132         print "\t".'<tr><td rowspan="'.(0+@buglist || 1).'">'.$package."</td>";
133         # BEWARE: Wrong code indentation:
134         if (@buglist) {
135                 print "<td>".shift(@buglist)."</td></tr>";
136                 print "\t"."<tr><td>$_</td></tr>\n" for @buglist;
137                 }
138         else {
139                 print "\t".'<td align="center">-</td></tr>'."\n";
140                 }
141         }
142 print <<"HERE";
143 </table>
144 HERE
145
146
147 exit;
148 }
149 1;