Fix RPM packaging
Reviewers: buda Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2756
This commit is contained in:
parent
e9ea8693fa
commit
6c69351ea1
@ -65,7 +65,7 @@ set(CPACK_DEBIAN_PACKAGE_DEPENDS "openssl (>= 1.1.0), python3 (>= 3.5.0)")
|
||||
# RPM specific
|
||||
set(CPACK_RPM_PACKAGE_URL https://memgraph.com)
|
||||
set(CPACK_RPM_PACKAGE_VERSION "${MEMGRAPH_VERSION_RPM}")
|
||||
set(CPACK_RPM_FILE_NAME "memgraph_${MEMGRAPH_VERSION_RPM}.x86_64.rpm")
|
||||
set(CPACK_RPM_FILE_NAME "memgraph-${MEMGRAPH_VERSION_RPM}-1.x86_64.rpm")
|
||||
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
|
||||
/var /var/lib /var/log /etc/logrotate.d
|
||||
/lib /lib/systemd /lib/systemd/system /lib/systemd/system/memgraph.service)
|
||||
|
@ -75,7 +75,7 @@ do
|
||||
pushd "$script_dir/$snapshots_dir/" >/dev/null
|
||||
|
||||
# remove all unnecessary directories
|
||||
for name in *; do
|
||||
for name in * .[a-zA-Z0-9]*; do
|
||||
if [ "$name" == "snapshots" ]; then
|
||||
continue
|
||||
fi
|
||||
|
@ -75,18 +75,18 @@ import sys
|
||||
#
|
||||
# The RPM package version is determined using the following two templates:
|
||||
# Release version:
|
||||
# <VERSION>-1.<OFFERING>[.<SUFFIX>]
|
||||
# <VERSION>_1.<OFFERING>[.<SUFFIX>]
|
||||
# Development version:
|
||||
# <VERSION>-0.<DISTANCE>.<SHORTHASH>.<OFFERING>[.<SUFFIX>]
|
||||
# <VERSION>_0.<DISTANCE>.<SHORTHASH>.<OFFERING>[.<SUFFIX>]
|
||||
# Examples:
|
||||
# Release version:
|
||||
# 0.50.1-1.community
|
||||
# 0.50.1-1.enterprise
|
||||
# 0.50.1-1.enterprise.veryimportantcustomer
|
||||
# 0.50.1_1.community
|
||||
# 0.50.1_1.enterprise
|
||||
# 0.50.1_1.enterprise.veryimportantcustomer
|
||||
# Development version:
|
||||
# 0.50.0-0.12.7e1eef94.community
|
||||
# 0.50.0-0.12.7e1eef94.enterprise
|
||||
# 0.50.0-0.12.7e1eef94.enterprise.veryimportantcustomer
|
||||
# 0.50.0_0.12.7e1eef94.community
|
||||
# 0.50.0_0.12.7e1eef94.enterprise
|
||||
# 0.50.0_0.12.7e1eef94.enterprise.veryimportantcustomer
|
||||
# For more documentation about the RPM package naming conventions see:
|
||||
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/
|
||||
# https://fedoraproject.org/wiki/Package_Versioning_Examples
|
||||
@ -112,8 +112,8 @@ def format_version(variant, version, offering, distance=None, shorthash=None,
|
||||
ret += "-1"
|
||||
return ret
|
||||
elif variant == "rpm":
|
||||
# <VERSION>-1.<OFFERING>[.<SUFFIX>]
|
||||
ret = "{}-1.{}".format(version, offering)
|
||||
# <VERSION>_1.<OFFERING>[.<SUFFIX>]
|
||||
ret = "{}_1.{}".format(version, offering)
|
||||
if suffix:
|
||||
ret += "." + suffix
|
||||
return ret
|
||||
@ -133,8 +133,8 @@ def format_version(variant, version, offering, distance=None, shorthash=None,
|
||||
ret += "-1"
|
||||
return ret
|
||||
elif variant == "rpm":
|
||||
# <VERSION>-0.<DISTANCE>.<SHORTHASH>.<OFFERING>[.<SUFFIX>]
|
||||
ret = "{}-0.{}.{}.{}".format(
|
||||
# <VERSION>_0.<DISTANCE>.<SHORTHASH>.<OFFERING>[.<SUFFIX>]
|
||||
ret = "{}_0.{}.{}.{}".format(
|
||||
version, distance, shorthash, offering)
|
||||
if suffix:
|
||||
ret += "." + suffix
|
||||
|
@ -27,6 +27,19 @@ BuildRequires: systemd
|
||||
|
||||
@TMP_RPM_DEBUGINFO@
|
||||
|
||||
# This is needed to prevent Python compilation errors when building the RPM
|
||||
# package
|
||||
# https://github.com/scylladb/scylla/issues/2235
|
||||
%global __os_install_post \
|
||||
/usr/lib/rpm/redhat/brp-compress \
|
||||
%{!?__debug_package:\
|
||||
/usr/lib/rpm/redhat/brp-strip %{__strip} \
|
||||
/usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \
|
||||
} \
|
||||
/usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \
|
||||
%{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \
|
||||
%{nil}
|
||||
|
||||
%define _rpmdir %_topdir/RPMS
|
||||
%define _srcrpmdir %_topdir/SRPMS
|
||||
@FILE_NAME_DEFINE@
|
||||
|
@ -27,6 +27,19 @@ BuildRequires: systemd
|
||||
|
||||
@TMP_RPM_DEBUGINFO@
|
||||
|
||||
# This is needed to prevent Python compilation errors when building the RPM
|
||||
# package
|
||||
# https://github.com/scylladb/scylla/issues/2235
|
||||
%global __os_install_post \
|
||||
/usr/lib/rpm/redhat/brp-compress \
|
||||
%{!?__debug_package:\
|
||||
/usr/lib/rpm/redhat/brp-strip %{__strip} \
|
||||
/usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \
|
||||
} \
|
||||
/usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \
|
||||
%{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \
|
||||
%{nil}
|
||||
|
||||
%define _rpmdir %_topdir/RPMS
|
||||
%define _srcrpmdir %_topdir/SRPMS
|
||||
@FILE_NAME_DEFINE@
|
||||
|
Loading…
Reference in New Issue
Block a user