Work on APS package

This commit is contained in:
Laurent Destailleur 2011-06-25 19:41:35 +00:00
parent a4ae2ca8b6
commit 066628754c
6 changed files with 597 additions and 185 deletions

121
build/aps/APP-META-1.1.xml Executable file
View File

@ -0,0 +1,121 @@
<!-- Application namespaces and APS version (step 9) -->
<application xmlns="http://apstandard.com/ns/1" version="1.1">
<!-- Application common properties (step 9) -->
<name>Dolibarr</name>
<version>__VERSION__</version>
<release>__RELEASE__</release>
<homepage>http://www.dolibarr.org/</homepage>
<vendor>
<name>Dolibarr</name>
<homepage>http://www.dolibarr.org/</homepage>
<icon path="images/appicon_64.png" />
</vendor>
<packager>
<name>Laurent Destailleur</name>
<homepage>http://www.nltechno.com</homepage>
<uri>uuid:714f0a7b-85d6-4eb8-b68e-40f9acbb3103</uri>
</packager>
<presentation>
<summary>Dolibarr ERP - CRM, the easy to use software to manage small or medium companies, freelancers or foundations</summary>
<description>
Dolibarr is a free modular software (you see only
features you need) to manage small and medium companies, freelancers
or foundations.
This OpenSource software is designed to provide all features you need to
manage information on many aspects of your business
into an intuitive and user-friendly graphical interface
It's an OpenSource software you can install on a web server or as a
standalone software. Dolibarr is designed to provide simplicity to end-user.
</description>
<icon path="images/appicon_64.png" />
<screenshot path="images/dolibarr_screenshot1.png">
<description>Screenshot 1</description>
</screenshot>
<changelog>
<version version="3.1.0" release="0">
<entry>See http://www.dolibarr.org/files/ChangeLog</entry>
</version>
</changelog>
<categories>
<category>Back office/Billing</category>
<category>Back office/Accounting and Financial</category>
<category>Back office/Customer Relationship Management</category>
<category>Back office/Enterprise Resource Planning</category>
</categories>
<languages>
<language>en</language>
<language>fr</language>
<language>es</language>
<language>de</language>
<language>pt</language>
</languages>
</presentation>
<upgrade match="/application/version = '3.0'" />
<!-- Application service (step 4) -->
<service id="dolibarr">
<!-- Service presentation properties (step 7) -->
<license must-accept="true">
<text>
<name>GPLv2</name>
<file>COPYING</file>
</text>
</license>
<presentation>
<name>Dolibarr instance</name>
<summary>Dolibarr services</summary>
<entry-points>
<entry class="frontpage" dst="/">
<label>Application entry point</label>
</entry>
</entry-points>
</presentation>
<!-- Service settings (step 7) -->
<settings>
<group>
<name>Administrator's preferences</name>
<setting id="admin_name" type="string" default-value="admin"
min-length="1" max-length="32" regex="^[a-zA-Z][0-9a-zA-Z_\-]*">
<name>Administrator's login</name>
<error-message>
Please make sure the text you entered starts with a letter and continues with either numbers, letters, underscores or hyphens.
</error-message>
</setting>
<setting id="admin_password" type="password" min-length="1">
<name>Password</name>
</setting>
</group>
</settings>
<!-- Service used technologies (step 6) -->
<requirements xmlns:php="http://apstandard.com/ns/1/php"
xmlns:db="http://apstandard.com/ns/1/db">
<php:version min="4.2.0" />
<php:extension>mysql</php:extension>
<php:extension>mbstring</php:extension>
<php:safe-mode>false</php:safe-mode>
<db:db>
<db:id>main</db:id>
<db:default-name>dolibarr</db:default-name>
<db:can-use-tables-prefix>false</db:can-use-tables-prefix>
<db:server-type>mysql</db:server-type>
<db:server-min-version>4.1.0</db:server-min-version>
</db:db>
</requirements>
<!-- Content delivery settings (step 8) -->
<provision>
<url-mapping>
<default-prefix>dolibarr</default-prefix>
<installed-size>35000000</installed-size>
<mapping url="/" path="htdocs" xmlns:php="http://apstandard.com/ns/1/php">
<php:handler>
<php:extension>php</php:extension>
</php:handler>
</mapping>
</url-mapping>
<!-- Service configuration script declaration (step 10) -->
<configuration-script name="configure.php">
<configuration-script-language>php</configuration-script-language>
<status-control/>
</configuration-script>
</provision>
</service>
</application>

