mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Things for issue #185
This commit is contained in:
parent
e324e2f6b6
commit
f23dd5a431
4 changed files with 51 additions and 35 deletions
46
build/deb.php
Executable file
46
build/deb.php
Executable file
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?php
|
||||||
|
// Debian Repository
|
||||||
|
define('DEB_SOURCE_DIR', __DIR__ . '/deb');
|
||||||
|
define('DEB_DEST_DIR', DEB_SOURCE_DIR . "/snappymail_{$package->version}-1_all");
|
||||||
|
is_dir(DEB_DEST_DIR) && passthru('rm -dfr '.escapeshellarg(DEB_DEST_DIR));
|
||||||
|
|
||||||
|
$dir = DEB_DEST_DIR . '/DEBIAN';
|
||||||
|
$data = file_get_contents(DEB_SOURCE_DIR . '/DEBIAN/control');
|
||||||
|
$data = str_replace('0.0.0', $package->version, $data);
|
||||||
|
mkdir($dir, 0755, true);
|
||||||
|
file_put_contents("{$dir}/control", $data);
|
||||||
|
copy(DEB_SOURCE_DIR . '/DEBIAN/postinst', $dir . '/postinst');
|
||||||
|
chmod($dir . '/postinst', 0755);
|
||||||
|
|
||||||
|
$dir = DEB_DEST_DIR . '/var/lib/snappymail';
|
||||||
|
mkdir($dir, 0755, true);
|
||||||
|
file_put_contents($dir . '/VERSION', $package->version);
|
||||||
|
copy('data/README.md', "{$dir}/README.md");
|
||||||
|
|
||||||
|
$dir = DEB_DEST_DIR . '/usr/share/doc/snappymail';
|
||||||
|
mkdir($dir, 0755, true);
|
||||||
|
copy('CODE_OF_CONDUCT.md', "{$dir}/CODE_OF_CONDUCT.md");
|
||||||
|
copy('CONTRIBUTING.md', "{$dir}/CONTRIBUTING.md");
|
||||||
|
copy('README.md', "{$dir}/README.md");
|
||||||
|
copy('CODE_OF_CONDUCT.md', "{$dir}/CODE_OF_CONDUCT.md");
|
||||||
|
//usr/share/doc/snappymail/README.Debian
|
||||||
|
//usr/share/doc/snappymail/changelog.Debian.gz
|
||||||
|
//usr/share/doc/snappymail/copyright
|
||||||
|
|
||||||
|
// Move files into package directory
|
||||||
|
$dir = DEB_DEST_DIR . '/usr/share/snappymail';
|
||||||
|
mkdir($dir, 0755, true);
|
||||||
|
passthru('cp -r "' . dirname(__DIR__) . '/snappymail" "' . $dir . '"');
|
||||||
|
$data = file_get_contents('index.php');
|
||||||
|
file_put_contents("{$dir}/index.php", str_replace('0.0.0', $package->version, $data));
|
||||||
|
$data = file_get_contents('_include.php');
|
||||||
|
file_put_contents("{$dir}/include.php", preg_replace('@(external-snappymail-data-folder/\'\);)@', "\$1\ndefine('APP_DATA_FOLDER_PATH', '/var/lib/snappymail');", $data));
|
||||||
|
|
||||||
|
passthru('dpkg --build '.escapeshellarg(DEB_DEST_DIR));
|
||||||
|
|
||||||
|
passthru('mv '
|
||||||
|
. escapeshellarg(DEB_DEST_DIR.'.deb') . ' '
|
||||||
|
. escapeshellarg(__DIR__ . "/dist/releases/webmail/{$package->version}/" . basename(DEB_DEST_DIR.'.deb'))
|
||||||
|
);
|
||||||
|
|
||||||
|
passthru('rm -dfr '.escapeshellarg(DEB_DEST_DIR));
|
||||||
|
|
@ -1,12 +1,7 @@
|
||||||
Package: snappymail
|
Package: snappymail
|
||||||
Version: 0.0.0
|
Version: 0.0.0
|
||||||
Maintainer: the-djmaze <debian@snappymail.eu>
|
Maintainer: SnappyMail <debian@snappymail.eu>
|
||||||
Depends:
|
Depends: nginx | apache2 | httpd, php-fpm | libapache2-mod-php, php-json, php-xml, php-zip
|
||||||
nginx | apache2 | httpd
|
|
||||||
, php-fpm | libapache2-mod-php
|
|
||||||
, php-json
|
|
||||||
, php-xml
|
|
||||||
, php-zip
|
|
||||||
Suggests: php-sqlite3 | php-mysql | php-pgsql
|
Suggests: php-sqlite3 | php-mysql | php-pgsql
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Homepage: https://snappymail.eu
|
Homepage: https://snappymail.eu
|
||||||
|
|
|
||||||
2
build/deb/DEBIAN/postinst
Executable file
2
build/deb/DEBIAN/postinst
Executable file
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
chown -R www-data:www-data /var/lib/snappymail
|
||||||
29
release.php
29
release.php
|
|
@ -157,7 +157,6 @@ $tar->addFile('.htaccess');
|
||||||
|
|
||||||
$index = file_get_contents('index.php');
|
$index = file_get_contents('index.php');
|
||||||
$index = str_replace('0.0.0', $package->version, $index);
|
$index = str_replace('0.0.0', $package->version, $index);
|
||||||
$index = str_replace('source', 'community', $index);
|
|
||||||
$zip->addFromString('index.php', $index);
|
$zip->addFromString('index.php', $index);
|
||||||
$tar->addFromString('index.php', $index);
|
$tar->addFromString('index.php', $index);
|
||||||
|
|
||||||
|
|
@ -236,33 +235,7 @@ pkgname = snappymail
|
||||||
}
|
}
|
||||||
// Debian Repository
|
// Debian Repository
|
||||||
else if (isset($options['debian'])) {
|
else if (isset($options['debian'])) {
|
||||||
$target_dir = __DIR__ . "/build/deb/snappymail_{$package->version}-1_all";
|
require(__DIR__ . '/build/deb.php');
|
||||||
|
|
||||||
$data = file_get_contents(__DIR__ . '/build/deb/DEBIAN/control');
|
|
||||||
$data = preg_replace('/Version: [0-9.]+/', "Version: {$package->version}", $data);
|
|
||||||
$dir = $target_dir . '/DEBIAN';
|
|
||||||
is_dir($dir) || mkdir($dir, 0755, true);
|
|
||||||
file_put_contents("{$dir}/control", $data);
|
|
||||||
|
|
||||||
$dir = $target_dir . '/var/lib/snappymail';
|
|
||||||
is_dir($dir) || mkdir($dir, 0755, true);
|
|
||||||
file_put_contents($dir . '/VERSION', $package->version);
|
|
||||||
|
|
||||||
$dir = $target_dir . '/usr/share/doc/snappymail';
|
|
||||||
is_dir($dir) || mkdir($dir, 0755, true);
|
|
||||||
copy('CODE_OF_CONDUCT.md', "{$dir}/CODE_OF_CONDUCT.md");
|
|
||||||
copy('CONTRIBUTING.md', "{$dir}/CONTRIBUTING.md");
|
|
||||||
copy('README.md', "{$dir}/README.md");
|
|
||||||
copy('CODE_OF_CONDUCT.md', "{$dir}/CODE_OF_CONDUCT.md");
|
|
||||||
//usr/share/doc/snappymail/README.Debian
|
|
||||||
//usr/share/doc/snappymail/changelog.Debian.gz
|
|
||||||
//usr/share/doc/snappymail/copyright
|
|
||||||
|
|
||||||
$dir = $target_dir . '/usr/share/snappymail';
|
|
||||||
is_dir($dir) ? passthru('rm -dfr "'.$dir.'"') : mkdir(dirname($dir), 0755, true);
|
|
||||||
passthru('cp -r "' . __DIR__ . '/snappymail/v/0.0.0" "' . $dir . '"');
|
|
||||||
|
|
||||||
passthru('dpkg --build "'.$target_dir.'"');
|
|
||||||
}
|
}
|
||||||
// Docker build
|
// Docker build
|
||||||
else if ($options['docker']) {
|
else if ($options['docker']) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue