Prepare build of modules for 3.0
This commit is contained in:
parent
6f11d1e28e
commit
86801c2e8a
@ -78,23 +78,8 @@ for (0..@ARGV-1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "Makepack module version $VERSION\n";
|
print "Makepack for modules version $VERSION\n";
|
||||||
print "Enter name for your module (mymodule, mywonderfulmondule, ...) : ";
|
|
||||||
$PROJECT=<STDIN>;
|
|
||||||
chomp($PROJECT);
|
|
||||||
print "Move to ".$DIR." directory.\n";
|
|
||||||
chdir($DIR);
|
|
||||||
|
|
||||||
if (! -f "makepack-".$PROJECT.".conf")
|
|
||||||
{
|
|
||||||
print "Error: can't open conf file makepack-".$PROJECT.".conf\n";
|
|
||||||
print "\n";
|
|
||||||
print "For help on building a module package, see web page\n";
|
|
||||||
print "http://wiki.dolibarr.org/index.php/Module_development#Create_a_package_to_distribute_and_install_your_module\n";
|
|
||||||
print "makepack-dolibarrmodule.pl aborted.\n";
|
|
||||||
sleep 2;
|
|
||||||
exit 2;
|
|
||||||
}
|
|
||||||
# Ask and set version $MAJOR and $MINOR
|
# Ask and set version $MAJOR and $MINOR
|
||||||
print "Enter value for version: ";
|
print "Enter value for version: ";
|
||||||
$PROJVERSION=<STDIN>;
|
$PROJVERSION=<STDIN>;
|
||||||
@ -107,6 +92,52 @@ if ($MINOR eq '')
|
|||||||
chomp($MINOR);
|
chomp($MINOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Ask module
|
||||||
|
print "Enter name for your module (mymodule, mywonderfulmondule, ...) : ";
|
||||||
|
$PROJECTINPUT=<STDIN>;
|
||||||
|
chomp($PROJECTINPUT);
|
||||||
|
print "Move to ".$DIR." directory.\n";
|
||||||
|
chdir($DIR);
|
||||||
|
|
||||||
|
$SOURCE="$DIR/..";
|
||||||
|
$DESTI="$SOURCE/build";
|
||||||
|
|
||||||
|
print "Source directory: $SOURCE\n";
|
||||||
|
print "Target directory: $DESTI\n";
|
||||||
|
|
||||||
|
my @PROJECTLIST=();
|
||||||
|
if ($PROJECTINPUT eq "all")
|
||||||
|
{
|
||||||
|
opendir(DIR, $DIR) || return;
|
||||||
|
local @rv = grep { /^makepack\-(.*)\.conf$/ } sort readdir(DIR);
|
||||||
|
closedir(DIR);
|
||||||
|
foreach my $xxx (0..@rv-1) {
|
||||||
|
if ($rv[$xxx] =~ /^makepack\-(.*)\.conf$/)
|
||||||
|
{
|
||||||
|
@PROJECTLIST[$xxx]=$1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@PROJECTLIST=($PROJECTINPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Loop on each projects
|
||||||
|
foreach my $PROJECT (@PROJECTLIST) {
|
||||||
|
|
||||||
|
if (! -f "makepack-".$PROJECT.".conf")
|
||||||
|
{
|
||||||
|
print "Error: can't open conf file makepack-".$PROJECT.".conf\n";
|
||||||
|
print "\n";
|
||||||
|
print "For help on building a module package, see web page\n";
|
||||||
|
print "http://wiki.dolibarr.org/index.php/Module_development#Create_a_package_to_distribute_and_install_your_module\n";
|
||||||
|
print "makepack-dolibarrmodule.pl aborted.\n";
|
||||||
|
sleep 2;
|
||||||
|
exit 2;
|
||||||
|
}
|
||||||
|
|
||||||
$FILENAME="$PROJECT";
|
$FILENAME="$PROJECT";
|
||||||
$FILENAMETGZ="module_$PROJECT-$MAJOR.$MINOR";
|
$FILENAMETGZ="module_$PROJECT-$MAJOR.$MINOR";
|
||||||
$FILENAMEZIP="module_$PROJECT-$MAJOR.$MINOR";
|
$FILENAMEZIP="module_$PROJECT-$MAJOR.$MINOR";
|
||||||
@ -119,12 +150,6 @@ if (-d "/usr/src/RPM") {
|
|||||||
$RPMDIR="/usr/src/RPM";
|
$RPMDIR="/usr/src/RPM";
|
||||||
}
|
}
|
||||||
|
|
||||||
$SOURCE="$DIR/..";
|
|
||||||
$DESTI="$SOURCE/build";
|
|
||||||
|
|
||||||
print "Source directory: $SOURCE\n";
|
|
||||||
print "Target directory: $DESTI\n";
|
|
||||||
|
|
||||||
|
|
||||||
# Choose package targets
|
# Choose package targets
|
||||||
#-----------------------
|
#-----------------------
|
||||||
@ -214,9 +239,12 @@ if ($nboftargetok) {
|
|||||||
$_ =~ /^(.*)\/[^\/]+/;
|
$_ =~ /^(.*)\/[^\/]+/;
|
||||||
print "Create directory $BUILDROOT/$PROJECT/$1\n";
|
print "Create directory $BUILDROOT/$PROJECT/$1\n";
|
||||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT/$1"`;
|
$ret=`mkdir -p "$BUILDROOT/$PROJECT/$1"`;
|
||||||
|
if ($_ !~ /version\-/)
|
||||||
|
{
|
||||||
print "Copy $SOURCE/$_ into $BUILDROOT/$PROJECT/$_\n";
|
print "Copy $SOURCE/$_ into $BUILDROOT/$PROJECT/$_\n";
|
||||||
$ret=`cp -pr "$SOURCE/$_" "$BUILDROOT/$PROJECT/$_"`;
|
$ret=`cp -pr "$SOURCE/$_" "$BUILDROOT/$PROJECT/$_"`;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
close IN;
|
close IN;
|
||||||
|
|
||||||
@timearray=localtime(time());
|
@timearray=localtime(time());
|
||||||
@ -316,6 +344,10 @@ foreach my $target (keys %CHOOSEDTARGET) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (! $batch) {
|
if (! $batch) {
|
||||||
print "\nPress key to finish...";
|
print "\nPress key to finish...";
|
||||||
my $WAITKEY=<STDIN>;
|
my $WAITKEY=<STDIN>;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user