Dateianhang 'subversion_install.pl'
Herunterladen 1 #!/usr/bin/perl -w
2
3 use File::Basename;
4 use strict;
5
6 # bitte die Dateinamen anpassen
7
8 my %VARS_ = (
9 "SVN_archive" => "subversion-1.1.1.tar.bz2",
10 "DB_archive" => "db-4.2.52.NC.tar.gz",
11 "DB_patches" => ["db_patch.4.2.52.1","db_patch.4.2.52.2"],
12 "APACHE_archive"=> "httpd-2.0.52.tar.bz2",
13 "LOG_FILE" => "svn_install.log"
14 );
15 # wo befindet sich denn überhaupt das BASE_DIR ?
16 $VARS_{BASE_DIR} = $ENV{PWD};
17 # vars überprüfen
18 print "\n Checking paths ...\n";
19 foreach my $key ( sort keys %VARS_ ){
20 #print $key,"\t",$VARS_{$key},"\n";
21 if (-e $VARS_{$key}){
22 print $key,"\t",$VARS_{$key},"\t ok \n";
23 }
24 # liste der patches
25 elsif ($VARS_{$key} =~ /^ARRAY/){
26 foreach my $patch ( @{$VARS_{$key}}){
27 if(-e $patch){
28 print $key,"\t",$patch,"\t ok \n";
29 }
30 else { die $key,"\t",$patch,"\t fail\n";}
31 }
32 }
33 else{
34 die $key,"\t",$VARS_{$key},"\t fail\n";
35 }
36 }
37 print "\n";
38 # alles mitloggen
39 $VARS_{LOG} = $VARS_{BASE_DIR}."/".$VARS_{LOG_FILE};
40 open(LOG,">>".$VARS_{LOG})
41 || eval { print "Fehler: ",$^E; exit;}; #logfile öffnen
42 &logg("starting ...");
43
44
45 # *********************
46 # SUBVERSION entpacken
47 &logg("SVN entpacke ".$VARS_{SVN_archive});
48 ($VARS_{SVN_DIR} = $VARS_{SVN_archive}) =~ s/\.tar\.(bz2|gz)$//i;
49 unless(-e $VARS_{SVN_DIR}){
50 # bz2 oder gz
51 if ( $VARS_{SVN_archive} =~ /\.tar\.bz2$/i) { `tar -xjf $VARS_{SVN_archive}`;}
52 elsif ( $VARS_{SVN_archive} =~ /\.tar\.gz$/i) { `tar -xzf $VARS_{SVN_archive}`;}
53 else { die "\n Filetyp unknown $VARS_{SVN_archive}\n";}
54 print " fertig\n";
55 }
56 #sub t{
57
58 # *********************
59 # ./autogen.sh im Subversion-dir ausführen
60 chdir( $VARS_{SVN_DIR} );
61 `rm -r apr-util/xml/expat/autom4te.cache`;
62 &logg("SVN ./autogen.sh im svn-dir");
63 `./autogen.sh`;
64 chdir("..");
65
66 # *********************
67 # DB entpacken
68 &logg("DB entpacke ".$VARS_{DB_archive});
69 ($VARS_{DB_DIR} = $VARS_{DB_archive}) =~ s/\.tar\.(bz2|gz)$//i;
70 unless(-e $VARS_{DB_DIR}){
71 # bz2 oder gz
72 if ( $VARS_{DB_archive} =~ /\.tar\.bz2$/i) { `tar -xjf $VARS_{DB_archive}`;}
73 elsif ( $VARS_{DB_archive} =~ /\.tar\.gz$/i) { `tar -xzf $VARS_{DB_archive}`;}
74 else { die "\n Filetyp unknown $VARS_{DB_archive}\n";}
75 print " fertig\n";
76 }
77
78 # *********************
79 # DB patchen
80 &logg("DB patching DB ...");
81 chdir($VARS_{DB_DIR});
82 foreach my $patch_ ( @{$VARS_{DB_patches}}){
83 `patch -p0 < ../$patch_ >> $VARS_{LOG}`;
84 }
85 chdir("..");
86
87 # *********************
88 # DB konfigurieren, make , make install, bekannt machen
89 &logg("DB ./build_unix ... ");
90 chdir($VARS_{DB_DIR}."/build_unix");
91 `../dist/configure >> $VARS_{LOG}`;
92 &logg("DB make ... ");
93 `make >> $VARS_{LOG}`;
94 &logg("DB make install ... ");
95 `make install >> $VARS_{LOG}`;
96 &logg("DB make clean ... ");
97 `make clean >> $VARS_{LOG}`;
98 $VARS_{DB_libs} = "/usr/local/BerkeleyDB.4.2/lib";
99 my $_cmd_fgrep = `fgrep $VARS_{DB_libs} /etc/ld.so.conf`;
100 chomp($_cmd_fgrep);
101 unless( $_cmd_fgrep eq $VARS_{DB_libs}){
102 exec("echo $VARS_{DB_libs} >> /etc/ld.so.conf");
103 exec("ldconfig");
104 }
105 chdir("../..");
106
107 ## *********************
108 ## APACHE entpacken, konfigurieren, make, make install, make clean
109 &logg("APACHE entpacke ".$VARS_{APACHE_archive});
110 ($VARS_{APACHE_DIR} = $VARS_{APACHE_archive}) =~ s/\.tar\.(bz2|gz)$//i;
111 unless(-e $VARS_{APACHE_DIR}){
112 # bz2 oder gz
113 if ( $VARS_{APACHE_archive} =~ /\.tar\.bz2$/i) { `tar -xjf $VARS_{APACHE_archive}`;}
114 elsif ( $VARS_{APACHE_archive} =~ /\.tar\.gz$/i) { `tar -xzf $VARS_{APACHE_archive}`;}
115 else { die "\n Filetyp unknown $VARS_{APACHE_archive}\n";}
116 print " fertig\n";
117 }
118 chdir($VARS_{APACHE_DIR});
119 &logg("APACHE ./buildconf ... ");
120 `./buildconf >> $VARS_{LOG}`; # produziert Fehler, muss deswegen ohne Fehlerabfang ausgeführt werden
121 &logg("APACHE ./configure ... ");
122 `./configure --enable-dav=shared --with-gdbm=no --enable-deflate=shared --enable-so --with-berkeley-db=/usr/local/BerkeleyDB.4.2 --with-dbm=db4>> $VARS_{LOG}`;
123 &logg("APACHE make ... ");
124 `make >> $VARS_{LOG}`;
125 &logg("APACHE make install ... ");
126 `make install >> $VARS_{LOG}`;
127 &logg("APACHE make clean ... ");
128 `make clean >> $VARS_{LOG}`;
129 chdir("..");
130 #}
131 ## *********************
132 ## SUBVERSION konfigurieren, make, make install, make clean
133 chdir($VARS_{SVN_DIR});
134 &logg("SVN ./configure");
135 `./configure --with-berkeley-db=/usr/local/BerkeleyDB.4.2 --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2`;
136 &logg("SVN loesche /usr/local/lib/libsvn*");
137 `rm -f /usr/local/lib/libsvn*`;
138 &logg("SVN loesche /usr/local/lib/libneon*");
139 `rm -f /usr/local/lib/libneon*`;
140 &logg("SVN make");
141 `make >> $VARS_{LOG}`;
142 &logg("SVN make install");
143 `make install >> $VARS_{LOG}`;
144 &logg("SVN make clean");
145 `make clean >> $VARS_{LOG}`;
146 &logg("SVN cp tools/xslt/* /usr/local/apache2/htdocs");
147 `cp tools/xslt/* /usr/local/apache2/htdocs`;
148 &logg("SVN Gruppe svn anlegen");
149 `groupadd -r svn`;
150 &logg("SVN Nutzer anlegen");
151 `useradd -r -g svn svn`;
152 &logg("SVN Benutzerpasswort setzen");
153 `passwd svn`;
154
155 foreach my $dir ("SVN_DIR","APACHE_DIR","DB_DIR"){
156 &logg("loesche ".$VARS_{$dir});
157 `rm -r $VARS_{$dir} >> $VARS_{LOG}`;
158 }
159
160 print "\n"x2,"so nun bitte ab Punkt 40 selber weitermachen","\n"x2;
161
162 &logg("... ending.");
163 close(LOG); # Logfile schließen
164 sub ex{
165 `$_[0] >> $VARS_{LOG}` || die "Fehler: $_[0] $^E\n";
166 }
167
168 # mitloggen
169 sub logg{
170 my $date = `date`; # datum
171 chomp($date); # ohne zusätzlichen Absatz
172 print LOG "\n",$date,"\t",$_[0],"\n";# schreiben
173 print $_[0],"\n";
174 }
175
Gespeicherte Dateianhänge
Um Dateianhänge in eine Seite einzufügen sollte unbedingt eine Angabe wie attachment:dateiname benutzt werden, wie sie auch in der folgenden Liste der Dateien erscheint. Es sollte niemals die URL des Verweises ("laden") kopiert werden, da sich diese jederzeit ändern kann und damit der Verweis auf die Datei brechen würde.Sie dürfen keine Anhänge an diese Seite anhängen!