-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated scripts to manage rhsm-certificates on ol8 and ol9 #8
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,6 @@ | |
# Prefer systemd over sysv on Fedora and RHEL 7+ | ||
%global use_systemd 0%{?fedora} || (0%{?rhel} && 0%{?rhel} >= 7) || (0%{?suse_version} && 0%{?suse_version} >= 1315) | ||
# For optional building of ostree-plugin sub package. Unrelated to systemd | ||
@@ -131,7 +132,7 @@ | ||
|
||
%global subpackages SUBPACKAGES="%{?include_syspurpose:syspurpose}" | ||
|
||
-Name: subscription-manager | ||
+Name: subscription-manager-el7 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oracle ships packages that obsolete |
||
Version: 1.24.48 | ||
Release: 1%{?dist} | ||
Summary: Tools and libraries for subscription and repository management | ||
@@ -144,18 +145,18 @@ | ||
# git clone https://github.com/candlepin/subscription-manager.git | ||
# yum install tito | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,47 @@ if [ ! -d /output/oraclelinux8 ]; then | |
mkdir /output/oraclelinux8 | ||
fi | ||
cp -rf /root/rpmbuild/RPMS/* /output/oraclelinux8/ | ||
|
||
# Clone the subscription-manager-rhsm-certificates repo | ||
cd /root || exit | ||
git clone https://github.com/candlepin/subscription-manager-rhsm-certificates.git | ||
cd /root/subscription-manager-rhsm-certificates || exit | ||
|
||
# Add tag with proper version and release | ||
git tag subscription-manager-rhsm-certificates-$RHSM_VERSION-$RHSM_RELEASE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this already be tagged upstream? I check to see what the version is by checking the UBI images for each version, so this tag should already exist. We don't want to use latest, we need to use the version used by upstream so it migrates properly. |
||
|
||
# Update Version for subscription-manager-rhsm-certificates | ||
sed -i "2s/.*/Version: $RHSM_VERSION/" ./subscription-manager-rhsm-certificates.spec | ||
|
||
# Use tito to build the tar.gz source file | ||
tito build --tag subscription-manager-rhsm-certificates-$RHSM_VERSION-$RHSM_RELEASE --tgz --offline | ||
cp "/tmp/tito/subscription-manager-rhsm-certificates-$RHSM_VERSION.tar.gz" /root/rpmbuild/SOURCES/ | ||
cp -fr /root/subscription-manager-rhsm-certificates/* /root/rpmbuild/SOURCES/ | ||
|
||
# Use rpmbuild to build and sign the binary RPMs | ||
if [ -f /gpg/key.asc ] && [ -f /gpg/passphrase ] && [ "$GPG_NAME_EMAIL" ]; then | ||
|
||
# Import and trust the GPG key | ||
gpg --import --pinentry-mode loopback --passphrase-file /gpg/passphrase < /gpg/key.asc | ||
(echo 5; echo y; echo save) | gpg --command-fd 0 --no-tty --no-greeting -q --edit-key "$(gpg --list-packets < /gpg/key.asc | awk '$1=="keyid:"{print$2;exit}')" trust | ||
|
||
SIGN="--sign" | ||
cd /root/rpmbuild || exit | ||
cat << EOF >> /root/.rpmmacros | ||
|
||
%_gpg_sign_cmd_extra_args --batch --pinentry-mode loopback --passphrase-file /gpg/passphrase | ||
%_gpg_name ${GPG_NAME_EMAIL} | ||
EOF | ||
|
||
else | ||
echo "Not signing the packages. One or more of the key.asc and passphrase files and the GPG_NAME_EMAIL environment variable are missing." | ||
fi | ||
|
||
cd /root/rpmbuild/SOURCES/ | ||
rpmbuild -bb subscription-manager-rhsm-certificates.spec --rebuild $SIGN | ||
|
||
# Copy the RPMs to the output location | ||
if [ ! -d /output/oraclelinux8 ]; then | ||
mkdir /output/oraclelinux8 | ||
fi | ||
cp -rf /root/rpmbuild/RPMS/* /output/oraclelinux8/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's 2024, not 2023. :) Also, you'll want to add another copyright line for yourself, not modify mine.