From de71c0102ada5b4fd56fdc3556cf21daefc33a61 Mon Sep 17 00:00:00 2001 From: "Lance R. Vick" Date: Mon, 5 Aug 2024 17:10:52 -0700 Subject: [PATCH] feat: add openssl --- packages/openssh/Containerfile | 64 ++++++++++++++++++++++++++++++++++ src/packages.mk | 27 ++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 packages/openssh/Containerfile diff --git a/packages/openssh/Containerfile b/packages/openssh/Containerfile new file mode 100644 index 0000000..0de282c --- /dev/null +++ b/packages/openssh/Containerfile @@ -0,0 +1,64 @@ +FROM scratch as base +ENV VERSION=9.8p1 +ENV SRC_HASH=dd8bd002a379b5d499dfb050dd1fa9af8029e80461f4bb6c523c49973f5a39f3 +ENV SRC_FILE=openssh-${VERSION}.tar.gz +ENV SRC_SITE=https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . + +FROM fetch as build +COPY --from=stagex/busybox . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/bison . / +COPY --from=stagex/libtool . / +COPY --from=stagex/zlib . / +COPY --from=stagex/libzstd . / +COPY --from=stagex/flex . / +COPY --from=stagex/openssl . / +COPY --from=stagex/perl . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/gettext . / +COPY --from=stagex/m4 . / +COPY --from=stagex/argp-standalone . / +COPY --from=stagex/musl . / +COPY --from=stagex/musl-fts . / +COPY --from=stagex/musl-obstack . / +COPY --from=stagex/linux-headers . / +RUN tar -xf ${SRC_FILE} +WORKDIR openssh-${VERSION} +ADD *.patch . +RUN --network=none <<-EOF + set -eux + autoreconf -vif + ./configure \ + --build="x86_64-linux-musl" \ + --host="x86_64-linux-musl" \ + --prefix=/usr \ + --sysconfdir=/etc/ssh \ + --libexecdir=/usr/lib/ssh \ + --mandir=/usr/share/man \ + --with-cflags="$(pkg-config --cflags --static utmps)" \ + --with-libs="$(pkg-config --libs --static utmps)" \ + --with-privsep-path=/var/empty \ + --with-pid-dir=/run \ + --with-mantype=doc \ + --with-xauth=/usr/bin/xauth \ + --with-default-path='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' \ + --disable-utmp \ + --disable-wtmp \ + --disable-lastlog \ + --disable-strip \ + --with-ssl-engine + make -j "$(nproc)" +EOF + +FROM build as install +RUN --network=none make DESTDIR=/rootfs install + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/src/packages.mk b/src/packages.mk index 5406963..dec1f0e 100644 --- a/src/packages.mk +++ b/src/packages.mk @@ -1457,6 +1457,33 @@ out/opensc/index.json: \ out/zlib/index.json $(call build,opensc) +.PHONY: openssh +openssh: out/openssh/index.json +out/openssh/index.json: \ + packages/openssh/Containerfile \ + out/argp-standalone/index.json \ + out/autoconf/index.json \ + out/automake/index.json \ + out/binutils/index.json \ + out/bison/index.json \ + out/busybox/index.json \ + out/filesystem/index.json \ + out/flex/index.json \ + out/gcc/index.json \ + out/gettext/index.json \ + out/libtool/index.json \ + out/libzstd/index.json \ + out/linux-headers/index.json \ + out/m4/index.json \ + out/make/index.json \ + out/musl/index.json \ + out/musl-fts/index.json \ + out/musl-obstack/index.json \ + out/perl/index.json \ + out/pkgconf/index.json \ + out/zlib/index.json + $(call build,openssh) + .PHONY: openssl openssl: out/openssl/index.json out/openssl/index.json: \