Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 953 lines (843 sloc) 50.948 kB
805f404 @eldy Update version
eldy authored
1 #!/usr/bin/perl
2 #----------------------------------------------------------------------------
3 # \file build/makepack-dolibarr.pl
0666287 @eldy Work on APS package
eldy authored
4 # \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
5 # \version $Id: makepack-dolibarr.pl,v 1.143 2011/08/14 15:32:37 eldy Exp $
3177e3b @eldy Packager can now build different packages into one launch.
eldy authored
6 # \author (c)2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
805f404 @eldy Update version
eldy authored
7 #----------------------------------------------------------------------------
8
9 use Cwd;
10
11 $PROJECT="dolibarr";
c67f858 @eldy Version
eldy authored
12 $MAJOR="3";
32f3684 @eldy Prepare new version
eldy authored
13 $MINOR="2";
14 $BUILD="0-alpha"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
1e911de @eldy Work on rpm package
eldy authored
15 $RPMSUBVERSION="auto"; # auto use value found into BUILD
805f404 @eldy Update version
eldy authored
16
ab0edf2 @eldy Work on package
eldy authored
17 @LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
805f404 @eldy Update version
eldy authored
18 %REQUIREMENTTARGET=( # Tool requirement for each package
53edbfd @eldy makepack can build snapshot
eldy authored
19 "SNAPSHOT"=>"tar",
805f404 @eldy Update version
eldy authored
20 "TGZ"=>"tar",
21 "ZIP"=>"7z",
ab0edf2 @eldy Work on package
eldy authored
22 "RPM_GENERIC"=>"rpmbuild",
23 "RPM_FEDORA"=>"rpmbuild",
24 "RPM_MANDRIVA"=>"rpmbuild",
25 "RPM_OPENSUSE"=>"rpmbuild",
4f284e1 @eldy Update package scripts
eldy authored
26 "DEB"=>"dpkg",
e28ed80 @eldy Works on APS package
eldy authored
27 "APS"=>"zip",
a6f4a66 @eldy Prepare 2.7.0
eldy authored
28 "EXEDOLIWAMP"=>"iscc.exe"
805f404 @eldy Update version
eldy authored
29 );
30 %ALTERNATEPATH=(
31 "7z"=>"7-ZIP",
32 "makensis.exe"=>"NSIS"
33 );
34
35 $FILENAME="$PROJECT";
53edbfd @eldy makepack can build snapshot
eldy authored
36 $FILENAMESNAPSHOT="$PROJECT-snapshot";
805f404 @eldy Update version
eldy authored
37 $FILENAMETGZ="$PROJECT-$MAJOR.$MINOR.$BUILD";
38 $FILENAMEZIP="$PROJECT-$MAJOR.$MINOR.$BUILD";
39 $FILENAMERPM="$PROJECT-$MAJOR.$MINOR.$BUILD-$RPMSUBVERSION";
32597f0 @eldy Fix: Remove sql
eldy authored
40 $FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${BUILD}";
e28ed80 @eldy Works on APS package
eldy authored
41 $FILENAMEAPS="$PROJECT-$MAJOR.$MINOR.$BUILD.app";
a6f4a66 @eldy Prepare 2.7.0
eldy authored
42 $FILENAMEEXEDOLIWAMP="$PROJECT-$MAJOR.$MINOR.$BUILD";
ab0edf2 @eldy Work on package
eldy authored
43 if (-d "/usr/src/redhat") { $RPMDIR="/usr/src/redhat"; } # redhat
44 if (-d "/usr/src/RPM") { $RPMDIR="/usr/src/RPM"; } # mandrake
805f404 @eldy Update version
eldy authored
45
46
47 use vars qw/ $REVISION $VERSION /;
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
48 $REVISION='$Revision: 1.143 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1;
ab0edf2 @eldy Work on package
eldy authored
49 $VERSION="3.1 (build $REVISION)";
805f404 @eldy Update version
eldy authored
50
51
52
53 #------------------------------------------------------------------------------
54 # MAIN
55 #------------------------------------------------------------------------------
56 ($DIR=$0) =~ s/([^\/\\]+)$//; ($PROG=$1) =~ s/\.([^\.]*)$//; $Extension=$1;
57 $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/;
58
7b8786f @eldy Prepare release
eldy authored
59 $SOURCE="$DIR/..";
805f404 @eldy Update version
eldy authored
60 $DESTI="$SOURCE/build";
61
62 # Detect OS type
63 # --------------
64 if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='linux'; $CR=''; }
65 elsif (-d "/etc" && -d "/Users") { $OS='macosx'; $CR=''; }
66 elsif ("$^O" =~ /cygwin/i || "$^O" =~ /win32/i) { $OS='windows'; $CR="\r"; }
67 if (! $OS) {
c317691 @eldy Backport after release
eldy authored
68 print "$PROG.$Extension was not able to detect your OS.\n";
12a247e @eldy Fix: Packager errors
eldy authored
69 print "Can't continue.\n";
70 print "$PROG.$Extension aborted.\n";
805f404 @eldy Update version
eldy authored
71 sleep 2;
12a247e @eldy Fix: Packager errors
eldy authored
72 exit 1;
805f404 @eldy Update version
eldy authored
73 }
74
75 # Define buildroot
76 # ----------------
77 if ($OS =~ /linux/) {
78 $TEMP=$ENV{"TEMP"}||$ENV{"TMP"}||"/tmp";
79 }
80 if ($OS =~ /macos/) {
81 $TEMP=$ENV{"TEMP"}||$ENV{"TMP"}||"/tmp";
82 }
83 if ($OS =~ /windows/) {
84 $TEMP=$ENV{"TEMP"}||$ENV{"TMP"}||"c:/temp";
85 $PROGPATH=$ENV{"ProgramFiles"};
86 }
87 if (! $TEMP || ! -d $TEMP) {
88 print "Error: A temporary directory can not be find.\n";
89 print "Check that TEMP or TMP environment variable is set correctly.\n";
12a247e @eldy Fix: Packager errors
eldy authored
90 print "$PROG.$Extension aborted.\n";
805f404 @eldy Update version
eldy authored
91 sleep 2;
92 exit 2;
93 }
94 $BUILDROOT="$TEMP/buildroot";
95
96
ab0edf2 @eldy Work on package
eldy authored
97 my $copyalreadydone=0; # Use "-" before number of choice to avoid copy
016805f @eldy Fxi: Translate country in region list.
eldy authored
98 my $batch=0;
b43c5d2 @eldy makepack can build snapshot
eldy authored
99 for (0..@ARGV-1) {
12a247e @eldy Fix: Packager errors
eldy authored
100 if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
101 if ($ARGV[$_] =~ /^-*desti=(.+)/i) { $DESTI=$1; }
712898f @eldy Can build a snapshot on 3.0 version
eldy authored
102 if ($ARGV[$_] =~ /^-*prefix=(.+)/i) {
12a247e @eldy Fix: Packager errors
eldy authored
103 $PREFIX=$1;
104 $FILENAMESNAPSHOT.="-".$PREFIX;
712898f @eldy Can build a snapshot on 3.0 version
eldy authored
105 }
b43c5d2 @eldy makepack can build snapshot
eldy authored
106 }
ab0edf2 @eldy Work on package
eldy authored
107 if ($ENV{"DESTI"}) { $DESTI = $ENV{"DESTI"}; } # Force output dir if env DESTI is defined
108
b43c5d2 @eldy makepack can build snapshot
eldy authored
109
805f404 @eldy Update version
eldy authored
110 print "Makepack version $VERSION\n";
111 print "Building package name: $PROJECT\n";
112 print "Building package version: $MAJOR.$MINOR.$BUILD\n";
b43c5d2 @eldy makepack can build snapshot
eldy authored
113 print "Source directory: $SOURCE\n";
114 print "Target directory: $DESTI\n";
805f404 @eldy Update version
eldy authored
115
116
53edbfd @eldy makepack can build snapshot
eldy authored
117
805f404 @eldy Update version
eldy authored
118 # Choose package targets
119 #-----------------------
120 if ($target) {
121 $CHOOSEDTARGET{uc($target)}=1;
122 }
123 else {
124 my $found=0;
125 my $NUM_SCRIPT;
126 while (! $found) {
12a247e @eldy Fix: Packager errors
eldy authored
127 my $cpt=0;
55dfc1e @eldy Work on package
eldy authored
128 printf(" %2d - %-12s (%s)\n",$cpt,"All (Except SNAPSHOT)","Need ".join(",",values %REQUIREMENTTARGET));
12a247e @eldy Fix: Packager errors
eldy authored
129 foreach my $target (@LISTETARGET) {
130 $cpt++;
ab0edf2 @eldy Work on package
eldy authored
131 printf(" %2d - %-12s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target});
12a247e @eldy Fix: Packager errors
eldy authored
132 }
805f404 @eldy Update version
eldy authored
133
12a247e @eldy Fix: Packager errors
eldy authored
134 # On demande de choisir le fichier à passer
21b10bf @eldy Work on rpm package
eldy authored
135 print "Choose one package number or several separated with space (0 - ".$cpt."): ";
12a247e @eldy Fix: Packager errors
eldy authored
136 $NUM_SCRIPT=<STDIN>;
137 chomp($NUM_SCRIPT);
138 if ($NUM_SCRIPT =~ s/-//g) {
139 # Do not do copy
140 $copyalreadydone=1;
141 }
21b10bf @eldy Work on rpm package
eldy authored
142 if ($NUM_SCRIPT !~ /^[0-9\s]+$/)
12a247e @eldy Fix: Packager errors
eldy authored
143 {
144 print "This is not a valid package number list.\n";
145 $found = 0;
146 }
147 else
148 {
149 $found = 1;
150 }
805f404 @eldy Update version
eldy authored
151 }
152 print "\n";
153 if ($NUM_SCRIPT) {
12a247e @eldy Fix: Packager errors
eldy authored
154 foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
155 $CHOOSEDTARGET{$LISTETARGET[$num-1]}=1;
156 }
805f404 @eldy Update version
eldy authored
157 }
158 else {
12a247e @eldy Fix: Packager errors
eldy authored
159 foreach my $key (@LISTETARGET) {
55dfc1e @eldy Work on package
eldy authored
160 if ($key ne 'SNAPSHOT') { $CHOOSEDTARGET{$key}=1; }
805f404 @eldy Update version
eldy authored
161 }
162 }
163 }
164
165 # Test if requirement is ok
166 #--------------------------
167 foreach my $target (keys %CHOOSEDTARGET) {
168 foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) {
169 # Test
170 print "Test requirement for target $target: Search '$req'... ";
0666287 @eldy Work on APS package
eldy authored
171 $newreq=$req; $newparam='';
172 if ($newreq eq 'zip') { $newparam.='-h'; }
173 $cmd="\"$newreq\" $newparam 2>&1";
174 print "Test command ".$cmd."... ";
175 $ret=`$cmd`;
805f404 @eldy Update version
eldy authored
176 $coderetour=$?; $coderetour2=$coderetour>>8;
177 if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) {
178 # Not found error, we try in PROGPATH
179 $ret=`"$PROGPATH/$ALTERNATEPATH{$req}/$req\" 2>&1`;
180 $coderetour=$?; $coderetour2=$coderetour>>8;
181 $REQUIREMENTTARGET{$target}="$PROGPATH/$ALTERNATEPATH{$req}/$req";
0666287 @eldy Work on APS package
eldy authored
182 }
805f404 @eldy Update version
eldy authored
183
184 if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/))) {
185 # Not found error
186 print "Not found\nCan't build target $target. Requirement '$req' not found in PATH\n";
187 $CHOOSEDTARGET{$target}=-1;
188 last;
189 } else {
190 # Pas erreur ou erreur autre que programme absent
191 print " Found ".$REQUIREMENTTARGET{$target}."\n";
192 }
193 }
194 }
195
196 print "\n";
197
198 # Check if there is at least on target to build
199 #----------------------------------------------
200 $nboftargetok=0;
a6f4a66 @eldy Prepare 2.7.0
eldy authored
201 $nboftargetneedbuildroot=0;
bd018de @eldy makepack can build snapshot
eldy authored
202 $nboftargetneedcvs=0;
805f404 @eldy Update version
eldy authored
203 foreach my $target (keys %CHOOSEDTARGET) {
204 if ($CHOOSEDTARGET{$target} < 0) { next; }
12a247e @eldy Fix: Packager errors
eldy authored
205 if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP')
206 {
207 $nboftargetneedbuildroot++;
208 }
209 if ($target eq 'SNAPSHOT')
210 {
211 $nboftargetneedcvs++;
212 }
213 $nboftargetok++;
805f404 @eldy Update version
eldy authored
214 }
215
216 if ($nboftargetok) {
217
bd018de @eldy makepack can build snapshot
eldy authored
218 # Update CVS if required
219 #-----------------------
220 if ($nboftargetneedcvs)
12a247e @eldy Fix: Packager errors
eldy authored
221 {
222 print "Go to directory $SOURCE\n";
223 $olddir=getcwd();
224 chdir("$SOURCE");
225 print "Run cvs update -P -d\n";
226 $ret=`cvs update -P -d 2>&1`;
227 chdir("$olddir");
228 }
229
53edbfd @eldy makepack can build snapshot
eldy authored
230 # Update buildroot if required
231 #-----------------------------
a6f4a66 @eldy Prepare 2.7.0
eldy authored
232 if ($nboftargetneedbuildroot)
12a247e @eldy Fix: Packager errors
eldy authored
233 {
234 if (! $copyalreadydone) {
ab0edf2 @eldy Work on package
eldy authored
235 print "Creation of a buildroot used for all packages\n";
236
12a247e @eldy Fix: Packager errors
eldy authored
237 print "Delete directory $BUILDROOT\n";
238 $ret=`rm -fr "$BUILDROOT"`;
239
240 mkdir "$BUILDROOT";
241 mkdir "$BUILDROOT/$PROJECT";
242 print "Copy $SOURCE into $BUILDROOT/$PROJECT\n";
243 $ret=`cp -pr "$SOURCE" "$BUILDROOT/$PROJECT"`;
244 }
245 print "Clean $BUILDROOT\n";
0666287 @eldy Work on APS package
eldy authored
246 $ret=`rm -f $BUILDROOT/$PROJECT/index.php`;
12a247e @eldy Fix: Packager errors
eldy authored
247 $ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
248 $ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
249 $ret=`rm -fr $BUILDROOT/$PROJECT/.settings`;
fa56834 @eldy Work on debian package
eldy authored
250 $ret=`rm -fr $BUILDROOT/$PROJECT/pom.xml`;
251 $ret=`rm -fr $BUILDROOT/$PROJECT/default.properties`;
12a247e @eldy Fix: Packager errors
eldy authored
252 $ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
0666287 @eldy Work on APS package
eldy authored
253
d5a9e4b @eldy Fix: Packager does not include other packages
eldy authored
254 $ret=`rm -f $BUILDROOT/$PROJECT/build/DoliW*-*`;
255 $ret=`rm -f $BUILDROOT/$PROJECT/build/DoliM*-*`;
d4d4304 @eldy Work on 3.1 packaging
eldy authored
256 $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.changes`;
fa56834 @eldy Work on debian package
eldy authored
257 $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`;
258 $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`;
d4d4304 @eldy Work on 3.1 packaging
eldy authored
259 $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.gz`;
260 $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`;
0666287 @eldy Work on APS package
eldy authored
261 $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`;
262 $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`;
fa56834 @eldy Work on debian package
eldy authored
263 $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.gz`;
0666287 @eldy Work on APS package
eldy authored
264 $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tgz`;
265 $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`;
266 $ret=`rm -f $BUILDROOT/$PROJECT/build/doxygen/doxygen_warnings.log`;
53e1579 @eldy Fix: Code could not works for debian packages
eldy authored
267 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php`;
0666287 @eldy Work on APS package
eldy authored
268 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`;
269 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`;
270 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`;
271 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`;
e0def82 @eldy Work on packaging RPM & DEB
eldy authored
272 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`;
477cd46 @eldy Enhance debian package
eldy authored
273 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/barcode/php-barcode/fonts/AerialMono*.ttf`;
274 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/barcode/php-barcode/fonts/Tymes*.ttf`;
275 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/barcode/php-barcode/fonts/Veranda*.ttf`;
fa56834 @eldy Work on debian package
eldy authored
276 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/fckeditor/fckeditor.py`;
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
277 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
278 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/fckeditor/_samples`;
279 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/fckeditor/_testcases`;
0666287 @eldy Work on APS package
eldy authored
280
67bf15f @eldy Work on 3.1 packaging
eldy authored
281 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mssql/README`;
282 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`;
283 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
284
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
285 $ret=`rm -fr $BUILDROOT/$PROJECT/dev/dbmodel`;
286 $ret=`rm -fr $BUILDROOT/$PROJECT/dev/fpdf`;
287 $ret=`rm -fr $BUILDROOT/$PROJECT/dev/initdata`;
6285ba0 @eldy Work on rpm package
eldy authored
288 $ret=`rm -fr $BUILDROOT/$PROJECT/dev/iso-normes`;
289 $ret=`rm -fr $BUILDROOT/$PROJECT/dev/licence`;
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
290 $ret=`rm -fr $BUILDROOT/$PROJECT/dev/phpcheckstyle`;
291 $ret=`rm -fr $BUILDROOT/$PROJECT/dev/phpunit`;
477cd46 @eldy Enhance debian package
eldy authored
292 $ret=`rm -fr $BUILDROOT/$PROJECT/dev/test`;
293 $ret=`rm -fr $BUILDROOT/$PROJECT/dev/spec`;
5b4170c @eldy Work on aps package
eldy authored
294 $ret=`rm -fr $BUILDROOT/$PROJECT/dev/uml`;
295 $ret=`rm -fr $BUILDROOT/$PROJECT/dev/xdebug`;
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
296 $ret=`rm -f $BUILDROOT/$PROJECT/doc/*/README`;
297 $ret=`rm -fr $BUILDROOT/$PROJECT/doc/flyer`;
298 $ret=`rm -fr $BUILDROOT/$PROJECT/doc/font`;
5b4170c @eldy Work on aps package
eldy authored
299 $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot2.png`;
300 $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot3.png`;
301 $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot4.png`;
302 $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot5.png`;
303 $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot6.png`;
304 $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot7.png`;
305 $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot8.png`;
306 $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot9.png`;
307 $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot10.png`;
308 $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot11.png`;
309 $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`;
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
310 $ret=`rm -fr $BUILDROOT/$PROJECT/doc/rollup`;
311 $ret=`rm -fr $BUILDROOT/$PROJECT/doc/tshirt`;
12a247e @eldy Fix: Packager errors
eldy authored
312 $ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
313 $ret=`rm -fr $BUILDROOT/$PROJECT/document`;
314 $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom`;
3ec093a @eldy Prepare 3.0
eldy authored
315 $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom2`;
12a247e @eldy Fix: Packager errors
eldy authored
316 $ret=`rm -fr $BUILDROOT/$PROJECT/test`;
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
317 #$ret=`rm -fr $BUILDROOT/$PROJECT/build/deb/po/CVS*`;
12a247e @eldy Fix: Packager errors
eldy authored
318 $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
477cd46 @eldy Enhance debian package
eldy authored
319 $ret=`rm -fr $BUILDROOT/$PROJECT/CVS* $BUILDROOT/$PROJECT/*/CVS* $BUILDROOT/$PROJECT/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/*/*/*/*/*/CVS*`;
1e911de @eldy Work on rpm package
eldy authored
320 $ret=`rm -fr $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
321 $ret=`rm -fr $BUILDROOT/$PROJECT/.svn $BUILDROOT/$PROJECT/*/.svn $BUILDROOT/$PROJECT/*/*/.svn $BUILDROOT/$PROJECT/*/*/*/.svn $BUILDROOT/$PROJECT/*/*/*/*/.svn`;
99b8077 @eldy Work on debian package
eldy authored
322 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl`;
323 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html`;
324 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/flot/jquery.js`;
325 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/flot/jquery.min.js`;
326 $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jcrop/js/jquery.min.js`;
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
327 $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
328 $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
ab0edf2 @eldy Work on package
eldy authored
329 $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33`;
330 $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-20100919`;
331 $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
332 $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/free*.ctg.z`;
333 $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/free*.z`;
334 # Removed because not stable yet
335 $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/bureau2crea`;
12a247e @eldy Fix: Packager errors
eldy authored
336 }
805f404 @eldy Update version
eldy authored
337
338 # Build package for each target
339 #------------------------------
1e911de @eldy Work on rpm package
eldy authored
340 foreach my $target (keys %CHOOSEDTARGET)
341 {
805f404 @eldy Update version
eldy authored
342 if ($CHOOSEDTARGET{$target} < 0) { next; }
343
344 print "\nBuild package for target $target\n";
53edbfd @eldy makepack can build snapshot
eldy authored
345
12a247e @eldy Fix: Packager errors
eldy authored
346 if ($target eq 'SNAPSHOT') {
ab0edf2 @eldy Work on package
eldy authored
347 $NEWDESTI=$DESTI;
348
a3a0eab @eldy Work on rpm package
eldy authored
349 print "Remove target $FILENAMESNAPSHOT.tgz...\n";
ab0edf2 @eldy Work on package
eldy authored
350 unlink("$NEWDESTI/$FILENAMESNAPSHOT.tgz");
a3a0eab @eldy Work on rpm package
eldy authored
351
cd5f04e @eldy Packager can now build different packages into one launch.
eldy authored
352 #rmdir "$BUILDROOT/$FILENAMESNAPSHOT";
353 $ret=`rm -fr $BUILDROOT/$FILENAMESNAPSHOT`;
354 print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMESNAPSHOT\n";
1e911de @eldy Work on rpm package
eldy authored
355 $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMESNAPSHOT\"";
356 $ret=`$cmd`;
357
12a247e @eldy Fix: Packager errors
eldy authored
358 print "Compress $BUILDROOT into $FILENAMESNAPSHOT.tgz...\n";
359 #$cmd="tar --exclude \"$BUILDROOT/tgz/tar_exclude.txt\" --exclude .cache --exclude .settings --exclude conf.php --directory \"$BUILDROOT\" -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
360 $cmd="tar --exclude doli*.tgz --exclude doli*.deb --exclude doli*.exe --exclude doli*.zip --exclude doli*.rpm --exclude .cache --exclude .settings --exclude conf.php --exclude conf.php.mysql --exclude conf.php.old --exclude conf.php.postgres --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
361 print $cmd."\n";
362 $ret=`$cmd`;
ab0edf2 @eldy Work on package
eldy authored
363
364 # Move to final dir
365 print "Move $FILENAMESNAPSHOT.tgz to $NEWDESTI/$FILENAMESNAPSHOT.tgz\n";
366 $ret=`mv "$FILENAMESNAPSHOT.tgz" "$NEWDESTI/$FILENAMESNAPSHOT.tgz"`;
12a247e @eldy Fix: Packager errors
eldy authored
367 next;
368 }
369
370 if ($target eq 'TGZ') {
ab0edf2 @eldy Work on package
eldy authored
371 $NEWDESTI=$DESTI;
372 if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
373
a3a0eab @eldy Work on rpm package
eldy authored
374 print "Remove target $FILENAMETGZ.tgz...\n";
ab0edf2 @eldy Work on package
eldy authored
375 unlink("$NEWDESTI/$FILENAMETGZ.tgz");
a3a0eab @eldy Work on rpm package
eldy authored
376
cd5f04e @eldy Packager can now build different packages into one launch.
eldy authored
377 #rmdir "$BUILDROOT/$FILENAMETGZ";
378 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ`;
379 print "Copy $BUILDROOT/$PROJECT/ to $BUILDROOT/$FILENAMETGZ\n";
3177e3b @eldy Packager can now build different packages into one launch.
eldy authored
380 $cmd="cp -pr \"$BUILDROOT/$PROJECT/\" \"$BUILDROOT/$FILENAMETGZ\"";
1e911de @eldy Work on rpm package
eldy authored
381 $ret=`$cmd`;
382
5f043b7 @eldy New: Can overwrite path to pclzip
eldy authored
383 $ret=`rm -fr $BUILDROOT/$PROJECT/build/exe`;
384
12a247e @eldy Fix: Packager errors
eldy authored
385 print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
ab0edf2 @eldy Work on package
eldy authored
386 $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMETGZ.tgz\" $FILENAMETGZ";
12a247e @eldy Fix: Packager errors
eldy authored
387 $ret=`$cmd`;
ab0edf2 @eldy Work on package
eldy authored
388
389 # Move to final dir
390 print "Move $FILENAMETGZ.tgz to $NEWDESTI/$FILENAMETGZ.tgz\n";
391 $ret=`mv "$FILENAMETGZ.tgz" "$NEWDESTI/$FILENAMETGZ.tgz"`;
12a247e @eldy Fix: Packager errors
eldy authored
392 next;
393 }
394
395 if ($target eq 'ZIP') {
ab0edf2 @eldy Work on package
eldy authored
396 $NEWDESTI=$DESTI;
397 if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
398
a3a0eab @eldy Work on rpm package
eldy authored
399 print "Remove target $FILENAMEZIP.zip...\n";
ab0edf2 @eldy Work on package
eldy authored
400 unlink("$NEWDESTI/$FILENAMEZIP.zip");
a3a0eab @eldy Work on rpm package
eldy authored
401
cd5f04e @eldy Packager can now build different packages into one launch.
eldy authored
402 #rmdir "$BUILDROOT/$FILENAMEZIP";
403 $ret=`rm -fr $BUILDROOT/$FILENAMEZIP`;
404 print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMEZIP\n";
1e911de @eldy Work on rpm package
eldy authored
405 $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMEZIP\"";
406 $ret=`$cmd`;
407
12a247e @eldy Fix: Packager errors
eldy authored
408 print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n";
88a6f50 @eldy Update package scripts
eldy authored
409
3286161 @eldy Fix: Package build
eldy authored
410 print "Go to directory $BUILDROOT\n";
12a247e @eldy Fix: Packager errors
eldy authored
411 $olddir=getcwd();
412 chdir("$BUILDROOT");
413 $cmd= "7z a -r -tzip -xr\@\"$BUILDROOT\/$FILENAMEZIP\/build\/zip\/zip_exclude.txt\" -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMEZIP\\*";
414 print $cmd."\n";
415 $ret= `$cmd`;
3286161 @eldy Fix: Package build
eldy authored
416 chdir("$olddir");
12a247e @eldy Fix: Packager errors
eldy authored
417
ab0edf2 @eldy Work on package
eldy authored
418 # Move to final dir
419 print "Move $FILENAMEZIP.zip to $NEWDESTI/$FILENAMEZIP.zip\n";
420 $ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$NEWDESTI/$FILENAMEZIP.zip"`;
12a247e @eldy Fix: Packager errors
eldy authored
421 next;
422 }
805f404 @eldy Update version
eldy authored
423
21b10bf @eldy Work on rpm package
eldy authored
424 if ($target =~ /RPM/) { # Linux only
ab0edf2 @eldy Work on package
eldy authored
425 $NEWDESTI=$DESTI;
426 $subdir="package_rpm_generic";
3966d48 @eldy Work on package
eldy authored
427 if ($target =~ /FEDO/i) { $subdir="package_rpm_redhat-fedora"; }
ab0edf2 @eldy Work on package
eldy authored
428 if ($target =~ /MAND/i) { $subdir="package_rpm_mandriva"; }
429 if ($target =~ /OPEN/i) { $subdir="package_rpm_opensuse"; }
430 if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; }
431
db61e9a @eldy Work on 3.1 packaging
eldy authored
432 $ARCH='noarch';
a3a0eab @eldy Work on rpm package
eldy authored
433 if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; }
1e911de @eldy Work on rpm package
eldy authored
434 $newbuild = $BUILD;
cbff0a7 @eldy Work on 3.1 packaging
eldy authored
435 # For fedora
436 $newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev
437 $newbuild =~ s/beta/0.2.beta1/gi; # beta
438 $newbuild =~ s/rc./0.3.rc1/gi; # rc
1e911de @eldy Work on rpm package
eldy authored
439 if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
cbff0a7 @eldy Work on 3.1 packaging
eldy authored
440 #$newbuild =~ s/(dev|alpha)/0/gi; # dev
441 #$newbuild =~ s/beta/1/gi; # beta
442 #$newbuild =~ s/rc./2/gi; # rc
443 #if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
1e911de @eldy Work on rpm package
eldy authored
444 $REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
a3a0eab @eldy Work on rpm package
eldy authored
445 if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
0666287 @eldy Work on APS package
eldy authored
446 print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
447
1e911de @eldy Work on rpm package
eldy authored
448 $FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1";
12a247e @eldy Fix: Packager errors
eldy authored
449
a3a0eab @eldy Work on rpm package
eldy authored
450 print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm...\n";
ab0edf2 @eldy Work on package
eldy authored
451 unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm");
452 print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n";
453 unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm");
a3a0eab @eldy Work on rpm package
eldy authored
454
cd5f04e @eldy Packager can now build different packages into one launch.
eldy authored
455 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`;
9c5b5a4 @eldy Work on rpm package
eldy authored
456 print "Create directory $BUILDROOT/$FILENAMETGZ2/usr/share\n";
457 $ret=`mkdir -p "$BUILDROOT/$FILENAMETGZ2/usr/share"`;
458 print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT\n";
459 $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT\"";
1e911de @eldy Work on rpm package
eldy authored
460 $ret=`$cmd`;
ab0edf2 @eldy Work on package
eldy authored
461
462 print "Fix filefunc.inc.php, install/inc.php, support/inc.php\n";
463 $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/filefunc.inc.php\" |
464 sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
465 sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
466 sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/filefunc.inc.php\"";
467 $ret=`$cmd`;
468 $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/install/inc.php\" |
469 sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
470 sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
471 sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/install/inc.php\"";
472 $ret=`$cmd`;
473 $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/support/inc.php\" |
474 sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
475 sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
476 sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/support/inc.php\"";
477 $ret=`$cmd`;
478
1e911de @eldy Work on rpm package
eldy authored
479 print "Remove other files\n";
9c5b5a4 @eldy Work on rpm package
eldy authored
480 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/ChangeLog`;
481 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/COPYING`;
482 #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/COPYRIGHT`;
483 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/INSTALL`;
484 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/README`;
485 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/README-FR`;
486 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/README`;
487 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/README-FR`;
488 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/aps`;
489 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/deb`;
490 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/dmg`;
491 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/pad/README`;
492 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/tgz/README`;
493 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/deb/README`;
494 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/doap`;
495 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/exe`;
496 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/live`;
497 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/patch`;
7ed952f @eldy Work on rpm package
eldy authored
498 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/rpm/conf.php`;
9c5b5a4 @eldy Work on rpm package
eldy authored
499 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/zip`;
500 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/perl`;
501 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/cashdesk/include/jscalendar/doc/html/CVS`;
502 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/cashdesk/include/jscalendar/skins/aqua/CVS`;
503 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/ckeditor/plugins/*/dialogs/CVS`;
504 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/ckeditor/plugins/*/images/CVS`;
505 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
506 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/odtphp/zip/.svn`;
507 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/odtphp/zip/pclzip/.svn`;
508 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/odtphp/zip/pclzip/gnu-lgpl.txt`;
509
510 $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/COPYING`;
511 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/barcode/php-barcode/genbarcode`;
d4d4304 @eldy Work on 3.1 packaging
eldy authored
512 # To remove once stable
9c5b5a4 @eldy Work on rpm package
eldy authored
513 $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/htdocs/theme/bureau2crea`;
d4d4304 @eldy Work on 3.1 packaging
eldy authored
514
3966d48 @eldy Work on package
eldy authored
515 # Conf files
99b8077 @eldy Work on debian package
eldy authored
516 print "Copy apache.conf file into $BUILDROOT/$FILENAMETGZ2/etc/$PROJECT/httpd-dolibarr.conf\n";
517 $ret=`mkdir -p "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT"`;
518 $ret=`cp "$SOURCE/build/rpm/httpd-dolibarr.conf" "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT/apache.conf"`;
519 $ret=`cp "$SOURCE/build/rpm/file_contexts.dolibarr" "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT/file_contexts.dolibarr"`;
21b10bf @eldy Work on rpm package
eldy authored
520 $ret=`cp "$SOURCE/build/rpm/conf.php" "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT/conf.php"`;
521 $ret=`cp "$SOURCE/build/rpm/install.forced.php.install" "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT/install.forced.php"`;
d4d4304 @eldy Work on 3.1 packaging
eldy authored
522
523 # Set owners
524 print "Set owners on files/dir\n";
525 $ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
1e911de @eldy Work on rpm package
eldy authored
526
d4d4304 @eldy Work on 3.1 packaging
eldy authored
527 print "Set permissions on files/dir\n";
528 $ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`;
529 $cmd="find $BUILDROOT/$FILENAMETGZ2 -type f -exec chmod 644 {} \\; ";
530 $ret=`$cmd`;
9c5b5a4 @eldy Work on rpm package
eldy authored
531 $cmd="find $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build -name '*.php' -type f -exec chmod 755 {} \\; ";
d4d4304 @eldy Work on 3.1 packaging
eldy authored
532 $ret=`$cmd`;
9c5b5a4 @eldy Work on rpm package
eldy authored
533 $cmd="find $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build -name '*.pl' -type f -exec chmod 755 {} \\; ";
d4d4304 @eldy Work on 3.1 packaging
eldy authored
534 $ret=`$cmd`;
9c5b5a4 @eldy Work on rpm package
eldy authored
535 $cmd="find $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/dev -name '*.php' -type f -exec chmod 755 {} \\; ";
d4d4304 @eldy Work on 3.1 packaging
eldy authored
536 $ret=`$cmd`;
9c5b5a4 @eldy Work on rpm package
eldy authored
537 $ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/dev/translation/langAutoParser.class.php`;
538 $ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/dev/skeletons/skeleton_page.php`;
539 $ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/dev/skeletons/modMyModule.class.php`;
540 $ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/dev/skeletons/skeleton_class.class.php`;
541 $cmd="find $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/scripts -name '*.php' -type f -exec chmod 755 {} \\; ";
d4d4304 @eldy Work on 3.1 packaging
eldy authored
542 $ret=`$cmd`;
9c5b5a4 @eldy Work on rpm package
eldy authored
543 $cmd="find $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/geoip -name 'sample*.php' -type f -exec chmod 755 {} \\; ";
d4d4304 @eldy Work on 3.1 packaging
eldy authored
544 $ret=`$cmd`;
9c5b5a4 @eldy Work on rpm package
eldy authored
545 $cmd="find $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts -name '*.pl' -type f -exec chmod 755 {} \\; ";
d4d4304 @eldy Work on 3.1 packaging
eldy authored
546 $ret=`$cmd`;
547
548 # Build tgz
1e911de @eldy Work on rpm package
eldy authored
549 print "Compress $FILENAMETGZ2 into $FILENAMETGZ2.tgz...\n";
550 $ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ2.tgz" $FILENAMETGZ2`;
551
552 print "Move $FILENAMETGZ2.tgz to $RPMDIR/SOURCES/$FILENAMETGZ2.tgz\n";
553 rename("$BUILDROOT/$FILENAMETGZ2.tgz","$RPMDIR/SOURCES/$FILENAMETGZ2.tgz");
805f404 @eldy Update version
eldy authored
554 $ret=`$cmd`;
555
21b10bf @eldy Work on rpm package
eldy authored
556 $BUILDFIC="${FILENAME}.spec";
557 $BUILDFICSRC="${FILENAME}_generic.spec";
558 if ($target =~ /FEDO/i) { $BUILDFICSRC="${FILENAME}_fedora.spec"; }
559 if ($target =~ /MAND/i) { $BUILDFICSRC="${FILENAME}_mandriva.spec"; }
560 if ($target =~ /OPEN/i) { $BUILDFICSRC="${FILENAME}_opensuse.spec"; }
561
12a247e @eldy Fix: Packager errors
eldy authored
562 print "Generate file $BUILDROOT/$BUILDFIC\n";
21b10bf @eldy Work on rpm package
eldy authored
563 open (SPECFROM,"<$SOURCE/build/rpm/${BUILDFICSRC}") || die "Error";
805f404 @eldy Update version
eldy authored
564 open (SPECTO,">$BUILDROOT/$BUILDFIC") || die "Error";
565 while (<SPECFROM>) {
1e911de @eldy Work on rpm package
eldy authored
566 $_ =~ s/__FILENAMETGZ__/$FILENAMETGZ/;
567 $_ =~ s/__VERSION__/$MAJOR.$MINOR.$REL1/;
568 $_ =~ s/__RELEASE__/$RPMSUBVERSION/;
805f404 @eldy Update version
eldy authored
569 print SPECTO $_;
570 }
571 close SPECFROM;
572 close SPECTO;
573
1e911de @eldy Work on rpm package
eldy authored
574 print "Launch RPM build (rpmbuild --clean -ba $BUILDROOT/${BUILDFIC})\n";
a3a0eab @eldy Work on rpm package
eldy authored
575 #$ret=`rpmbuild -vvvv --clean -ba $BUILDROOT/${BUILDFIC}`;
576 $ret=`rpmbuild --clean -ba $BUILDROOT/${BUILDFIC}`;
12a247e @eldy Fix: Packager errors
eldy authored
577
ab0edf2 @eldy Work on package
eldy authored
578 # Move to final dir
579 print "Move $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\n";
580 $cmd="mv \"$RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\" \"$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\"";
58d40c6 @eldy Packager can now build different packages into one launch.
eldy authored
581 $ret=`$cmd`;
ab0edf2 @eldy Work on package
eldy authored
582 print "Move $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\n";
583 $cmd="mv \"$RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\" \"$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\"";
db61e9a @eldy Work on 3.1 packaging
eldy authored
584 $ret=`$cmd`;
d2fd176 @eldy Work on package
eldy authored
585 print "Move $RPMDIR/SOURCES/".$FILENAMETGZ2.".tgz into $NEWDESTI/".$FILENAMETGZ2.".tgz\n";
586 $cmd="mv \"$RPMDIR/SOURCES/".$FILENAMETGZ2.".tgz\" \"$NEWDESTI/".$FILENAMETGZ2.".tgz\"";
587 $ret=`$cmd`;
12a247e @eldy Fix: Packager errors
eldy authored
588 next;
589 }
99b8077 @eldy Work on debian package
eldy authored
590
477cd46 @eldy Enhance debian package
eldy authored
591 if ($target eq 'DEB')
592 {
ab0edf2 @eldy Work on package
eldy authored
593 $NEWDESTI=$DESTI;
594 if (-d $DESTI.'/package_debian-ubuntu') { $NEWDESTI=$DESTI.'/package_debian-ubuntu'; }
595
efb60ab @eldy Work on debian package
eldy authored
596 $olddir=getcwd();
597
0666287 @eldy Work on APS package
eldy authored
598 $newbuild = $BUILD;
d85e39d @eldy Prepare packaging for debian
eldy authored
599 $newbuild =~ s/(dev|alpha)/1/gi; # dev
600 $newbuild =~ s/beta/2/gi; # beta
601 $newbuild =~ s/rc./3/gi; # rc
602 if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale
603 # now newbuild is 0-1 or 0-4 for example
0666287 @eldy Work on APS package
eldy authored
604 print "Version is $MAJOR.$MINOR.$newbuild\n";
fa56834 @eldy Work on debian package
eldy authored
605 $build = $newbuild;
606 $build =~ s/-.*$//g;
607 # now build is 0 for example
608
32597f0 @eldy Fix: Remove sql
eldy authored
609 print "Remove target ${FILENAMEDEB}_all.deb...\n";
ab0edf2 @eldy Work on package
eldy authored
610 unlink("$NEWDESTI/${FILENAMEDEB}_all.deb");
611 print "Remove target ${FILENAMEDEB}.dsc...\n";
612 unlink("$NEWDESTI/${FILENAMEDEB}.dsc");
613 print "Remove target ${FILENAMEDEB}.tar.gz...\n";
614 unlink("$NEWDESTI/${FILENAMEDEB}.tar.gz");
615 print "Remove target ${FILENAMEDEB}.changes...\n";
616 unlink("$NEWDESTI/${FILENAMEDEB}.changes");
477cd46 @eldy Enhance debian package
eldy authored
617
cd5f04e @eldy Packager can now build different packages into one launch.
eldy authored
618 #rmdir "$BUILDROOT/$PROJECT.tmp";
619 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp`;
55dfc1e @eldy Work on package
eldy authored
620 $ret=`rm -fr $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build`;
621
1e911de @eldy Work on rpm package
eldy authored
622 print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share\n";
623 $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share"`;
624 print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n";
625 $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\"";
3286161 @eldy Fix: Package build
eldy authored
626 $ret=`$cmd`;
b545344 @eldy Work on packages
eldy authored
627
ab0edf2 @eldy Work on package
eldy authored
628 print "Fix filefunc.inc.php, install/inc.php, support/inc.php\n";
629 $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/filefunc.inc.php\" |
630 sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
631 sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
632 sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/filefunc.inc.php\"";
633 $ret=`$cmd`;
634 $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/install/inc.php\" |
635 sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
636 sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
637 sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/install/inc.php\"";
638 $ret=`$cmd`;
639 $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/support/inc.php\" |
640 sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
641 sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
642 sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/support/inc.php\"";
643 $ret=`$cmd`;
644
b545344 @eldy Work on packages
eldy authored
645 # Create DEBIAN directory
1e911de @eldy Work on rpm package
eldy authored
646 print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n";
647 $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`;
b545344 @eldy Work on packages
eldy authored
648 print "Copy $SOURCE/build/deb/xxx to $BUILDROOT/$PROJECT.tmp/DEBIAN\n";
649 $ret=`cp -f "$SOURCE/build/deb/config" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`;
650 $ret=`cp -f "$SOURCE/build/deb/postinst" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`;
651 $ret=`cp -f "$SOURCE/build/deb/postrm" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`;
652 $ret=`cp -f "$SOURCE/build/deb/templates" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`;
fa56834 @eldy Work on debian package
eldy authored
653 $ret=`cp -fr "$SOURCE/build/deb/po" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`;
fb54333 @eldy Work on debian package
eldy authored
654 $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/DEBIAN/po/CVS*"`;
655
b545344 @eldy Work on packages
eldy authored
656 print "Edit version in file $BUILDROOT/$PROJECT.tmp/DEBIAN/control\n";
99b8077 @eldy Work on debian package
eldy authored
657 open (SPECFROM,"<$SOURCE/build/deb/control.debianbin") || die "Error";
b545344 @eldy Work on packages
eldy authored
658 open (SPECTO,">$BUILDROOT/$PROJECT.tmp/DEBIAN/control") || die "Error";
659 while (<SPECFROM>) {
660 $_ =~ s/__VERSION__/$MAJOR.$MINOR.$newbuild/;
661 print SPECTO $_;
662 }
663 close SPECFROM;
664 close SPECTO;
665 print "Version set to $MAJOR.$MINOR.$newbuild\n";
666
12a247e @eldy Fix: Packager errors
eldy authored
667 print "Remove other files\n";
6285ba0 @eldy Work on rpm package
eldy authored
668 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog`;
669 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/COPYING`;
cacd890 @eldy Work on 3.1 packaging
eldy authored
670 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/COPYRIGHT`;
671 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/INSTALL`;
672 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README`;
673 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README-FR`;
674 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/README`;
675 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/README-FR`;
477cd46 @eldy Enhance debian package
eldy authored
676 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/aps`;
5b4170c @eldy Work on aps package
eldy authored
677 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/dmg`;
cacd890 @eldy Work on 3.1 packaging
eldy authored
678 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/pad/README`;
679 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/tgz/README`;
680 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/README`;
681 #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb`;
fa56834 @eldy Work on debian package
eldy authored
682 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/po`;
683 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/changelog`;
684 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/compat`;
477cd46 @eldy Enhance debian package
eldy authored
685 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/config`;
b545344 @eldy Work on packages
eldy authored
686 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/control.*`;
fa56834 @eldy Work on debian package
eldy authored
687 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/copyright`;
cacd890 @eldy Work on 3.1 packaging
eldy authored
688 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/dolibarr.desktop`;
fa56834 @eldy Work on debian package
eldy authored
689 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/dolibarr.menu`;
cacd890 @eldy Work on 3.1 packaging
eldy authored
690 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/format`;
fa56834 @eldy Work on debian package
eldy authored
691 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/install`;
692 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/menu`;
477cd46 @eldy Enhance debian package
eldy authored
693 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/postrm`;
fa56834 @eldy Work on debian package
eldy authored
694 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/postinst`;
f42c6a2 @eldy Work on debian package
eldy authored
695 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/rules`;
cacd890 @eldy Work on 3.1 packaging
eldy authored
696 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/README.debian`;
fa56834 @eldy Work on debian package
eldy authored
697 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/templates`;
698 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/templates.futur`;
699 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/wash`;
700 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/doap`;
701 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/exe`;
702 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/live`;
703 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/patch`;
5b4170c @eldy Work on aps package
eldy authored
704 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/perl`;
fa56834 @eldy Work on debian package
eldy authored
705 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/rpm`;
706 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/zip`;
37da6ef @eldy Clean code to remove a lot of quality test errors
eldy authored
707 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/cashdesk/include/jscalendar/doc/html/CVS`;
708 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/cashdesk/include/jscalendar/skins/aqua/CVS`;
709 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/ckeditor/plugins/*/dialogs/CVS`;
710 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/ckeditor/plugins/*/images/CVS`;
477cd46 @eldy Enhance debian package
eldy authored
711 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
37da6ef @eldy Clean code to remove a lot of quality test errors
eldy authored
712 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/odtphp/zip/.svn`;
713 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/odtphp/zip/pclzip/.svn`;
efb60ab @eldy Work on debian package
eldy authored
714 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/fckeditor/license.txt`;
715 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/jquery/plugins/flot/LICENSE.txt`;
716 $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
8ac7e99 @eldy Work on rpm package
eldy authored
717 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/barcode/php-barcode/genbarcode`;
e5b7038 @eldy Prepare 3.0 package
eldy authored
718 # To remove once stable
1e911de @eldy Work on rpm package
eldy authored
719 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/htdocs/theme/bureau2crea`;
f4db921 @eldy Enhance deb packager
eldy authored
720
efb60ab @eldy Work on debian package
eldy authored
721 # Apache and lighttpd conf files
fa56834 @eldy Work on debian package
eldy authored
722 print "Copy apache.conf file into $BUILDROOT/$PROJECT.tmp/etc/$PROJECT/apache.conf\n";
723 $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/etc/$PROJECT"`;
724 $ret=`cp "$SOURCE/build/deb/apache.conf" "$BUILDROOT/$PROJECT.tmp/etc/$PROJECT/apache.conf"`;
efb60ab @eldy Work on debian package
eldy authored
725 print "Copy lighttpd.conf file into $BUILDROOT/$PROJECT.tmp/etc/$PROJECT/lighttpd.conf\n";
726 $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/etc/$PROJECT"`;
727 $ret=`cp "$SOURCE/build/deb/lighttpd.conf" "$BUILDROOT/$PROJECT.tmp/etc/$PROJECT/lighttpd.conf"`;
2d5bcc2 @eldy Work on debian package
eldy authored
728
477cd46 @eldy Enhance debian package
eldy authored
729 # dolibarr.desktop
1e911de @eldy Work on rpm package
eldy authored
730 print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/applications\n";
731 $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`;
732 print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n";
733 $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`;
d85e39d @eldy Prepare packaging for debian
eldy authored
734
477cd46 @eldy Enhance debian package
eldy authored
735 # pixmap
1e911de @eldy Work on rpm package
eldy authored
736 print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n";
737 $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`;
738 print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n";
739 $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`;
3286161 @eldy Fix: Package build
eldy authored
740
d85e39d @eldy Prepare packaging for debian
eldy authored
741 print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n";
742 $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`;
743
6285ba0 @eldy Work on rpm package
eldy authored
744 # changelog (to build binary package directly without sources. Useless if we build from sources)
745 $ret=`gzip -9 -c "$SOURCE/build/deb/changelog" > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.gz`;
746
d4d4304 @eldy Work on 3.1 packaging
eldy authored
747 # Set owners
1f42fcb @eldy Qual: A lot of fixes to enhance package quality
eldy authored
748 print "Set owners on files/dir\n";
1e911de @eldy Work on rpm package
eldy authored
749 $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
1f42fcb @eldy Qual: A lot of fixes to enhance package quality
eldy authored
750
751 print "Set permissions on files/dir\n";
752 $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`;
753 $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; ";
754 $ret=`$cmd`;
755 $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; ";
756 $ret=`$cmd`;
d85e39d @eldy Prepare packaging for debian
eldy authored
757 $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`;
758 $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`;
477cd46 @eldy Enhance debian package
eldy authored
759 $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name '*.php' -type f -exec chmod 755 {} \\; ";
760 $ret=`$cmd`;
761 $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name '*.pl' -type f -exec chmod 755 {} \\; ";
762 $ret=`$cmd`;
763 $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name '*.php' -type f -exec chmod 755 {} \\; ";
764 $ret=`$cmd`;
765 $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/translation/langAutoParser.class.php`;
766 $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/skeletons/skeleton_page.php`;
767 $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/skeletons/modMyModule.class.php`;
768 $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/skeletons/skeleton_class.class.php`;
769 $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name '*.php' -type f -exec chmod 755 {} \\; ";
1f42fcb @eldy Qual: A lot of fixes to enhance package quality
eldy authored
770 $ret=`$cmd`;
477cd46 @eldy Enhance debian package
eldy authored
771 $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/geoip -name 'sample*.php' -type f -exec chmod 755 {} \\; ";
1f42fcb @eldy Qual: A lot of fixes to enhance package quality
eldy authored
772 $ret=`$cmd`;
477cd46 @eldy Enhance debian package
eldy authored
773 $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts -name '*.pl' -type f -exec chmod 755 {} \\; ";
1f42fcb @eldy Qual: A lot of fixes to enhance package quality
eldy authored
774 $ret=`$cmd`;
d85e39d @eldy Prepare packaging for debian
eldy authored
775
efb60ab @eldy Work on debian package
eldy authored
776 # Creation of binary package (to build without sources)
777 #print "Go to directory $BUILDROOT\n";
778 #chdir("$BUILDROOT");
fa56834 @eldy Work on debian package
eldy authored
779 #$cmd="dpkg -b $BUILDROOT/$PROJECT.tmp $BUILDROOT/${FILENAMEDEB}_all.deb";
780 #print "Launch DEB build ($cmd)\n";
781 #$ret=`$cmd`;
782 #print $ret."\n";
b545344 @eldy Work on packages
eldy authored
783
efb60ab @eldy Work on debian package
eldy authored
784 # Prepare source package
b545344 @eldy Work on packages
eldy authored
785 print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n";
786 $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`;
d9fdcfe @eldy Work on debian package
eldy authored
787 $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian/source"`;
b545344 @eldy Work on packages
eldy authored
788 $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/DEBIAN"`;
fa56834 @eldy Work on debian package
eldy authored
789 $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc"`;
b545344 @eldy Work on packages
eldy authored
790 print "Copy $SOURCE/build/deb/xxx to $BUILDROOT/$PROJECT.tmp/debian\n";
fa56834 @eldy Work on debian package
eldy authored
791 # Add files for dpkg-source
cacd890 @eldy Work on 3.1 packaging
eldy authored
792 $ret=`cp -f "$SOURCE/ChangeLog" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/UserChangeLog"`;
793 $ret=`cp -f "$SOURCE/build/deb/README.debian" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/README"`;
794 $ret=`cp -f "$SOURCE/build/deb/changelog" "$BUILDROOT/$PROJECT.tmp/debian/changelog"`;
795 $ret=`cp -f "$SOURCE/build/deb/control.debian" "$BUILDROOT/$PROJECT.tmp/debian/control"`;
efb60ab @eldy Work on debian package
eldy authored
796 $ret=`cp -f "$SOURCE/build/deb/dolibarr.lintian-overrides" "$BUILDROOT/$PROJECT.tmp/debian/dolibarr.lintian-overrides"`;
cacd890 @eldy Work on 3.1 packaging
eldy authored
797 $ret=`cp -f "$SOURCE/build/deb/install" "$BUILDROOT/$PROJECT.tmp/debian/install"`;
798 $ret=`cp -f "$SOURCE/build/deb/rules" "$BUILDROOT/$PROJECT.tmp/debian/rules"`;
799 $ret=`cp -f "$SOURCE/build/deb/copyright" "$BUILDROOT/$PROJECT.tmp/debian/copyright"`;
800 $ret=`cp -f "$SOURCE/build/deb/compat" "$BUILDROOT/$PROJECT.tmp/debian/compat"`;
801 $ret=`cp -f "$SOURCE/build/deb/format" "$BUILDROOT/$PROJECT.tmp/debian/source/format"`;
802 $ret=`cp -fr "$SOURCE/build/deb/po" "$BUILDROOT/$PROJECT.tmp/debian/po"`;
db61e9a @eldy Work on 3.1 packaging
eldy authored
803 $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/debian/po/CVS"`;
fa56834 @eldy Work on debian package
eldy authored
804 # Add files also required to build binary package with dpkg-buildpackages
cacd890 @eldy Work on 3.1 packaging
eldy authored
805 $ret=`cp -f "$SOURCE/build/deb/config" "$BUILDROOT/$PROJECT.tmp/debian"`;
806 $ret=`cp -f "$SOURCE/build/deb/postinst" "$BUILDROOT/$PROJECT.tmp/debian"`;
807 $ret=`cp -f "$SOURCE/build/deb/postrm" "$BUILDROOT/$PROJECT.tmp/debian"`;
808 $ret=`cp -f "$SOURCE/build/deb/templates" "$BUILDROOT/$PROJECT.tmp/debian"`;
b545344 @eldy Work on packages
eldy authored
809
810 $cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
811 $ret=`$cmd`;
efb60ab @eldy Work on debian package
eldy authored
812
813 # Creation of source package
55dfc1e @eldy Work on package
eldy authored
814 print "Go to directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
fa56834 @eldy Work on debian package
eldy authored
815 chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build");
816 #$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
817 $cmd="dpkg-buildpackage -us -uc";
818 print "Launch DEB build ($cmd)\n";
b545344 @eldy Work on packages
eldy authored
819 $ret=`$cmd`;
820 print $ret."\n";
821
3286161 @eldy Fix: Package build
eldy authored
822 chdir("$olddir");
12a247e @eldy Fix: Packager errors
eldy authored
823
ab0edf2 @eldy Work on package
eldy authored
824 # Move to final dir
825 print "Move *_all.deb to $NEWDESTI\n";
826 $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
827 $ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
828 $ret=`mv $BUILDROOT/*.tar.gz "$NEWDESTI/"`;
829 $ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
12a247e @eldy Fix: Packager errors
eldy authored
830 next;
805f404 @eldy Update version
eldy authored
831 }
832
e28ed80 @eldy Works on APS package
eldy authored
833 if ($target eq 'APS') {
ab0edf2 @eldy Work on package
eldy authored
834 $NEWDESTI=$DESTI;
835 if (-d $DESTI.'/package_aps') { $NEWDESTI=$DESTI.'/package_aps'; }
836
0666287 @eldy Work on APS package
eldy authored
837 $newbuild = $BUILD;
838 $newbuild =~ s/(dev|alpha)/0/gi; # dev
839 $newbuild =~ s/beta/1/gi; # beta
840 $newbuild =~ s/rc./2/gi; # rc
841 if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
842 # now newbuild is 0-0 or 0-3 for example
843 $REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
844 if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
845 print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
846
e28ed80 @eldy Works on APS package
eldy authored
847 print "Remove target $FILENAMEAPS.zip...\n";
ab0edf2 @eldy Work on package
eldy authored
848 unlink "$NEWDESTI/$FILENAMEAPS.zip";
1e911de @eldy Work on rpm package
eldy authored
849
e28ed80 @eldy Works on APS package
eldy authored
850 #rmdir "$BUILDROOT/$PROJECT.tmp";
851 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp`;
852 print "Create directory $BUILDROOT/$PROJECT.tmp\n";
853 $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp"`;
854 print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp\n";
855 $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\"";
856 $ret=`$cmd`;
857
858 print "Remove other files\n";
5b4170c @eldy Work on aps package
eldy authored
859 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/deb`;
860 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/dmg`;
861 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/doap`;
862 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/exe`;
863 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/live`;
864 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/patch`;
865 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/rpm`;
866 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/zip`;
867 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/perl`;
0666287 @eldy Work on APS package
eldy authored
868
869 $APSVERSION="1.1";
870 print "Create APS files $BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml\n";
871 open (SPECFROM,"<$BUILDROOT/$PROJECT/build/aps/APP-META-$APSVERSION.xml") || die "Error";
872 open (SPECTO,">$BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml") || die "Error";
873 while (<SPECFROM>) {
874 $newbuild = $BUILD;
875 $newbuild =~ s/(dev|alpha)/0/gi; # dev
876 $newbuild =~ s/beta/1/gi; # beta
877 $newbuild =~ s/rc./2/gi; # rc
878 if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
879 # now newbuild is 0-0 or 0-3 for example
880 $_ =~ s/__VERSION__/$MAJOR.$MINOR.$REL1/;
881 $_ =~ s/__RELEASE__/$RPMSUBVERSION/;
882 print SPECTO $_;
883 }
884 close SPECFROM;
885 close SPECTO;
886 print "Version set to $MAJOR.$MINOR.$newbuild\n";
a484de3 @eldy Work on packages
eldy authored
887 #$cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure\"";
888 #$ret=`$cmd`;
0666287 @eldy Work on APS package
eldy authored
889 $cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure.php\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure.php\"";
890 $ret=`$cmd`;
e28ed80 @eldy Works on APS package
eldy authored
891 $cmd="cp -pr \"$BUILDROOT/$PROJECT/doc/images\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/images\"";
892 $ret=`$cmd`;
893
0666287 @eldy Work on APS package
eldy authored
894 print "Remove other files\n";
e28ed80 @eldy Works on APS package
eldy authored
895 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev`;
896 $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc`;
897
0666287 @eldy Work on APS package
eldy authored
898 print "Build APP-LIST.xml files\n";
899
e28ed80 @eldy Works on APS package
eldy authored
900 print "Compress $BUILDROOT/$PROJECT.tmp/$PROJECT into $FILENAMEAPS.zip...\n";
901
0666287 @eldy Work on APS package
eldy authored
902 print "Go to directory $BUILDROOT/$PROJECT.tmp\/$PROJECT\n";
e28ed80 @eldy Works on APS package
eldy authored
903 $olddir=getcwd();
0666287 @eldy Work on APS package
eldy authored
904 chdir("$BUILDROOT\/$PROJECT.tmp\/$PROJECT");
905 $cmd= "zip -9 -r $BUILDROOT/$FILENAMEAPS.zip \*";
e28ed80 @eldy Works on APS package
eldy authored
906 print $cmd."\n";
907 $ret= `$cmd`;
908 chdir("$olddir");
909
ab0edf2 @eldy Work on package
eldy authored
910 # Move to final dir
911 print "Move $BUILDROOT/$FILENAMEAPS.zip to $NEWDESTI/$FILENAMEAPS.zip\n";
912 $ret=`mv "$BUILDROOT/$FILENAMEAPS.zip" "$NEWDESTI/$FILENAMEAPS.zip"`;
e28ed80 @eldy Works on APS package
eldy authored
913 next;
12a247e @eldy Fix: Packager errors
eldy authored
914 }
e28ed80 @eldy Works on APS package
eldy authored
915
1e911de @eldy Work on rpm package
eldy authored
916 if ($target eq 'EXEDOLIWAMP')
12a247e @eldy Fix: Packager errors
eldy authored
917 {
ab0edf2 @eldy Work on package
eldy authored
918 $NEWDESTI=$DESTI;
919 if (-d $DESTI.'/package_windows') { $NEWDESTI=$DESTI.'/package_windows'; }
920
1e911de @eldy Work on rpm package
eldy authored
921 print "Remove target $FILENAMEEXEDOLIWAMP.exe...\n";
ab0edf2 @eldy Work on package
eldy authored
922 unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe";
1e911de @eldy Work on rpm package
eldy authored
923
12a247e @eldy Fix: Packager errors
eldy authored
924 print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCE\\build\\exe\\doliwamp\\doliwamp.iss\"\n";
925 $cmd= "iscc.exe \"$SOURCE\\build\\exe\\doliwamp\\doliwamp.iss\"";
926 print "$cmd\n";
927 $ret= `$cmd`;
928 #print "$ret\n";
ab0edf2 @eldy Work on package
eldy authored
929
930 # Move to final dir
931 print "Move \"$SOURCE\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
932 rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe");
12a247e @eldy Fix: Packager errors
eldy authored
933 next;
934 }
805f404 @eldy Update version
eldy authored
935 }
936 }
937
938 print "\n----- Summary -----\n";
939 foreach my $target (keys %CHOOSEDTARGET) {
940 if ($CHOOSEDTARGET{$target} < 0) {
941 print "Package $target not built (bad requirement).\n";
942 } else {
7d48904 @eldy Fix typo
eldy authored
943 print "Package $target built successfully in $DESTI\n";
805f404 @eldy Update version
eldy authored
944 }
945 }
946
016805f @eldy Fxi: Translate country in region list.
eldy authored
947 if (! $batch) {
805f404 @eldy Update version
eldy authored
948 print "\nPress key to finish...";
949 my $WAITKEY=<STDIN>;
950 }
951
952 0;
Something went wrong with that request. Please try again.