Work on rpm package
This commit is contained in:
parent
57c01f7ae0
commit
7734901fb0
@ -74,14 +74,10 @@ my $copyalreadydone=0;
|
||||
my $batch=0;
|
||||
|
||||
print "Makepack theme version $VERSION\n";
|
||||
print "Enter name of theme(s) to package (separated with space): ";
|
||||
print "Enter name of theme to package: ";
|
||||
$PROJECT=<STDIN>;
|
||||
chomp($PROJECT);
|
||||
|
||||
@PROJECTLIST=split(/ /,$PROJECT);
|
||||
$PROJECT=join('',@PROJECTLIST);
|
||||
|
||||
|
||||
# Ask and set version $MAJOR and $MINOR
|
||||
print "Enter value for version: ";
|
||||
$PROJVERSION=<STDIN>;
|
||||
@ -97,8 +93,6 @@ if ($MINOR eq '')
|
||||
|
||||
$FILENAME="$PROJECT";
|
||||
$FILENAMETGZ="theme_$PROJECT-$MAJOR.$MINOR";
|
||||
$FILENAMEZIP="theme_$PROJECT-$MAJOR.$MINOR";
|
||||
|
||||
if (-d "/usr/src/redhat") {
|
||||
# redhat
|
||||
$RPMDIR="/usr/src/redhat";
|
||||
@ -207,13 +201,11 @@ if ($nboftargetok) {
|
||||
mkdir "$BUILDROOT";
|
||||
mkdir "$BUILDROOT/htdocs";
|
||||
mkdir "$BUILDROOT/htdocs/theme";
|
||||
mkdir "$BUILDROOT/htdocs/theme/$PROJECT";
|
||||
|
||||
print "Copy $SOURCE into $BUILDROOT\n";
|
||||
mkdir "$BUILDROOT";
|
||||
foreach my $tmp (@PROJECTLIST)
|
||||
{
|
||||
$ret=`cp -pr "$SOURCE/htdocs/theme/$tmp" "$BUILDROOT/htdocs/theme"`;
|
||||
}
|
||||
$ret=`cp -pr "$SOURCE/htdocs/theme/$PROJECT" "$BUILDROOT/htdocs/theme"`;
|
||||
}
|
||||
print "Clean $BUILDROOT\n";
|
||||
$ret=`rm -fr $BUILDROOT/htdocs/theme/$PROJECT/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/*/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/*/*/Thumbs.db`;
|
||||
@ -229,12 +221,16 @@ if ($nboftargetok) {
|
||||
|
||||
if ($target eq 'TGZ') {
|
||||
unlink $FILENAMETGZ.tgz;
|
||||
# unlink $BUILDROOT/$FILENAMETGZ.tgz;
|
||||
print "Compress $BUILDROOT/htdocs into $FILENAMETGZ.tgz...\n";
|
||||
$cmd="tar --exclude-vcs --exclude-from \"$DESTI/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMETGZ.tgz\" htdocs";
|
||||
$ret=`$cmd`;
|
||||
# $cmd="tar --exclude-vcs --exclude-from \"$DESTI/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" htdocs\n";
|
||||
# $ret=`$cmd`;
|
||||
if ($OS =~ /windows/i) {
|
||||
print "Move $FILENAMETGZ.tgz to $DESTI/$FILENAMETGZ.tgz\n";
|
||||
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
||||
# $ret=`mv "$BUILDROOT/$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
||||
}
|
||||
next;
|
||||
}
|
||||
@ -243,9 +239,56 @@ if ($nboftargetok) {
|
||||
unlink $FILENAMEZIP.zip;
|
||||
print "Compress $FILENAMETGZ into $FILENAMEZIP.zip...\n";
|
||||
chdir("$BUILDROOT");
|
||||
$ret=`7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip htdocs`;
|
||||
print "Move $FILENAMEZIP.zip to $DESTI\n";
|
||||
$ret=`mv "$FILENAMEZIP.zip" "$DESTI/$FILENAMEZIP.zip"`;
|
||||
#print "cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*\n";
|
||||
#$ret=`cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*`;
|
||||
$ret=`7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*`;
|
||||
print "Move $FILENAMEZIP.zip to $DESTI\n";
|
||||
rename("$BUILDROOT/$FILENAMEZIP.zip","$DESTI/$FILENAMEZIP.zip");
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'RPM') { # Linux only
|
||||
$BUILDFIC="$FILENAME.spec";
|
||||
unlink $FILENAMETGZ.tgz;
|
||||
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
|
||||
$ret=`tar --exclude-vcs --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" --group=500 --owner=500 -czvf "$BUILDROOT/$FILENAMETGZ.tgz" $FILENAMETGZ`;
|
||||
|
||||
print "Move $FILENAMETGZ.tgz to $RPMDIR/SOURCES/$FILENAMETGZ.tgz\n";
|
||||
$cmd="mv \"$BUILDROOT/$FILENAMETGZ.tgz\" \"$RPMDIR/SOURCES/$FILENAMETGZ.tgz\"";
|
||||
$ret=`$cmd`;
|
||||
|
||||
print "Copy $SOURCE/make/rpm/${BUILDFIC} to $BUILDROOT\n";
|
||||
# $ret=`cp -p "$SOURCE/make/rpm/${BUILDFIC}" "$BUILDROOT"`;
|
||||
open (SPECFROM,"<$SOURCE/make/rpm/${BUILDFIC}") || die "Error";
|
||||
open (SPECTO,">$BUILDROOT/$BUILDFIC") || die "Error";
|
||||
while (<SPECFROM>) {
|
||||
$_ =~ s/__VERSION__/$MAJOR.$MINOR.$BUILD/;
|
||||
print SPECTO $_;
|
||||
}
|
||||
close SPECFROM;
|
||||
close SPECTO;
|
||||
|
||||
print "Launch RPM build (rpm --clean -ba $BUILDROOT/${BUILDFIC})\n";
|
||||
$ret=`rpm --clean -ba $BUILDROOT/${BUILDFIC}`;
|
||||
|
||||
print "Move $RPMDIR/RPMS/noarch/${FILENAMERPM}.noarch.rpm into $DESTI/${FILENAMERPM}.noarch.rpm\n";
|
||||
$cmd="mv \"$RPMDIR/RPMS/noarch/${FILENAMERPM}.noarch.rpm\" \"$DESTI/${FILENAMERPM}.noarch.rpm\"";
|
||||
$ret=`$cmd`;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'DEB') {
|
||||
print "Automatic build for DEB is not yet supported.\n";
|
||||
}
|
||||
|
||||
if ($target eq 'EXE') {
|
||||
unlink "$FILENAMEEXE.exe";
|
||||
print "Compress into $FILENAMEEXE.exe by $FILENAMEEXE.nsi...\n";
|
||||
$command="\"$REQUIREMENTTARGET{$target}\" /DMUI_VERSION_DOT=$MAJOR.$MINOR.$BUILD /X\"SetCompressor bzip2\" \"$SOURCE\\build\\exe\\$FILENAME.nsi\"";
|
||||
print "$command\n";
|
||||
$ret=`$command`;
|
||||
print "Move $FILENAMEEXE.exe to $DESTI\n";
|
||||
rename("$SOURCE\\build\\exe\\$FILENAMEEXE.exe","$DESTI/$FILENAMEEXE.exe");
|
||||
next;
|
||||
}
|
||||
|
||||
|
||||
@ -103,8 +103,6 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap
|
||||
|
||||
# Lang
|
||||
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
|
||||
|
||||
@ -63,25 +63,14 @@ $configfileparameters=array(
|
||||
'separator',
|
||||
'dolibarr_main_authentication',
|
||||
'separator',
|
||||
'?dolibarr_main_auth_ldap_login_attribute',
|
||||
'?dolibarr_main_auth_ldap_host',
|
||||
'?dolibarr_main_auth_ldap_port',
|
||||
'?dolibarr_main_auth_ldap_version',
|
||||
'?dolibarr_main_auth_ldap_dn',
|
||||
'?dolibarr_main_auth_ldap_admin_login',
|
||||
'?dolibarr_main_auth_ldap_admin_pass',
|
||||
'?dolibarr_main_auth_ldap_debug',
|
||||
'separator',
|
||||
'?dolibarr_lib_ADODB_PATH',
|
||||
'?dolibarr_lib_TCPDF_PATH',
|
||||
'?dolibarr_lib_FPDFI_PATH',
|
||||
'?dolibarr_lib_NUSOAP_PATH',
|
||||
'?dolibarr_lib_PHPEXCEL_PATH',
|
||||
'?dolibarr_lib_GEOIP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||
'?dolibarr_font_DOL_DEFAULT_TTF',
|
||||
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD'
|
||||
'dolibarr_main_auth_ldap_login_attribute',
|
||||
'dolibarr_main_auth_ldap_host',
|
||||
'dolibarr_main_auth_ldap_port',
|
||||
'dolibarr_main_auth_ldap_version',
|
||||
'dolibarr_main_auth_ldap_dn',
|
||||
'dolibarr_main_auth_ldap_admin_login',
|
||||
'dolibarr_main_auth_ldap_admin_pass',
|
||||
'dolibarr_main_auth_ldap_debug'
|
||||
);
|
||||
$configfilelib=array(
|
||||
// 'separator',
|
||||
@ -109,18 +98,7 @@ $configfilelib=array(
|
||||
'dolibarr_main_auth_ldap_dn',
|
||||
'dolibarr_main_auth_ldap_admin_login',
|
||||
'dolibarr_main_auth_ldap_admin_pass',
|
||||
'dolibarr_main_auth_ldap_debug',
|
||||
'separator',
|
||||
'dolibarr_lib_ADODB_PATH',
|
||||
'dolibarr_lib_TCPDF_PATH',
|
||||
'dolibarr_lib_FPDFI_PATH',
|
||||
'dolibarr_lib_NUSOAP_PATH',
|
||||
'dolibarr_lib_PHPEXCEL_PATH',
|
||||
'dolibarr_lib_GEOIP_PATH',
|
||||
'dolibarr_lib_ODTPHP_PATH',
|
||||
'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||
'dolibarr_font_DOL_DEFAULT_TTF',
|
||||
'dolibarr_font_DOL_DEFAULT_TTF_BOLD'
|
||||
'dolibarr_main_auth_ldap_debug'
|
||||
);
|
||||
$var=true;
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -138,23 +116,9 @@ foreach($configfileparameters as $key)
|
||||
|
||||
if (empty($ignore))
|
||||
{
|
||||
$newkey = preg_replace('/^\?/','',$key);
|
||||
|
||||
if (preg_match('/^\?/',$key) && empty(${$newkey}))
|
||||
{
|
||||
$i++;
|
||||
continue; // We discard parametes starting with ?
|
||||
}
|
||||
|
||||
if ($newkey == 'separator' && $lastkeyshown == 'separator')
|
||||
{
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
if ($newkey == 'separator')
|
||||
if ($key == 'separator')
|
||||
{
|
||||
print '<td colspan="3"> </td>';
|
||||
}
|
||||
@ -163,17 +127,16 @@ foreach($configfileparameters as $key)
|
||||
// Label
|
||||
print "<td>".$configfilelib[$i].'</td>';
|
||||
// Key
|
||||
print '<td>'.$newkey.'</td>';
|
||||
print '<td>'.$key.'</td>';
|
||||
// Value
|
||||
print "<td>";
|
||||
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
|
||||
else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
||||
else if ($newkey == 'dolibarr_main_url_root_alt' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT_ALT');
|
||||
else print ${$newkey};
|
||||
if ($key == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$key});
|
||||
else if ($key == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$key})) print ${$key}.' => '.constant('DOL_MAIN_URL_ROOT');
|
||||
else if ($key == 'dolibarr_main_url_root_alt' && preg_match('/__auto__/',${$key})) print ${$key}.' => '.constant('DOL_MAIN_URL_ROOT_ALT');
|
||||
else print ${$key};
|
||||
print "</td>";
|
||||
}
|
||||
print "</tr>\n";
|
||||
$lastkeyshown=$newkey;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@ -92,7 +92,7 @@ print "</center>";
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
if ($mesg) print '<br>'.$mesg;
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
@ -140,6 +140,7 @@ if ($conf->fournisseur->enabled)
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
@ -91,9 +91,6 @@ if ($conf->fournisseur->enabled)
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
print 'NUSoap library path used by Dolibarr: '.NUSOAP_PATH.'<br>';
|
||||
print '<br>';
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user