90 lines
2.5 KiB
Python
90 lines
2.5 KiB
Python
import os
|
|
|
|
from lib import cpp
|
|
from lib.make import *
|
|
|
|
|
|
version("10.6.1")
|
|
description("the premier connectivity tool for remote login with the SSH protocol")
|
|
maintainer("sisungo <[email protected]>")
|
|
source_managed("github://openssh/openssh-portable#V_10_6_P1")
|
|
|
|
builddep("shortcut/c")
|
|
builddep("shortcut/autotools")
|
|
builddep("libz-ng-dev @target")
|
|
builddep("aws-lc-dev @target")
|
|
builddep("linux-pam-dev @target")
|
|
builddep("linux-dev @target")
|
|
|
|
|
|
def build():
|
|
cpp.configure([
|
|
"--prefix=/",
|
|
f"--libexecdir={get_prefix('openssh')}/libexec",
|
|
f"--bindir={get_prefix('openssh')}/bin",
|
|
f"--sbindir={get_prefix('openssh')}/bin",
|
|
"--sysconfdir=/var/config/ssh",
|
|
"--disable-etc-default-login",
|
|
"--with-linux-memlock-onfault",
|
|
"--without-shadow",
|
|
"--with-pam",
|
|
"--with-pam-service=remote-login",
|
|
"--with-privsep-user=_sshd",
|
|
"--with-default-path=/bin",
|
|
"--with-pid-dir=/run/system",
|
|
"--with-pie",
|
|
])
|
|
cpp.make()
|
|
cpp.make_install()
|
|
|
|
on_build(build)
|
|
|
|
|
|
service_in = os.getcwd() + "/services/openssh-server.airs.in"
|
|
def install_service(composer):
|
|
composer.makedirs("share/services")
|
|
with open(service_in) as fd:
|
|
service = fd.read()
|
|
service = service.replace("%PREFIX%", get_prefix("openssh"))
|
|
with open("openssh-server.airs", "wt+") as fd:
|
|
fd.write(service)
|
|
composer.add("openssh-server.airs", "share/services/openssh-server.airs")
|
|
|
|
def patch_config():
|
|
with open("var/config/ssh/sshd_config") as fd:
|
|
sshd_config = fd.read()
|
|
sshd_config = sshd_config.replace("#UsePAM no", "UsePAM yes")
|
|
sshd_config = sshd_config.replace("#PrintMotd yes", "PrintMotd no")
|
|
with open("var/config/ssh/sshd_config", "wt") as fd:
|
|
fd.write(sshd_config)
|
|
|
|
def pack(composer):
|
|
composer.add("bin")
|
|
composer.add("libexec")
|
|
composer.makedir("share")
|
|
|
|
patch_config()
|
|
composer.add("var/config", "share/config")
|
|
|
|
install_service(composer)
|
|
|
|
def pack_docs(composer):
|
|
composer.makedir("share")
|
|
composer.add("share/man")
|
|
|
|
package("openssh")
|
|
dep("semi-libc @same-arch")
|
|
dep("libcrypto @same-arch")
|
|
dep("libz @same-arch")
|
|
dep("libpam @same-arch")
|
|
provide("ssh")
|
|
provide("sshd")
|
|
configure_script("configure/create-privsep")
|
|
configure_script("configure/default-config")
|
|
configure_script("configure/hostkeys")
|
|
on_pack(pack)
|
|
link("share/services/openssh-server.airs", "/share/services/sshd.airs")
|
|
|
|
package("openssh-docs")
|
|
on_pack(pack_docs)
|