120
build/aps/APP-META-1.2.xml Executable file
View File

@ -0,0 +1,120 @@
<!-- Application namespaces and APS version (step 9) -->
<application xmlns="http://apstandard.com/ns/1" version="1.2">
<!-- Application common properties (step 9) -->
<id>dolibarr</id>
<name>Dolibarr</name>
<version>__VERSION__</version>
<release>__RELEASE__</release>
<homepage>http://www.dolibarr.org/</homepage>
<vendor>
<name>Dolibarr</name>
<homepage>http://www.dolibarr.org/</homepage>
<icon path="images/icon.png" />
</vendor>
<packager>
<name>Laurent Destailleur</name>
<homepage>http://www.nltechno.com</homepage>
<uri>uuid:714f0a7b-85d6-4eb8-b68e-40f9acbb3103</uri>
</packager>
<presentation>
<summary>Dolibarr ERP - CRM, the easy to use software to manage small or medium companies, freelancers or foundations</summary>
<description>
Dolibarr is a free modular software (you see only
features you need) to manage small and medium companies, freelancers
or foundations.
This OpenSource software is designed to provide all features you need to
manage information on many aspects of your business
into an intuitive and user-friendly graphical interface
It's an OpenSource software you can install on a web server or as a
standalone software. Dolibarr is designed to provide simplicity to end-user.
</description>
<icon path="doc/images/appicon_64.png" />
<screenshot path="doc/images/dolibarr_screenshot1.jpg">
<description>Screenshot 1</description>
</screenshot>
<changelog>
<version version="3.1.0" release="0">
<entry>See http://www.dolibarr.org/files/ChangeLog</entry>
</version>
</changelog>
<categories>
<category>Back office/Billing</category>
<category>Back office/Accounting and Financial</category>
<category>Back office/Customer Relationship Management</category>
<category>Back office/Enterprise Resource Planning</category>
</categories>
<languages>
<language>en</language>
<language>fr</language>
<language>es</language>
<language>de</language>
<language>pt</language>
</languages>
</presentation>
<upgrade match="/application/version = '3.0'" />
<!-- Application service (step 4) -->
<service id="dolibarr">
<!-- Service presentation properties (step 7) -->
<license must-accept="true">
<text xml:lang="">
<name>GPLv2</name>
<file>COPYING</file>
</text>
</license>
<presentation>
<name>Dolibarr instance</name>
<entry-points>
<entry class="frontpage" dst="/">
<label>Application entry point</label>
</entry>
</entry-points>
</presentation>
<!-- Service settings (step 7) -->
<settings>
<group>
<name>Administrator's preferences</name>
<setting id="admin_name" type="string" default-value="admin"
min-length="1" max-length="32" regex="^[a-zA-Z][0-9a-zA-Z_\-]*">
<name>Administrator's login</name>
<error-message>
Please make sure the text you entered starts with a letter and continues with either numbers, letters, underscores or hyphens.
</error-message>
</setting>
<setting id="admin_password" type="password" min-length="1">
<name>Password</name>
</setting>
</group>
</settings>
<!-- Service used technologies (step 6) -->
<requirements xmlns:php="http://apstandard.com/ns/1/php"
xmlns:db="http://apstandard.com/ns/1/db">
<php:version min="4.2.0" />
<php:extension>mysql</php:extension>
<php:extension>mbstring</php:extension>
<php:safe-mode>false</php:safe-mode>
<db:db>
<db:id>main</db:id>
<db:default-name>dolibarr</db:default-name>
<db:can-use-tables-prefix>false</db:can-use-tables-prefix>
<db:server-type>mysql</db:server-type>
<db:server-min-version>4.1.0</db:server-min-version>
</db:db>
</requirements>
<!-- Content delivery settings (step 8) -->
<provision>
<url-mapping>
<default-prefix>dolibarr</default-prefix>
<installed-size>35000000</installed-size>
<mapping url="/" path="htdocs" xmlns:php="http://apstandard.com/ns/1/php">
<php:handler>
<php:extension>php</php:extension>
</php:handler>
</mapping>
</url-mapping>
<!-- Service configuration script declaration (step 10) -->
<configuration-script name="configure">
<script-language>php</script-language>
</configuration-script>
</provision>
</service>
</application>

