diff --git a/CMakeLists.txt b/CMakeLists.txt index 385b2f7..9f769a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,8 +165,8 @@ enable_testing() # Custom targets to build and test mscp in docker containers. # foreach(IN ZIP_LISTS) (cmake >= 3.17) can shorten the following lists. # However, ubuntu 20.04 has cmake 3.16.3. So this is a roundabout trick. -list(APPEND DIST_IDS ubuntu ubuntu ubuntu rocky rocky almalinux alpine) -list(APPEND DIST_VERS 20.04 22.04 24.04 8.9 9.3 9.3 3.19) +list(APPEND DIST_IDS ubuntu ubuntu ubuntu rocky rocky almalinux alpine arch) +list(APPEND DIST_VERS 20.04 22.04 24.04 8.9 9.3 9.3 3.19 base) list(LENGTH DIST_IDS _DIST_LISTLEN) math(EXPR DIST_LISTLEN "${_DIST_LISTLEN} - 1") diff --git a/Dockerfile/arch-base.Dockerfile b/Dockerfile/arch-base.Dockerfile new file mode 100644 index 0000000..781fbc3 --- /dev/null +++ b/Dockerfile/arch-base.Dockerfile @@ -0,0 +1,36 @@ +FROM archlinux:base + +ARG REQUIREDPKGS + +# install pyest and openssh for test +RUN set -ex && pacman -Syy && pacman --noconfirm -S ${REQUIREDPKGS} openssh python-pytest + +RUN mkdir /var/run/sshd \ + && ssh-keygen -A \ + && ssh-keygen -f /root/.ssh/id_rsa -N "" \ + && cat /root/.ssh/id_rsa.pub > /root/.ssh/authorized_keys + +# disable PerSourcePenaltie, which would distrub test: +# https://undeadly.org/cgi?action=article;sid=20240607042157 +RUN echo "PerSourcePenalties=no" > /etc/ssh/sshd_config.d/90-mscp-test.conf + +# create test user +RUN useradd -m -d /home/test test \ + && echo "test:userpassword" | chpasswd \ + && mkdir -p /home/test/.ssh \ + && ssh-keygen -f /home/test/.ssh/id_rsa_test -N "keypassphrase" \ + && cat /home/test/.ssh/id_rsa_test.pub >> /home/test/.ssh/authorized_keys \ + && chown -R test:test /home/test \ + && chown -R test:test /home/test/.ssh + +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + +# build +RUN cd ${mscpdir} \ + && rm -rf build \ + && cmake -B build \ + && cd ${mscpdir}/build \ + && make -j 2 \ + && make install diff --git a/scripts/install-build-deps.sh b/scripts/install-build-deps.sh index 63fe87a..04d2d5f 100755 --- a/scripts/install-build-deps.sh +++ b/scripts/install-build-deps.sh @@ -55,6 +55,10 @@ case $platform in cmd="yum install -y" pkgs="gcc make cmake zlib-devel openssl-devel rpm-build" ;; + Linux-arch*) + cmd="pacman --no-confirm -S" + pkgs="gcc make cmake" + ;; FreeBSD-freebsd) cmd="pkg install" pkgs="cmake"