Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Jan 22, 2025
1 parent 12ecf19 commit ecbd8c8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
24 changes: 21 additions & 3 deletions sapi/src/builder/extension/openssh.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,32 @@

$workdir = $p->getWorkDir();
$builddir = $p->getBuildDir();
$system_arch = $p->getSystemArch();

$cmd = <<<EOF
mkdir -p {$workdir}/bin/
cd {$builddir}/openssh/
cp -f sshd {$workdir}/bin/
cd {$builddir}/openssh/build/
mkdir -p release/
ls -F | grep '*$' | awk -F '*' '{ print $1 }' | xargs -I {} cp {} release/
cp -rf release/ {$workdir}/bin/openssh/
cd {$workdir}/bin/openssh/
VERSION=$(./ssh -V 2>&1 | awk -F ',' '{ print $1 }' | sed 's/OpenSSH_//')
EOF;

if ($p->getOsType() == 'macos') {
$cmd .= <<<EOF
otool -L {$workdir}/bin/openssh/sshd
tar -cJvf {$workdir}/openssh-\${VERSION}-macos-{$system_arch}.tar.xz .
EOF;
} else {
$cmd .= <<<EOF
file {$workdir}/bin/openssh/sshd
readelf -h {$workdir}/bin/openssh/sshd
tar -cJvf {$workdir}/privoxy-\${VERSION}-linux-{$system_arch}.tar.xz .
EOF;
}
return $cmd;
});
};
12 changes: 7 additions & 5 deletions sapi/src/builder/library/openssh.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@

return function (Preprocessor $p) {
$openssh_prefix = OPENSSH_PREFIX;
$cflags = $p->getOsType() == 'macos' ? "" : '-static';
$lib = new Library('openssh');
$lib->withHomePage('https://www.openssh.com/')
->withLicense('http://www.gnu.org/licenses/lgpl-2.1.html', Library::LICENSE_BSD)
->withUrl('https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/openssh-9.3.tar.gz')
->withManual('https://www.openssh.com/portable.html')
->withFile('openssh-V_9_3_P1.tar.gz')
->withDocumentation('https://anongit.mindrot.org/openssh.git')
->withFile('openssh-V_9_9_P1.tar.gz')
->withHttpProxy(true, true)
->withDownloadScript(
'openssh',
<<<EOF
git clone -b V_9_3_P1 --depth=1 git://anongit.mindrot.org/openssh.git
git clone -b V_9_9_P1 --depth=1 git://anongit.mindrot.org/openssh.git
EOF
)
->withPrefix($openssh_prefix)
Expand All @@ -28,7 +30,7 @@
PACKAGES="\$PACKAGES "
CPPFLAGS="$(pkg-config --cflags-only-I --static \$PACKAGES)" \
LDFLAGS="$(pkg-config --libs-only-L --static \$PACKAGES) -static" \
LDFLAGS="$(pkg-config --libs-only-L --static \$PACKAGES) {$cflags}" \
LIBS="$(pkg-config --libs-only-l --static \$PACKAGES)" \
../configure \
--prefix={$openssh_prefix} \
Expand All @@ -39,7 +41,7 @@
EOF
)
->withBuildCached(false)
//->withBinPath($openssh_prefix . '/bin/')
->withInstallCached(false)
->withDependentLibraries('openssl', 'zlib') //'libedit',
->disableDefaultLdflags()
->disablePkgName()
Expand Down
6 changes: 0 additions & 6 deletions sapi/src/template/make.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@
fi
fi


<?php if ($item->cleanPreInstallDirectory) : ?>
# If the install directory exist, clean the install directory
test -d <?=$item->preInstallDirectory?>/ && rm -rf <?=$item->preInstallDirectory?>/ ;
<?php endif; ?>

cd <?=$this->getBuildDir()?>/<?=$item->name?>/


Expand Down

0 comments on commit ecbd8c8

Please sign in to comment.