View File

@ -1,119 +1,132 @@
<!-- Application namespaces and APS version (step 9) --> <!-- Application namespaces and APS version (step 9) -->
<application xmlns="http://apstandard.com/ns/1" version="1.2"> <application xmlns="http://apstandard.com/ns/1" version="1.1">
<!-- Application common properties (step 9) --> <!-- Application common properties (step 9) -->
<id>http://www.dolibarr.org/</id> <name>Dolibarr</name>
<name>Dolibarr</name> <version>__VERSION__</version>
<version>__VERSION__</version> <release>__RELEASE__</release>
<release>__RELEASE__</release> <homepage>http://www.dolibarr.org/</homepage>
<homepage>http://www.dolibarr.org/</homepage> <vendor>
<vendor> <name>Dolibarr</name>
<name>Dolibarr</name> <homepage>http://www.dolibarr.org/</homepage>
<homepage>http://www.dolibarr.org/</homepage> <icon path="images/appicon_64.png" />
<icon path="images/icon.png"/> </vendor>
</vendor> <packager>
<packager> <name>Laurent Destailleur</name>
<name>Parallels</name> <homepage>http://www.nltechno.com</homepage>
<homepage>http://parallels.com</homepage> <uri>uuid:714f0a7b-85d6-4eb8-b68e-40f9acbb3103</uri>
<uri>uuid:714f0a7b-85d6-4eb8-b68e-40f9acbb3103</uri> </packager>
</packager> <presentation>
<presentation> <summary>Dolibarr ERP - CRM, the easy to use software to manage small or medium companies, freelancers or foundations</summary>
<summary>Dolibarr ERP - CRM, the easy to use software to manage small or medium companies, freelancers or foundations</summary> <description>
<description> Dolibarr is a free modular software (you see only
Dolibarr is a free modular software (you see only features you need) to manage small and medium companies, freelancers or foundations. features you need) to manage small and medium companies, freelancers
This Opensource software is designed to provide all features you need to manage information on many aspects of your business or foundations.
into an intuitive and user-friendly graphical interface This Opensource software is designed to provide all features you need to
It's an OpenSource software you can install on a web server or as a standalone software. Dolibarr is designed to provide simplicity: manage information on many aspects of your business
* Simple to use (any module can be disabled to removed not required features, only the permissions features can not be disabled). into an intuitive and user-friendly graphical interface
* Simple to install (with DoliWamp the auto-installer for Windows, DoliBuntu, the auto-installer for Ubuntu/Debian or DoliMamp the auto-installer for Mac OS X, for those who do not know how to install an Apache server, MySQL, PHP. A web assistant is available for others, no additional components required, no Java, no Python, no Perl, no PEARL PHP modules, no other exotic library). It's an OpenSource software you can install on a web server or as a
* Simple for development (no heavy frameworks). Dolibarr, developed in PHP object, incorporates its own natural code, allowing every developer to be immediately operational, with no other knowledge than PHP). standalone software. Dolibarr is designed to provide simplicity:
</description> * Simple to use (any module can be disabled to removed not required
<icon path="doc/images/appicon_64.png"/> features, only the permissions features can not be disabled).
<screenshot path="doc/images/dolibarr_screenshot1.jpg"> * Simple to install (with DoliWamp the auto-installer for Windows,
<description>Screenshot 1</description> DoliBuntu, the auto-installer for Ubuntu/Debian or DoliMamp the
</screenshot> auto-installer for Mac OS X, for those who do not know how to install
<changelog> an Apache server, MySQL, PHP. A web assistant is available for
<version version="3.1.0" release="0"> others, no additional components required, no Java, no Python, no
<entry>See http://www.dolibarr.org/files/ChangeLog</entry> Perl, no PEARL PHP modules, no other exotic library).
</version> * Simple for development (no heavy frameworks). Dolibarr, developed in
</changelog> PHP object, incorporates its own natural code, allowing every
<categories> developer to be immediately operational, with no other knowledge than
<category>Back office/Customer Relationship Management</category> PHP).
</categories> </description>
<languages> <icon path="images/appicon_64.png" />
<language>en</language> <screenshot path="images/dolibarr_screenshot1.png">
<language>fr</language> <description>Screenshot 1</description>
<language>es</language> </screenshot>
<language>de</language> <changelog>
<language>pt</language> <version version="3.1.0" release="0">
</languages> <entry>See http://www.dolibarr.org/files/ChangeLog</entry>
</presentation> </version>
<upgrade match="/application/version = '3.0'"/> </changelog>
<!-- Application service (step 4) --> <categories>
<service id="blog"> <category>Back office/Billing</category>
<!-- Service presentation properties (step 7) --> <category>Back office/Accounting and Financial</category>
<license must-accept="true"> <category>Back office/Customer Relationship Management</category>
<text> <category>Back office/Enterprise Resource Planning</category>
<name>GPLv2</name> </categories>
<file>COPYING</file> <languages>
</text> <language>en</language>
</license> <language>fr</language>
<presentation> <language>es</language>
<name>Dolibarr instance</name> <language>de</language>
<entry-points> <language>pt</language>
<entry class="frontpage" dst="/"> </languages>
Application entry point </presentation>
</entry> <upgrade match="/application/version = '3.0'" />
</entry-points> <!-- Application service (step 4) -->
</presentation> <service id="dolibarr">
<!-- Service settings (step 7) --> <!-- Service presentation properties (step 7) -->
<settings> <license must-accept="true">
<group> <text>
<name>Administrator's preferences</name> <name>GPLv2</name>
<setting id="admin_name" type="string" <file>COPYING</file>
default-value="admin" min-length="1" </text>
max-length="32" regex="^[a-zA-Z][0-9a-zA-Z_\-]*"> </license>
<name>Administrator's login</name> <presentation>
<error-message>Please make sure the text you entered <name>Dolibarr instance</name>
starts with a letter and continues with either numbers, <entry-points>
letters, underscores or hyphens.</error-message> <entry class="frontpage" dst="/">
</setting> <label>Application entry point</label>
<setting id="admin_password" </entry>
type="password" min-length="1" > </entry-points>
<name>Password</name> </presentation>
</setting> <!-- Service settings (step 7) -->
</group> <settings>
</settings> <group>
<!-- Service used technologies (step 6) --> <name>Administrator's preferences</name>
<requirements xmlns:php="http://apstandard.com/ns/1/php" <setting id="admin_name" type="string" default-value="admin"
xmlns:db="http://apstandard.com/ns/1/db"> min-length="1" max-length="32" regex="^[a-zA-Z][0-9a-zA-Z_\-]*">
<php:version min="4.2.0"/> <name>Administrator's login</name>
<php:extension>mysql</php:extension> <error-message>
<php:extension>mbstring</php:extension> Please make sure the text you entered starts with a letter and continues with either numbers, letters, underscores or hyphens.
<php:safe-mode>false</php:safe-mode> </error-message>
<db:db> </setting>
<db:id>main</db:id> <setting id="admin_password" type="password" min-length="1">
<db:default-name>dolibarr</db:default-name> <name>Password</name>
<db:can-use-tables-prefix>false</db:can-use-tables-prefix> </setting>
<db:server-type>mysql</db:server-type> </group>
<db:server-min-version>4.1.0</db:server-min-version> </settings>
</db:db> <!-- Service used technologies (step 6) -->
</requirements> <requirements xmlns:php="http://apstandard.com/ns/1/php"
<!-- Content delivery settings (step 8) --> xmlns:db="http://apstandard.com/ns/1/db">
<provision> <php:version min="4.2.0" />
<url-mapping> <php:extension>mysql</php:extension>
<default-prefix>dolibarr</default-prefix> <php:extension>mbstring</php:extension>
<installed-size>35000000</installed-size> <php:safe-mode>false</php:safe-mode>
<mapping url="/" path="htdocs" <db:db>
xmlns:php="http://apstandard.com/ns/1/php"> <db:id>main</db:id>
<php:handler> <db:default-name>dolibarr</db:default-name>
<php:extension>php</php:extension> <db:can-use-tables-prefix>false</db:can-use-tables-prefix>
</php:handler> <db:server-type>mysql</db:server-type>
</mapping> <db:server-min-version>4.1.0</db:server-min-version>
</url-mapping> </db:db>
<!-- Service configuration script declaration (step 10) --> </requirements>
<configuration-script name="configure"> <!-- Content delivery settings (step 8) -->
<script-language>php</script-language> <provision>
</configuration-script> <url-mapping>
</provision> <default-prefix>dolibarr</default-prefix>
</service> <installed-size>35000000</installed-size>
<mapping url="/" path="htdocs" xmlns:php="http://apstandard.com/ns/1/php">
<php:handler>
<php:extension>php</php:extension>
</php:handler>
</mapping>
</url-mapping>
<!-- Service configuration script declaration (step 10) -->
<configuration-script name="configure.php">
<configuration-script-language>php</configuration-script-language>
<status-control/>
</configuration-script>
</provision>
</service>
</application> </application>

