diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 658d519ffb..e31208fb48 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -79,7 +79,7 @@ Added to pants' use of PEX lockfiles. This is not a user-facing addition. #6118 #6141 #6133 #6120 #6181 #6183 #6200 #6237 #6229 #6240 #6241 #6244 #6251 #6253 #6254 #6258 #6259 #6260 #6269 #6275 #6279 #6278 #6282 #6283 #6273 #6287 #6306 #6307 - #6311 #6314 #6315 #6317 #6319 #6312 #6320 #6321 #6323 #6324 + #6311 #6314 #6315 #6317 #6319 #6312 #6320 #6321 #6323 #6324 #6325 Contributed by @cognifloyd * Build of ST2 EL9 packages #6153 Contributed by @amanda11 diff --git a/packaging/BUILD b/packaging/BUILD new file mode 100644 index 0000000000..a9b72c147e --- /dev/null +++ b/packaging/BUILD @@ -0,0 +1,81 @@ +# Relevant nFPM docs: +# - https://www.pantsbuild.org/stable/reference/targets/nfpm_deb_package +# - https://www.pantsbuild.org/stable/reference/targets/nfpm_rpm_package +# - arch: https://nfpm.goreleaser.com/goarch-to-pkg/ + +_pkg_description = """ +StackStorm Event-driven automation +Package is full standalone st2 installation including all components +in a pre-built venv. +""" +_common_pkg_metadata = dict( + package_name="st2", + description=_pkg_description, + homepage="https://stackstorm.com", + # https://jfearn.fedorapeople.org/en-US/RPM/4/html-single/RPM_Guide/index.html#idp3030720 + license="Apache-2.0", # TODO: nFPM is putting this under Copyright tag instead of License + version="", # injected by pants-plugins/release + # arch used to be "any", but that was not correct as the venv has compiled packages. + arch="amd64", # NOTE: parametrize this if adding support for arm64 or other arch. + platform="linux", +) +_maintainer = "StackStorm Engineering " # TODO: update this + + +def _distro(distro_id: str, **kwargs): + return parametrize( + distro_id, + distro_id=distro_id, + **kwargs, + ) + + +nfpm_deb_package( + name="st2.deb", + dependencies=[ + "./deb/scripts", + ], + scripts=dict( + preinstall="deb/scripts/pre-install.sh", + postinstall="deb/scripts/post-install.sh", + preremove="deb/scripts/pre-remove.sh", + postremove="deb/scripts/post-remove.sh", + # config="", + # templates="", + # rules="", + ), + maintainer=_maintainer, + fields={ + # https://www.debian.org/doc/debian-policy/ch-controlfields.html#source + # We do not have an "st2" source package, so do not include "Source". + # https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-vcs-fields + "Vcs-Git": "git://github.com/stackstorm/st2.git", + "Vcs-Browser": "https://github.com/stackstorm/st2", + }, + section="python", + priority="optional", + **_common_pkg_metadata, + **_distro("focal"), +) + +nfpm_rpm_package( + name="st2.rpm", + dependencies=[ + "./rpm/scripts", + ], + scripts=dict( + preinstall="rpm/scripts/pre-install.sh", + postinstall="rpm/scripts/post-install.sh", + preremove="rpm/scripts/pre-remove.sh", + postremove="rpm/scripts/post-remove.sh", + # pretrans="", + # posttrans="", + # verify="", + ), + vendor="The StackStorm Project", + packager=_maintainer, + # group="System/Management", # was only useful for EL 5 and earlier + **_common_pkg_metadata, + **_distro("el8", compression="xz"), + **_distro("el9", compression="zstd:default"), +)