Work on rpm package
This commit is contained in:
parent
57c01f7ae0
commit
7734901fb0
@ -74,14 +74,10 @@ my $copyalreadydone=0;
|
|||||||
my $batch=0;
|
my $batch=0;
|
||||||
|
|
||||||
print "Makepack theme version $VERSION\n";
|
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>;
|
$PROJECT=<STDIN>;
|
||||||
chomp($PROJECT);
|
chomp($PROJECT);
|
||||||
|
|
||||||
@PROJECTLIST=split(/ /,$PROJECT);
|
|
||||||
$PROJECT=join('',@PROJECTLIST);
|
|
||||||
|
|
||||||
|
|
||||||
# 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>;
|
||||||
@ -97,8 +93,6 @@ if ($MINOR eq '')
|
|||||||
|
|
||||||
$FILENAME="$PROJECT";
|
$FILENAME="$PROJECT";
|
||||||
$FILENAMETGZ="theme_$PROJECT-$MAJOR.$MINOR";
|
$FILENAMETGZ="theme_$PROJECT-$MAJOR.$MINOR";
|
||||||
$FILENAMEZIP="theme_$PROJECT-$MAJOR.$MINOR";
|
|
||||||
|
|
||||||
if (-d "/usr/src/redhat") {
|
if (-d "/usr/src/redhat") {
|
||||||
# redhat
|
# redhat
|
||||||
$RPMDIR="/usr/src/redhat";
|
$RPMDIR="/usr/src/redhat";
|
||||||
@ -207,13 +201,11 @@ if ($nboftargetok) {
|
|||||||
mkdir "$BUILDROOT";
|
mkdir "$BUILDROOT";
|
||||||
mkdir "$BUILDROOT/htdocs";
|
mkdir "$BUILDROOT/htdocs";
|
||||||
mkdir "$BUILDROOT/htdocs/theme";
|
mkdir "$BUILDROOT/htdocs/theme";
|
||||||
|
mkdir "$BUILDROOT/htdocs/theme/$PROJECT";
|
||||||
|
|
||||||
print "Copy $SOURCE into $BUILDROOT\n";
|
print "Copy $SOURCE into $BUILDROOT\n";
|
||||||
mkdir "$BUILDROOT";
|
mkdir "$BUILDROOT";
|
||||||
foreach my $tmp (@PROJECTLIST)
|
$ret=`cp -pr "$SOURCE/htdocs/theme/$PROJECT" "$BUILDROOT/htdocs/theme"`;
|
||||||
{
|
|
||||||
$ret=`cp -pr "$SOURCE/htdocs/theme/$tmp" "$BUILDROOT/htdocs/theme"`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print "Clean $BUILDROOT\n";
|
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`;
|
$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') {
|
if ($target eq 'TGZ') {
|
||||||
unlink $FILENAMETGZ.tgz;
|
unlink $FILENAMETGZ.tgz;
|
||||||
|
# unlink $BUILDROOT/$FILENAMETGZ.tgz;
|
||||||
print "Compress $BUILDROOT/htdocs into $FILENAMETGZ.tgz...\n";
|
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";
|
$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`;
|
$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) {
|
if ($OS =~ /windows/i) {
|
||||||
print "Move $FILENAMETGZ.tgz to $DESTI/$FILENAMETGZ.tgz\n";
|
print "Move $FILENAMETGZ.tgz to $DESTI/$FILENAMETGZ.tgz\n";
|
||||||
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
||||||
|
# $ret=`mv "$BUILDROOT/$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
||||||
}
|
}
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
@ -243,9 +239,56 @@ if ($nboftargetok) {
|
|||||||
unlink $FILENAMEZIP.zip;
|
unlink $FILENAMEZIP.zip;
|
||||||
print "Compress $FILENAMETGZ into $FILENAMEZIP.zip...\n";
|
print "Compress $FILENAMETGZ into $FILENAMEZIP.zip...\n";
|
||||||
chdir("$BUILDROOT");
|
chdir("$BUILDROOT");
|
||||||
$ret=`7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip htdocs`;
|
#print "cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*\n";
|
||||||
print "Move $FILENAMEZIP.zip to $DESTI\n";
|
#$ret=`cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*`;
|
||||||
$ret=`mv "$FILENAMEZIP.zip" "$DESTI/$FILENAMEZIP.zip"`;
|
$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;
|
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 build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz
|
||||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||||
%{__cp} -pr scripts $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
|
# Lang
|
||||||
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
|
for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_*
|
||||||
|
|||||||
@ -63,25 +63,14 @@ $configfileparameters=array(
|
|||||||
'separator',
|
'separator',
|
||||||
'dolibarr_main_authentication',
|
'dolibarr_main_authentication',
|
||||||
'separator',
|
'separator',
|
||||||
'?dolibarr_main_auth_ldap_login_attribute',
|
'dolibarr_main_auth_ldap_login_attribute',
|
||||||
'?dolibarr_main_auth_ldap_host',
|
'dolibarr_main_auth_ldap_host',
|
||||||
'?dolibarr_main_auth_ldap_port',
|
'dolibarr_main_auth_ldap_port',
|
||||||
'?dolibarr_main_auth_ldap_version',
|
'dolibarr_main_auth_ldap_version',
|
||||||
'?dolibarr_main_auth_ldap_dn',
|
'dolibarr_main_auth_ldap_dn',
|
||||||
'?dolibarr_main_auth_ldap_admin_login',
|
'dolibarr_main_auth_ldap_admin_login',
|
||||||
'?dolibarr_main_auth_ldap_admin_pass',
|
'dolibarr_main_auth_ldap_admin_pass',
|
||||||
'?dolibarr_main_auth_ldap_debug',
|
'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'
|
|
||||||
);
|
);
|
||||||
$configfilelib=array(
|
$configfilelib=array(
|
||||||
// 'separator',
|
// 'separator',
|
||||||
@ -109,18 +98,7 @@ $configfilelib=array(
|
|||||||
'dolibarr_main_auth_ldap_dn',
|
'dolibarr_main_auth_ldap_dn',
|
||||||
'dolibarr_main_auth_ldap_admin_login',
|
'dolibarr_main_auth_ldap_admin_login',
|
||||||
'dolibarr_main_auth_ldap_admin_pass',
|
'dolibarr_main_auth_ldap_admin_pass',
|
||||||
'dolibarr_main_auth_ldap_debug',
|
'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'
|
|
||||||
);
|
);
|
||||||
$var=true;
|
$var=true;
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -138,23 +116,9 @@ foreach($configfileparameters as $key)
|
|||||||
|
|
||||||
if (empty($ignore))
|
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;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
if ($newkey == 'separator')
|
if ($key == 'separator')
|
||||||
{
|
{
|
||||||
print '<td colspan="3"> </td>';
|
print '<td colspan="3"> </td>';
|
||||||
}
|
}
|
||||||
@ -163,17 +127,16 @@ foreach($configfileparameters as $key)
|
|||||||
// Label
|
// Label
|
||||||
print "<td>".$configfilelib[$i].'</td>';
|
print "<td>".$configfilelib[$i].'</td>';
|
||||||
// Key
|
// Key
|
||||||
print '<td>'.$newkey.'</td>';
|
print '<td>'.$key.'</td>';
|
||||||
// Value
|
// Value
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
|
if ($key == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$key});
|
||||||
else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
else if ($key == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$key})) print ${$key}.' => '.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 if ($key == 'dolibarr_main_url_root_alt' && preg_match('/__auto__/',${$key})) print ${$key}.' => '.constant('DOL_MAIN_URL_ROOT_ALT');
|
||||||
else print ${$newkey};
|
else print ${$key};
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$lastkeyshown=$newkey;
|
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,7 +92,7 @@ print "</center>";
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
dol_htmloutput_mesg($mesg);
|
if ($mesg) print '<br>'.$mesg;
|
||||||
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
@ -140,6 +140,7 @@ if ($conf->fournisseur->enabled)
|
|||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
dol_htmloutput_mesg($mesg);
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
@ -91,9 +91,6 @@ if ($conf->fournisseur->enabled)
|
|||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
print 'NUSoap library path used by Dolibarr: '.NUSOAP_PATH.'<br>';
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user