20
build/aps/README Executable file
View File

@ -0,0 +1,20 @@
README (English)
##################################################
This directory is dedicated to APS package building
##################################################
Docs for APS format 1.1:
http://www.apsstandard.org/r/doc/aps-format-1.1-packaging-guide/index.htm
Docs for APS format 1.2 (need APP-LIST.xml):
http://www.apsstandard.org/r/doc/aps-format-1.2-packaging-guide/index.htm
To check an APS package on Debian:
* Install libgdiplus with
apt-get install libgdiplus
* Install apslint.exe
tar -xvf xxxx.tgz
* Go into directory of apslint and run command
mono ./apslint.exe '/media/DATA/Mes Developpements/dolibarr/build/dolibarr-3.1.0-dev.app.zip'

120
build/aps/configure.php Executable file
View File

@ -0,0 +1,120 @@
<?php
if(count($_SERVER['argv']) < 2)
{
print "Usage: configure (install | upgrade <version> | configure | remove)\n";
exit(1);
}
$command = $_SERVER['argv'][1];
//$command stores the argument with which the script was invoked.
if($command == "install")
{
$db_id = 'dolibarr';
//The database identifier value is to be substituted by the value
//defined in the application requirements section of the
//metadata file.For details, see the 6.3.1.1. Database requirement
//type section of the Specification.
$query_file = 'schema.sql'; //File containing list of SQL queries.
//List of database-related variables that are passed to the configuration
//script. See the 6.3.1.1.1. Environment variables section of the
//Specification for details.
$db_address = getenv("DB_${db_id}_HOST");
/*if (fetch_env_var("DB_${db_id}_PORT") !== False)
$db_address .= ':' . fetch_env_var("DB_${db_id}_PORT");
*/
$dblogin = getenv("DB_${db_id}_LOGIN");
$dbpassword = getenv("DB_${db_id}_PASSWORD");
$dbname = getenv("DB_${db_id}_NAME");
//PHP functions for connecting to the mysql server and
//executing SQL queries.
mysql_connect($dbaddress, $dblogin, $dbpassword);
mysql_select_db($dbname);
/*
$sql_queries = file($query_file);
foreach ($sql_queries as $query) mysql_query($query);
*/
//Other code to be executed on invoking configure with
//the install argument.
exit(0);
}
if($command == "remove")
{
//Code to be executed on invoking configure with the remove argument
exit(0);
}
if($command == "upgrade")
{
//Code to be executed on invoking configure with the upgrade argument
exit(0);
}
if($command == "configure")
{
//Code to be executed on invoking configure with the configure argument
exit(0);
}
print "Error: unknown command $command.\n";
exit(1);
?>

