Skip to content

Commit 55d3c99

Browse files
committed
Add a way to override pp_rpm_arch when building rpms
This will be used to build x86_64_v2 packages for Alma Linux.
1 parent 2dc10cf commit 55d3c99

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

etc/sudo-logsrvd.pp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@
128128
%endif
129129

130130
%if [rpm]
131+
# Used to set rpm_arch to x86_64_v2 on Alma Linux
132+
if test -n "$pp_rpm_arch_override"; then
133+
pp_rpm_arch="$pp_rpm_arch_override"
134+
fi
135+
131136
# Add distro info to release
132137
osrelease=`echo "$pp_rpm_distro" | sed -e 's/^[^0-9]*\([0-9]\{1,3\}\).*/\1/'`
133138
case "$pp_rpm_distro" in

etc/sudo-python.pp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@
8484
%endif
8585

8686
%if [rpm]
87+
# Used to set rpm_arch to x86_64_v2 on Alma Linux
88+
if test -n "$pp_rpm_arch_override"; then
89+
pp_rpm_arch="$pp_rpm_arch_override"
90+
fi
91+
8792
# Add distro info to release
8893
osrelease=`echo "$pp_rpm_distro" | sed -e 's/^[^0-9]*\([0-9]\{1,3\}\).*/\1/'`
8994
case "$pp_rpm_distro" in

etc/sudo.pp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@
149149
%endif
150150

151151
%if [rpm]
152+
# Used to set rpm_arch to x86_64_v2 on Alma Linux
153+
if test -n "$pp_rpm_arch_override"; then
154+
pp_rpm_arch="$pp_rpm_arch_override"
155+
fi
156+
152157
# Add distro info to release
153158
osrelease=`echo "$pp_rpm_distro" | sed -e 's/^[^0-9]*\([0-9]\{1,3\}\).*/\1/'`
154159
case "$pp_rpm_distro" in

scripts/mkpkg

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1818
#
1919
# Build a binary package using polypkg
20-
# Usage: mkpkg [--build-only] [--configure-only] [--debug] [--flavor flavor]
21-
# [--platform platform] [--osversion ver]
20+
# Usage: mkpkg [--arch arch] [--build-only] [--configure-only] [--debug]
21+
# [--flavor flavor] [--osversion ver] [--platform platform]
2222
#
2323

2424
# Make sure IFS is set to space, tab, newline in that order.
@@ -29,14 +29,26 @@ nl='
2929
IFS=" $nl"
3030

3131
# Parse arguments
32-
usage="usage: mkpkg [--build-only] [--configure-only] [--debug] [--flavor flavor] [--platform platform] [--osversion ver]"
32+
usage="usage: mkpkg [--arch arch] [--build-only] [--configure-only] [--debug] [--flavor flavor] [--osversion ver] [--platform platform]"
3333
debug=0
3434
flavor=vanilla
3535
crossbuild=false
3636
build_packages=true;
3737
build_sudo=true;
3838
while test $# -gt 0; do
3939
case "$1" in
40+
--arch=?*)
41+
arch=`echo "$1" | sed -n 's/^--arch=\(.*\)/\1/p'`
42+
;;
43+
--arch)
44+
arch=`echo "$1" | sed -n 's/^--arch=\(.*\)/\1/p'`
45+
if [ $# -lt 2 ]; then
46+
echo "$usage" 1>&2
47+
exit 1
48+
fi
49+
arch="$2"
50+
shift
51+
;;
4052
--debug)
4153
set -x
4254
debug=1
@@ -208,6 +220,10 @@ case "$osversion" in
208220
;;
209221
esac
210222

223+
if [ -n "$arch" ]; then
224+
# Override the default rpm arch for, e.g. x86_64_v2
225+
PPVARS="${PPVARS}${PPVARS+$space}pp_rpm_arch_override=$arch"
226+
fi
211227
if [ X"$with_selinux" = X"true" ]; then
212228
configure_opts="${configure_opts}${configure_opts+$tab}--with-selinux"
213229
fi

0 commit comments

Comments
 (0)