summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/release.yml4
-rw-r--r--CMakeLists.txt12
-rw-r--r--README.md2
-rw-r--r--docker/README.md19
-rw-r--r--docker/almalinux-8.8.Dockerfile (renamed from docker/rocky-8.6.Dockerfile)11
-rw-r--r--docker/alpine-3.17.Dockerfile23
-rw-r--r--docker/rocky-8.8.Dockerfile (renamed from docker/centos-8.Dockerfile)20
-rw-r--r--docker/ubuntu-20.04.Dockerfile8
-rw-r--r--docker/ubuntu-22.04.Dockerfile7
-rwxr-xr-xscripts/install-build-deps.sh2
-rwxr-xr-xscripts/print-install-deps.sh4
11 files changed, 51 insertions, 61 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 266ab30..827f35b 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -45,8 +45,8 @@ jobs:
files: |
${{github.workspace}}/build/mscp_ubuntu-20.04-x86_64.deb
${{github.workspace}}/build/mscp_ubuntu-22.04-x86_64.deb
- ${{github.workspace}}/build/mscp_centos-8-x86_64.rpm
- ${{github.workspace}}/build/mscp_rocky-8.6-x86_64.rpm
+ ${{github.workspace}}/build/mscp_rocky-8.8-x86_64.rpm
+ ${{github.workspace}}/build/mscp_almalinux-8.8-x86_64.rpm
${{github.workspace}}/build/mscp_alpine-3.17-x86_64.static
${{github.workspace}}/build/mscp.linux.x86.static
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c3b3c26..ef1fbbc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,9 +121,8 @@ enable_testing()
# CPACK Rules
-set(CPACK_SET_DESTDIR true)
-set(CPACK_PROJECT_NAME ${PROJECT_NAME})
-set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
+#set(CPACK_SET_DESTDIR true)
+set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_CONTACT "Ryo Nakamura <upa@haeena.net>")
set(CPACK_PACKAGE_DESCRIPTION
"mscp, copy files over multiple ssh connections")
@@ -153,6 +152,7 @@ if(UNIX AND NOT APPLE) # on linux
set(CPACK_RPM_PACKAGE_REQUIRES ${DIST_DEP})
set(CPACK_RPM_PACKAGE_HOMEPAGE "https://github.com/upa/mscp")
set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
+ set(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
endif() # on linux
include(CPack)
@@ -162,9 +162,9 @@ include(CPack)
# 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_NAMES ubuntu ubuntu centos rocky alpine)
-list(APPEND DIST_VERS 20.04 22.04 8 8.6 3.17)
-list(APPEND DIST_PKGS deb deb rpm rpm static)
+list(APPEND DIST_NAMES ubuntu ubuntu rocky almalinux alpine)
+list(APPEND DIST_VERS 20.04 22.04 8.8 8.8 3.17)
+list(APPEND DIST_PKGS deb deb rpm rpm static)
list(LENGTH DIST_NAMES _DIST_LISTLEN)
math(EXPR DIST_LISTLEN "${_DIST_LISTLEN} - 1")
diff --git a/README.md b/README.md
index 333693b..163a9d0 100644
--- a/README.md
+++ b/README.md
@@ -67,7 +67,7 @@ patch introduces asynchronous SFTP Write, which is derived from
https://github.com/limes-datentechnik-gmbh/libssh (see [Re: SFTP Write
async](https://archive.libssh.org/libssh/2020-06/0000004.html)).
-Currently macOS and Linux (Ubuntu, CentOS, Rocky) are supported.
+Currently macOS and Linux (Ubuntu, Rocky, Alma) are supported.
```console
# clone this repository
diff --git a/docker/README.md b/docker/README.md
index 8c58949..8e3dbe9 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -8,9 +8,7 @@ docker build -t mscp-ubuntu:20.04 -f docker/ubuntu-20.04.Dockerfile .
docker build -t mscp-ubuntu:22.04 -f docker/ubuntu-22.04.Dockerfile .
-docker build -t mscp-centos:8 -f docker/centos-8.Dockerfile .
-
-docker build -t mscp-rocky:8.6 -f docker/rocky-8.6.Dockerfile .
+docker build -t mscp-rocky:8.8 -f docker/rocky-8.Dockerfile .
```
Test `mscp` in the containers.
@@ -20,25 +18,20 @@ docker run --init --rm mscp-ubuntu:20.04 /mscp/scripts/test-in-container.sh
docker run --init --rm mscp-ubuntu:22.04 /mscp/scripts/test-in-container.sh
-docker run --init --rm mscp-centos:8 /mscp/scripts/test-in-container.sh
-
-docker run --init --rm mscp-rocky:8.6 /mscp/scripts/test-in-container.sh
+docker run --init --rm mscp-rocky:8.9 /mscp/scripts/test-in-container.sh
```
Retrieve deb/rpm packages.
```console
docker run --rm -v (pwd):/out mscp-ubuntu:20.04 \
- cp /mscp/build/mscp_0.0.0-ubuntu-20.04-x86_64.deb /out/
+ cp /mscp/build/mscp_ubuntu-20.04-x86_64.deb /out/
docker run --rm -v (pwd):/out mscp-ubuntu:22.04 \
- cp /mscp/build/mscp_0.0.0-ubuntu-22.04-x86_64.deb /out/
-
-docker run --rm -v (pwd):/out mscp-centos:8 \
- cp /mscp/build/mscp_0.0.0-centos-8-x86_64.rpm /out/
+ cp /mscp/build/mscp_ubuntu-22.04-x86_64.deb /out/
-docker run --rm -v (pwd):/out mscp-rocky:8.6 \
- cp /mscp/build/mscp_0.0.0-rocky-8.6-x86_64.rpm /out/
+docker run --rm -v (pwd):/out mscp-rocky:8.8 \
+ cp /mscp/build/mscp_rocky-8.8-x86_64.rpm /out/
```
I don't know whether these are good way. \ No newline at end of file
diff --git a/docker/rocky-8.6.Dockerfile b/docker/almalinux-8.8.Dockerfile
index 35d18a8..f7a9ace 100644
--- a/docker/rocky-8.6.Dockerfile
+++ b/docker/almalinux-8.8.Dockerfile
@@ -1,8 +1,4 @@
-FROM rockylinux:8.6
-
-ARG mscpdir="/mscp"
-
-COPY . ${mscpdir}
+FROM almalinux:8.8
# install pytest, sshd for test, and rpm-build
RUN set -ex && yum -y install \
@@ -17,6 +13,11 @@ RUN mkdir /var/run/sshd \
&& ssh-keygen -f /root/.ssh/id_rsa -N "" \
&& mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
+
+ARG mscpdir="/mscp"
+
+COPY . ${mscpdir}
+
# install build dependency
RUN ${mscpdir}/scripts/install-build-deps.sh
diff --git a/docker/alpine-3.17.Dockerfile b/docker/alpine-3.17.Dockerfile
index a49d0ee..4a76c01 100644
--- a/docker/alpine-3.17.Dockerfile
+++ b/docker/alpine-3.17.Dockerfile
@@ -2,18 +2,26 @@ FROM alpine:3.17
# Build mscp with conan to create single binary mscp
-ARG mscpdir="/mscp"
-
-COPY . ${mscpdir}
-
RUN apk add --no-cache \
gcc make cmake python3 py3-pip perl linux-headers libc-dev \
openssh bash python3-dev g++
RUN pip3 install conan pytest
+# preparation for sshd
+RUN ssh-keygen -A
+RUN mkdir /var/run/sshd \
+ && ssh-keygen -f /root/.ssh/id_rsa -N "" \
+ && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
+
+
# Build mscp as a single binary
RUN conan profile detect --force
+
+ARG mscpdir="/mscp"
+
+COPY . ${mscpdir}
+
RUN cd ${mscpdir} \
&& rm -rf build \
&& conan install . --output-folder=build --build=missing \
@@ -25,15 +33,8 @@ RUN cd ${mscpdir} \
&& make \
&& cp mscp /usr/bin/ \
&& cp mscp /mscp/build/mscp_alpine-3.17-x86_64.static
-
# copy mscp to PKG FILE NAME because this build doesn't use CPACK
-# preparation for sshd
-RUN ssh-keygen -A
-RUN mkdir /var/run/sshd \
- && ssh-keygen -f /root/.ssh/id_rsa -N "" \
- && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
-
# install mscp python module
RUN cd ${mscpdir} \
&& python3 setup.py install --user
diff --git a/docker/centos-8.Dockerfile b/docker/rocky-8.8.Dockerfile
index 3059715..b09c626 100644
--- a/docker/centos-8.Dockerfile
+++ b/docker/rocky-8.8.Dockerfile
@@ -1,16 +1,7 @@
-FROM centos:8
-
-ARG mscpdir="/mscp"
-
-COPY . ${mscpdir}
-
-# from https://stackoverflow.com/questions/70963985/error-failed-to-download-metadata-for-repo-appstream-cannot-prepare-internal
-RUN cd /etc/yum.repos.d/
-RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
-RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
+FROM rockylinux:8.8
# install pytest, sshd for test, and rpm-build
-RUN set -ex && yum -y update && yum -y install \
+RUN set -ex && yum -y install \
python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build
RUN python3 -m pip install pytest
@@ -22,13 +13,17 @@ RUN mkdir /var/run/sshd \
&& ssh-keygen -f /root/.ssh/id_rsa -N "" \
&& mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
+ARG mscpdir="/mscp"
+
+COPY . ${mscpdir}
+
# install build dependency
RUN ${mscpdir}/scripts/install-build-deps.sh
# build
RUN cd ${mscpdir} \
&& rm -rf build \
- && cmake -B build \
+ && cmake -B build \
&& cd ${mscpdir}/build \
&& make \
&& cpack -G RPM CPackConfig.cmake \
@@ -37,3 +32,4 @@ RUN cd ${mscpdir} \
# install mscp python module
RUN cd ${mscpdir} \
&& python3 setup.py install --user
+
diff --git a/docker/ubuntu-20.04.Dockerfile b/docker/ubuntu-20.04.Dockerfile
index d00f7c8..707a79d 100644
--- a/docker/ubuntu-20.04.Dockerfile
+++ b/docker/ubuntu-20.04.Dockerfile
@@ -1,10 +1,6 @@
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
-ARG mscpdir="/mscp"
-
-COPY . ${mscpdir}
-
RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \
ca-certificates
@@ -21,6 +17,10 @@ RUN mkdir /var/run/sshd \
&& mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
+ARG mscpdir="/mscp"
+
+COPY . ${mscpdir}
+
# install build dependency
RUN ${mscpdir}/scripts/install-build-deps.sh
diff --git a/docker/ubuntu-22.04.Dockerfile b/docker/ubuntu-22.04.Dockerfile
index e2c6f47..673d880 100644
--- a/docker/ubuntu-22.04.Dockerfile
+++ b/docker/ubuntu-22.04.Dockerfile
@@ -1,10 +1,6 @@
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
-ARG mscpdir="/mscp"
-
-COPY . ${mscpdir}
-
RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \
ca-certificates
@@ -20,6 +16,9 @@ RUN mkdir /var/run/sshd \
&& ssh-keygen -f /root/.ssh/id_rsa -N "" \
&& mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
+ARG mscpdir="/mscp"
+
+COPY . ${mscpdir}
# install build dependency
RUN ${mscpdir}/scripts/install-build-deps.sh
diff --git a/scripts/install-build-deps.sh b/scripts/install-build-deps.sh
index 172d4e9..ac9e4f1 100755
--- a/scripts/install-build-deps.sh
+++ b/scripts/install-build-deps.sh
@@ -19,7 +19,7 @@ case $platform in
apt-get install -y \
gcc make cmake zlib1g-dev libssl-dev libkrb5-dev
;;
- Linux-centos* | Linux-rhel* | Linux-rocky*)
+ Linux-centos* | Linux-rhel* | Linux-rocky* | Linux-almalinux)
yum install -y \
gcc make cmake zlib-devel openssl-devel rpm-build
;;
diff --git a/scripts/print-install-deps.sh b/scripts/print-install-deps.sh
index e0e2f09..6ec70fc 100755
--- a/scripts/print-install-deps.sh
+++ b/scripts/print-install-deps.sh
@@ -14,10 +14,10 @@ case $release in
ubuntu-22.04*)
echo "libc6 (>= 2.33), libgssapi-krb5-2 (>= 1.17), libssl3 (>= 3.0.0~~alpha1), zlib1g (>= 1:1.1.4)"
;;
- centos* | rhel* | rocky*)
+ centos* | rhel* | rocky* | almalinux*)
echo "glibc crypto-policies krb5-libs openssl-libs libcom_err"
;;
*)
- echo "unsupported install dependency: $release"
+ echo "$(basename $0): unsupported install dependency: $release"
exit 1
esac