View File

@ -1,8 +1,8 @@
#!/usr/bin/perl #!/usr/bin/perl
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# \file build/makepack-dolibarr.pl # \file build/makepack-dolibarr.pl
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe) # \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
# \version $Id: makepack-dolibarr.pl,v 1.103 2011/06/24 23:10:52 eldy Exp $ # \version $Id: makepack-dolibarr.pl,v 1.104 2011/06/25 19:41:36 eldy Exp $
# \author (c)2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> # \author (c)2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") {
use vars qw/ $REVISION $VERSION /; use vars qw/ $REVISION $VERSION /;
$REVISION='$Revision: 1.103 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $REVISION='$Revision: 1.104 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1;
$VERSION="1.0 (build $REVISION)"; $VERSION="1.0 (build $REVISION)";
@ -171,14 +171,18 @@ foreach my $target (keys %CHOOSEDTARGET) {
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) { foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) {
# Test # Test
print "Test requirement for target $target: Search '$req'... "; print "Test requirement for target $target: Search '$req'... ";
$ret=`"$req" 2>&1`; $newreq=$req; $newparam='';
if ($newreq eq 'zip') { $newparam.='-h'; }
$cmd="\"$newreq\" $newparam 2>&1";
print "Test command ".$cmd."... ";
$ret=`$cmd`;
$coderetour=$?; $coderetour2=$coderetour>>8; $coderetour=$?; $coderetour2=$coderetour>>8;
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) { if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) {
# Not found error, we try in PROGPATH # Not found error, we try in PROGPATH
$ret=`"$PROGPATH/$ALTERNATEPATH{$req}/$req\" 2>&1`; $ret=`"$PROGPATH/$ALTERNATEPATH{$req}/$req\" 2>&1`;
$coderetour=$?; $coderetour2=$coderetour>>8; $coderetour=$?; $coderetour2=$coderetour>>8;
$REQUIREMENTTARGET{$target}="$PROGPATH/$ALTERNATEPATH{$req}/$req"; $REQUIREMENTTARGET{$target}="$PROGPATH/$ALTERNATEPATH{$req}/$req";
} }
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/))) { if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/))) {
# Not found error # Not found error
@ -240,11 +244,25 @@ if ($nboftargetok) {
$ret=`cp -pr "$SOURCE" "$BUILDROOT/$PROJECT"`; $ret=`cp -pr "$SOURCE" "$BUILDROOT/$PROJECT"`;
} }
print "Clean $BUILDROOT\n"; print "Clean $BUILDROOT\n";
$ret=`rm -f $BUILDROOT/$PROJECT/index.php`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`; $ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`; $ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.settings`; $ret=`rm -fr $BUILDROOT/$PROJECT/.settings`;
$ret=`rm -fr $BUILDROOT/$PROJECT/index.php`;
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`; $ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/DoliWamp-*`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/DoliMamp-*`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tgz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/doxygen/doxygen_warnings.log`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
$ret=`rm -fr $BUILDROOT/$PROJECT/document`; $ret=`rm -fr $BUILDROOT/$PROJECT/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php`;
@ -370,6 +388,8 @@ if ($nboftargetok) {
# now newbuild is 0-0 or 0-3 for example # now newbuild is 0-0 or 0-3 for example
$REL1 = $newbuild; $REL1 =~ s/-.*$//gi; $REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; } if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
$FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1"; $FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1";
print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm...\n"; print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm...\n";
@ -415,6 +435,14 @@ if ($nboftargetok) {
} }
if ($target eq 'DEB') { if ($target eq 'DEB') {
$newbuild = $BUILD;
$newbuild =~ s/(dev|alpha)/0/gi; # dev
$newbuild =~ s/beta/1/gi; # beta
$newbuild =~ s/rc./2/gi; # rc
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
# now newbuild is 0-0 or 0-3 for example
print "Version is $MAJOR.$MINOR.$newbuild\n";
print "Remove target $FILENAMEDEB.deb...\n"; print "Remove target $FILENAMEDEB.deb...\n";
unlink("$DESTI/$FILENAMEDEB.deb"); unlink("$DESTI/$FILENAMEDEB.deb");
@ -433,14 +461,6 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/DEBIAN/CVS`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/DEBIAN/CVS`;
print "Remove other files\n"; print "Remove other files\n";
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/DoliWamp-*`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/DoliMamp-*`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/dolibarr-*.tar`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/dolibarr-*.tgz`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/dolibarr-*.zip`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/dolibarr-*.deb`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/doxygen/doxygen_warnings.log`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/html`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/dbmodel`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/dbmodel`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/fpdf`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/fpdf`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/initdata`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/initdata`;
@ -454,10 +474,6 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/font`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/font`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/tshirt`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/tshirt`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/rollup`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/rollup`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/conf/conf.php.mysql`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/conf/conf.php.old`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/conf/conf.php.postgres`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/conf/conf*sav*`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/test`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/test`;
# To remove once stable # To remove once stable
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/htdocs/theme/bureau2crea`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/htdocs/theme/bureau2crea`;
@ -466,12 +482,6 @@ if ($nboftargetok) {
open (SPECFROM,"<$SOURCE/build/deb/control") || die "Error"; open (SPECFROM,"<$SOURCE/build/deb/control") || die "Error";
open (SPECTO,">$BUILDROOT/$PROJECT.tmp/DEBIAN/control") || die "Error"; open (SPECTO,">$BUILDROOT/$PROJECT.tmp/DEBIAN/control") || die "Error";
while (<SPECFROM>) { while (<SPECFROM>) {
$newbuild = $BUILD;
$newbuild =~ s/(dev|alpha)/0/gi; # dev
$newbuild =~ s/beta/1/gi; # beta
$newbuild =~ s/rc./2/gi; # rc
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
# now newbuild is 0-0 or 0-3 for example
$_ =~ s/__VERSION__/$MAJOR.$MINOR.$newbuild/; $_ =~ s/__VERSION__/$MAJOR.$MINOR.$newbuild/;
print SPECTO $_; print SPECTO $_;
} }
@ -489,21 +499,12 @@ if ($nboftargetok) {
print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n";
$ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`;
#print "Create directory $BUILDROOT/$PROJECT/etc/$PROJECT\n";
#$ret=`mkdir -p "$BUILDROOT/$PROJECT/etc/$PROJECT"`;
#print "Copy changelog file into $BUILDROOT/$PROJECT/DEBIAN\n";
#$ret=`cp "$SOURCE/ChangeLog" "$BUILDROOT/$PROJECT/DEBIAN/changelog"`;
print "Copy README file into $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; print "Copy README file into $BUILDROOT/$PROJECT.tmp/DEBIAN\n";
$ret=`cp "$SOURCE/README" "$BUILDROOT/$PROJECT.tmp/DEBIAN/README"`; $ret=`cp "$SOURCE/README" "$BUILDROOT/$PROJECT.tmp/DEBIAN/README"`;
print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/DEBIAN\n";
$ret=`cp "$SOURCE/COPYRIGHT" "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright"`; $ret=`cp "$SOURCE/COPYRIGHT" "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright"`;
#print "Copy apache conf file into $BUILDROOT/$PROJECT/etc/$PROJECT\n";
#$ret=`cp "$SOURCE/build/deb/apache.conf" "$BUILDROOT/$PROJECT/etc/$PROJECT"`;
print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n";
$ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`;
@ -539,6 +540,16 @@ if ($nboftargetok) {
} }
if ($target eq 'APS') { if ($target eq 'APS') {
$newbuild = $BUILD;
$newbuild =~ s/(dev|alpha)/0/gi; # dev
$newbuild =~ s/beta/1/gi; # beta
$newbuild =~ s/rc./2/gi; # rc
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
# now newbuild is 0-0 or 0-3 for example
$REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
print "Remove target $FILENAMEAPS.zip...\n"; print "Remove target $FILENAMEAPS.zip...\n";
unlink "$DESTI/$FILENAMEAPS.zip"; unlink "$DESTI/$FILENAMEAPS.zip";
@ -551,63 +562,70 @@ if ($nboftargetok) {
$ret=`$cmd`; $ret=`$cmd`;
print "Remove other files\n"; print "Remove other files\n";
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/DoliWamp-*`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/dbmodel`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/DoliMamp-*`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/fpdf`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/dolibarr-*.tar`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/initdata`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/dolibarr-*.tgz`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/iso-normes`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/dolibarr-*.zip`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/phpcheckstyle`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/dolibarr-*.deb`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/phpunit`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/doxygen/doxygen_warnings.log`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/spec`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/html`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/uml`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/dev/dbmodel`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/xdebug`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/dev/fpdf`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc/flyer`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/dev/initdata`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc/font`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/dev/iso-normes`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc/tshirt`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/dev/phpcheckstyle`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc/rollup`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/dev/phpunit`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/dev/spec`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/dev/uml`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/dev/xdebug`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/doc/flyer`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/doc/font`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/doc/tshirt`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/doc/rollup`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/conf/conf.php.mysql`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/conf/conf.php.old`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/conf/conf.php.postgres`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/conf/conf*sav*`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/test`;
print "Create APS files\n"; $APSVERSION="1.1";
$cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/APP-META.xml\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml\""; print "Create APS files $BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml\n";
$ret=`$cmd`; open (SPECFROM,"<$BUILDROOT/$PROJECT/build/aps/APP-META-$APSVERSION.xml") || die "Error";
open (SPECTO,">$BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml") || die "Error";
while (<SPECFROM>) {
$newbuild = $BUILD;
$newbuild =~ s/(dev|alpha)/0/gi; # dev
$newbuild =~ s/beta/1/gi; # beta
$newbuild =~ s/rc./2/gi; # rc
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
# now newbuild is 0-0 or 0-3 for example
$_ =~ s/__VERSION__/$MAJOR.$MINOR.$REL1/;
$_ =~ s/__RELEASE__/$RPMSUBVERSION/;
print SPECTO $_;
}
close SPECFROM;
close SPECTO;
print "Version set to $MAJOR.$MINOR.$newbuild\n";
$cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure\""; $cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure\"";
$ret=`$cmd`; $ret=`$cmd`;
$cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure.php\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure.php\"";
$ret=`$cmd`;
$cmd="cp -pr \"$BUILDROOT/$PROJECT/doc/images\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/images\""; $cmd="cp -pr \"$BUILDROOT/$PROJECT/doc/images\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/images\"";
$ret=`$cmd`; $ret=`$cmd`;
print "Remove other files\n";
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc`;
print "Build APP-LIST.xml files\n";
print "Compress $BUILDROOT/$PROJECT.tmp/$PROJECT into $FILENAMEAPS.zip...\n"; print "Compress $BUILDROOT/$PROJECT.tmp/$PROJECT into $FILENAMEAPS.zip...\n";
print "Go to directory $BUILDROOT/$PROJECT.tmp\n"; print "Go to directory $BUILDROOT/$PROJECT.tmp\/$PROJECT\n";
$olddir=getcwd(); $olddir=getcwd();
chdir("$BUILDROOT\/$PROJECT.tmp"); chdir("$BUILDROOT\/$PROJECT.tmp\/$PROJECT");
#$cmd= "7z a -r -tzip -xr\@\"$BUILDROOT\/$PROJECT.tmp\/$PROJECT\/build\/zip\/zip_exclude.txt\" -mx $BUILDROOT/$FILENAMEAPS.zip $BUILDROOT/$PROJECT.tmp/$PROJECT\\*"; $cmd= "zip -9 -r $BUILDROOT/$FILENAMEAPS.zip \*";
$cmd= "zip -9 -r $BUILDROOT/$FILENAMEAPS.zip $PROJECT\\*";
print $cmd."\n"; print $cmd."\n";
$ret= `$cmd`; $ret= `$cmd`;
chdir("$olddir"); chdir("$olddir");
if ($OS =~ /windows/i) if ($OS =~ /windows/i)
{ {
print "Move $FILENAMEAPS.zip to $DESTI/$FILENAMEAPS.zip\n"; print "Move $BUILDROOT/$FILENAMEAPS.zip to $DESTI/$FILENAMEAPS.zip\n";
$ret=`mv "$BUILDROOT/$FILENAMEAPS.zip" "$DESTI/$FILENAMEAPS.zip"`; $ret=`mv "$BUILDROOT/$FILENAMEAPS.zip" "$DESTI/$FILENAMEAPS.zip"`;
} }
else else
{ {
print "Move $FILENAMEAPS.zip to $DESTI/$FILENAMEAPS.zip\n"; print "Move $BUILDROOT/$FILENAMEAPS.zip to $DESTI/$FILENAMEAPS.zip\n";
$ret=`mv "$BUILDROOT/$FILENAMEAPS.zip" "$DESTI/$FILENAMEAPS.zip"`; $ret=`mv "$BUILDROOT/$FILENAMEAPS.zip" "$DESTI/$FILENAMEAPS.zip"`;
} }
next; next;