mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-11-03 10:58:50 +03:00
Improved building plugins
This commit is contained in:
parent
66bfb04330
commit
b9ede20025
3 changed files with 39 additions and 23 deletions
|
|
@ -2,11 +2,11 @@
|
|||
<?php
|
||||
define('ROOT_DIR', dirname(__DIR__));
|
||||
chdir(ROOT_DIR);
|
||||
require(ROOT_DIR . '/snappymail/v/0.0.0/app/libraries/snappymail/tar.php');
|
||||
require ROOT_DIR . '/snappymail/v/0.0.0/app/libraries/snappymail/tar.php';
|
||||
|
||||
$options = getopt('', ['aur','docker','plugins','skip-gulp','debian','nextcloud','owncloud','cpanel','sign']);
|
||||
$options = getopt('', ['aur','docker','plugins','plugins-all','skip-gulp','debian','nextcloud','owncloud','cpanel','sign']);
|
||||
|
||||
if (isset($options['plugins'])) {
|
||||
if (isset($options['plugins']) || isset($options['plugins-all'])) {
|
||||
require(ROOT_DIR . '/build/plugins.php');
|
||||
}
|
||||
|
||||
|
|
@ -47,10 +47,11 @@ is_dir($destPath) || mkdir($destPath, 0777, true);
|
|||
|
||||
$zip_destination = "{$destPath}snappymail-{$package->version}.zip";
|
||||
$tar_destination = "{$destPath}snappymail-{$package->version}.tar";
|
||||
$tgz_destination = "{$tar_destination}.gz";
|
||||
|
||||
@unlink($zip_destination);
|
||||
@unlink($tar_destination);
|
||||
@unlink("{$tar_destination}.gz");
|
||||
@unlink($tgz_destination);
|
||||
|
||||
if (!isset($options['skip-gulp'])) {
|
||||
echo "\x1b[33;1m === Gulp === \x1b[0m\n";
|
||||
|
|
@ -99,8 +100,7 @@ if (!$zip->open($zip_destination, ZIPARCHIVE::CREATE)) {
|
|||
exit("Failed to create {$zip_destination}");
|
||||
}
|
||||
|
||||
$tar_destination .= '.gz';
|
||||
$tar = new \SnappyMail\TAR($tar_destination);
|
||||
$tar = new \SnappyMail\TAR($tgz_destination);
|
||||
//$tar = new PharData($tar_destination);
|
||||
|
||||
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('snappymail/v'), RecursiveIteratorIterator::SELF_FIRST);
|
||||
|
|
@ -164,12 +164,11 @@ $zip->close();
|
|||
if ($tar instanceof PharData) {
|
||||
$tar->compress(Phar::GZ);
|
||||
unlink($tar_destination);
|
||||
$tar_destination .= '.gz';
|
||||
} else {
|
||||
$tar->close();
|
||||
}
|
||||
|
||||
echo "{$zip_destination} created\n{$tar_destination} created\n";
|
||||
echo "{$zip_destination} created\n{$tgz_destination} created\n";
|
||||
|
||||
if (isset($options['nextcloud'])) {
|
||||
require(ROOT_DIR . '/build/nextcloud.php');
|
||||
|
|
@ -204,7 +203,7 @@ if ($options['aur']) {
|
|||
}
|
||||
|
||||
$b2sums = function_exists('b2sum') ? [
|
||||
b2sum($tar_destination),
|
||||
b2sum($tgz_destination),
|
||||
b2sum(ROOT_DIR . '/build/arch/snappymail.sysusers'),
|
||||
b2sum(ROOT_DIR . '/build/arch/snappymail.tmpfiles')
|
||||
] : [];
|
||||
|
|
@ -260,7 +259,7 @@ if (isset($options['sign'])) {
|
|||
echo "\x1b[33;1m === PGP Sign === \x1b[0m\n";
|
||||
$gpg = 'gpg --local-user 1016E47079145542F8BA133548208BA13290F3EB ';
|
||||
$gpg_sign = $gpg . '--armor --detach-sign ';
|
||||
passthru($gpg_sign . escapeshellarg($tar_destination), $return_var);
|
||||
passthru($gpg_sign . escapeshellarg($tgz_destination), $return_var);
|
||||
passthru($gpg_sign . escapeshellarg($zip_destination), $return_var);
|
||||
if (isset($options['nextcloud'])) {
|
||||
passthru($gpg_sign . escapeshellarg("{$destPath}snappymail-{$package->version}-nextcloud.tar.gz"), $return_var);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue