mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-26 16:47:54 +08:00
Create Debian repo
https://github.com/the-djmaze/snappymail/issues/185#issuecomment-1059420588
This commit is contained in:
parent
d4069fd835
commit
c510959b76
2 changed files with 32 additions and 2 deletions
|
@ -42,11 +42,34 @@ file_put_contents("{$dir}/index.php", str_replace('0.0.0', $package->version, $d
|
|||
$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('dpkg --build ' . escapeshellarg(DEB_DEST_DIR));
|
||||
|
||||
$TARGET_DIR = __DIR__ . "/dist/releases/webmail/{$package->version}/";
|
||||
|
||||
passthru('mv '
|
||||
. escapeshellarg(DEB_DEST_DIR.'.deb') . ' '
|
||||
. escapeshellarg(__DIR__ . "/dist/releases/webmail/{$package->version}/" . basename(DEB_DEST_DIR.'.deb'))
|
||||
. escapeshellarg($TARGET_DIR . basename(DEB_DEST_DIR.'.deb'))
|
||||
);
|
||||
|
||||
passthru('rm -dfr '.escapeshellarg(DEB_DEST_DIR));
|
||||
|
||||
// https://github.com/the-djmaze/snappymail/issues/185#issuecomment-1059420588
|
||||
passthru('dpkg-scanpackages ' . escapeshellarg($TARGET_DIR) . ' /dev/null | gzip -9c > '.escapeshellarg($TARGET_DIR . 'Packages.gz'));
|
||||
$size = filesize($TARGET_DIR . 'Packages.gz');
|
||||
$Release = 'Origin: SnappyMail Repository
|
||||
Label: SnappyMail
|
||||
Suite: stable
|
||||
Codename: stable
|
||||
Version: 1.0
|
||||
Architectures: all
|
||||
Components: main
|
||||
Description: SnappyMail repository
|
||||
Date: ' . gmdate('r') . '
|
||||
MD5Sum:
|
||||
' . hash_file('md5', $TARGET_DIR . 'Packages.gz') . ' ' . $size . 'Packages.gz
|
||||
SHA1:
|
||||
' . hash_file('sha1', $TARGET_DIR . 'Packages.gz') . ' ' . $size . 'Packages.gz
|
||||
SHA256:
|
||||
' . hash_file('sha256', $TARGET_DIR . 'Packages.gz') . ' ' . $size . 'Packages.gz
|
||||
';
|
||||
file_put_contents($TARGET_DIR . 'Release', $Release);
|
||||
|
|
|
@ -249,5 +249,12 @@ if (isset($options['sign'])) {
|
|||
if (isset($options['debian'])) {
|
||||
passthru('gpg --local-user 1016E47079145542F8BA133548208BA13290F3EB --armor --detach-sign '
|
||||
. escapeshellarg(__DIR__ . "/build/dist/releases/webmail/{$package->version}/" . basename(DEB_DEST_DIR.'.deb')), $return_var);
|
||||
// https://github.com/the-djmaze/snappymail/issues/185#issuecomment-1059420588
|
||||
passthru('gpg --local-user 1016E47079145542F8BA133548208BA13290F3EB --digest-algo SHA512 --clearsign --output '
|
||||
. escapeshellarg(__DIR__ . "/build/dist/releases/webmail/{$package->version}/InRelease") . ' '
|
||||
. escapeshellarg(__DIR__ . "/build/dist/releases/webmail/{$package->version}/Release"), $return_var);
|
||||
passthru('gpg --local-user 1016E47079145542F8BA133548208BA13290F3EB --digest-algo SHA512 -abs --output '
|
||||
. escapeshellarg(__DIR__ . "/build/dist/releases/webmail/{$package->version}/Release.gpg") . ' '
|
||||
. escapeshellarg(__DIR__ . "/build/dist/releases/webmail/{$package->version}/Release"), $return_var);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue