mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/boypt/openssh-rpms.git
synced 2026-09-20 08:03:38 +08:00
The UOS 20 build was previously a near-duplicate spec (openssh.uos20.spec) with only the kernel-panic patch as an intentional difference. The kerberos5 and gssapi drift was unintentional and caused maintenance pain upstream changes had to be applied in two places. Now there is one spec. The kernel-panic patch is gated on a uos20 macro that compile.sh sets only when UOS20=1 is in the environment, so non-UOS builds cannot accidentally pick it up. When UOS20=1, PKGREL is prefixed with 'uos20' so the resulting RPMs are distinguishable from the standard build (e.g. PKGREL=1 -> uos201). Delete openssh.uos20.spec, document UOS20=1 in AGENTS.md.
3.7 KiB
3.7 KiB
AGENTS.md
What this repo is
Shell scripts to backport and build OpenSSH RPMs for CentOS/RHEL-like distros (EL5 through EL9, also Rocky, AlmaLinux, Anolis, UOS, openEuler, Amazon Linux).
Essential commands
# Download source tarballs into downloads/
./pullsrc.sh
# Build RPMs (auto-detects the EL version from the running system)
./compile.sh
# Force a specific EL target (useful on non-RPM build hosts like Docker/Ubuntu)
./compile.sh el7
# Docker-based build (see docker/README.md for per-version commands)
docker build -t elssh:el8 -f ./docker/Dockerfile.centos --build-arg VERSION_NUM=8 --build-arg MIRROR=0 .
docker run --rm -v .:/data elssh:el8
Configuration
version.env— source versions (OpenSSH, OpenSSL, Perl). Committed.version-local.env— user overrides likePKGREL,WITH_OPENSSL,GH_PROXY. Gitignored (*-local*).compile.shsourcesversion.envthenversion-local.env(if present), soversion-local.envwins.
Key variables
WITH_OPENSSL:0= no OpenSSL (no ssh-rsa keys),1= system OpenSSL,2= static OpenSSL (default for EL5/6/7, EL8 defaults to1)PKGREL: package release number (defaults to1)M32=1: build 32-bit RPMs (EL5 only)DOCKERBUILD=1: when set,pullsrc.shskips downloading (assumes Docker image has the sources)GH_PROXY: GitHub proxy URL for Chinese users (e.g.https://gh-proxy.com/)UOS20=1: build the UOS 20 variant — enables the kernel-panic patch (openssh-uos20-kernel-panic-fix.patch) and prefixesPKGRELwithuos20so resulting RPMs are distinguishable.
Architecture notes
- EL8 and EL9 both use
el7/as the spec directory, since they share systemd.compile.shGUESS_DIST returnsel7for all versions >= EL7. - EL6 uses
el6/(SysVinit). - EL5 uses
el5/(SysVinit, requires Perl bootstrap for building OpenSSL). WITH_OPENSSLauto-detection: forel7(which covers EL7/8/9), if system OpenSSL >= 3, defaults to1(system), otherwise2(static).compile.shhas subcommands:GETEL(print detected distro),GETRPM(list RPM paths),RPMDIR(print RPM output dir).el7/SPECS/has two spec files:openssh.spec(default, systemd) andopenssh.initv.spec(SysVinit). The default spec is selected viaSPECFILEenv var. The UOS 20 build uses the default spec withUOS20=1.docker/docker_compile.shis the entrypoint inside Docker images — it copies the appropriateel*dir to/BUILDand runscompile.shagainst it.
CI
.github/workflows/build-images.yml— manually triggered (workflow_dispatch), builds Docker images for each EL version and pushes toghcr.io..github/workflows/build-rpm.yml— runs onv*tags, builds RPMs inside Docker containers and creates a GitHub release.
Gitignore
*-local* is gitignored — version-local.env, editor swap files, etc. *.tar.gz is gitignored everywhere, including downloads/. Generated RPMs go to output/ (also gitignored).
Release workflow
When a new upstream OpenSSH version is available:
# 1. Check latest version
./pullsrc.sh --latest
# 2. Update version.env: OPENSSHSRC and OPENSSHVER
# Update README.md: "Current Version" section
# 3. Determine build number for this version
TAG_PREFIX="v${NEW_VERSION}_b"
BUILD_NUM=$(git tag | grep "^${TAG_PREFIX}" | sed "s/^${TAG_PREFIX}//" | sort -n | tail -1)
BUILD_NUM=$(( ${BUILD_NUM:-0} + 1 ))
# 4. Commit and tag
git add version.env README.md
git commit -m "bump: OpenSSH ${NEW_VERSION}_b${BUILD_NUM}"
git tag "v${NEW_VERSION}_b${BUILD_NUM}"
# 5. Push
git push origin main
git push origin "v${NEW_VERSION}_b${BUILD_NUM}"
Pushing the tag triggers .github/workflows/build-rpm.yml which builds RPMs for all EL versions and creates a GitHub release.