Skip to content

Commit fecf066

Browse files
committed
Fix CentOS Stream 9 build compatibility
1 parent 71025be commit fecf066

File tree

3 files changed

+92
-3
lines changed

3 files changed

+92
-3
lines changed

.github/workflows/build-rpm.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ jobs:
110110
111111
- name: Create RPM spec file
112112
run: |
113-
cat > ~/rpmbuild/SPECS/${APP_NAME}.spec << 'EOF'
113+
# Generate date for changelog
114+
CHANGELOG_DATE=$(date '+%a %b %d %Y')
115+
116+
cat > ~/rpmbuild/SPECS/${APP_NAME}.spec << EOF
114117
Name: python-gui-menu
115118
Version: %{getenv:RPM_VERSION}
116119
Release: 1%{?dist}
@@ -121,7 +124,7 @@ jobs:
121124
122125
BuildRequires: python3
123126
BuildRequires: python3-pip
124-
BuildRequires: python3-venv
127+
BuildRequires: python3-devel
125128
BuildRequires: qt5-qtbase-devel
126129
BuildRequires: desktop-file-utils
127130
@@ -222,7 +225,7 @@ jobs:
222225
fi
223226
224227
%changelog
225-
* $(date '+%a %b %d %Y') GitHub Actions <actions@github.com> - %{version}-1
228+
* $CHANGELOG_DATE GitHub Actions <actions@github.com> - %{version}-1
226229
- Automated build from GitHub Actions
227230
- Cross-platform enhanced build mode
228231
- Installation in /opt/PythonMenu directory

build-rpm.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ License: MIT
157157
URL: https://github.com/your-repo/Python_GUI_Menu
158158
Source0: %{name}-%{version}.tar.gz
159159
160+
BuildRequires: python3-devel
160161
BuildRequires: desktop-file-utils
161162
Requires: qt5-qtbase-gui
162163
Requires: qt5-qtwayland

commit-centos-fix.sh

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/bin/bash
2+
# Script to commit the CentOS Stream 9 compatibility fixes
3+
4+
set -e
5+
6+
# Colors for output
7+
GREEN='\033[0;32m'
8+
BLUE='\033[0;34m'
9+
YELLOW='\033[1;33m'
10+
NC='\033[0m'
11+
12+
print_status() {
13+
echo -e "${BLUE}[INFO]${NC} $1"
14+
}
15+
16+
print_success() {
17+
echo -e "${GREEN}[SUCCESS]${NC} $1"
18+
}
19+
20+
print_warning() {
21+
echo -e "${YELLOW}[WARNING]${NC} $1"
22+
}
23+
24+
print_status "Committing CentOS Stream 9 compatibility fixes..."
25+
26+
# Check if we have uncommitted changes
27+
if ! git diff --quiet || ! git diff --cached --quiet; then
28+
print_status "Found uncommitted changes, proceeding with commit..."
29+
30+
# Add all the modified files
31+
git add .github/workflows/build-rpm.yml
32+
git add RPM_PACKAGING.md
33+
git add build-rpm.sh
34+
git add CENTOS_STREAM9_FIX.md
35+
git add commit-centos-fix.sh
36+
37+
# Show what's being committed
38+
print_status "Files being committed:"
39+
git diff --cached --name-only
40+
41+
# Commit with descriptive message
42+
git commit -m "Fix CentOS Stream 9 build compatibility
43+
44+
- Replace python3-venv with python3-devel in dependencies
45+
- Fix changelog date generation in RPM spec file
46+
- Update documentation with CentOS Stream 9 specifics
47+
- Add troubleshooting guide for common build issues
48+
49+
Fixes GitHub Action build failure:
50+
- No match for argument: python3-venv
51+
- bad date in %changelog error
52+
53+
The venv module is built into python3 package in CentOS Stream 9,
54+
and python3-devel provides the development headers needed for
55+
PyInstaller and PyQt5 native extensions."
56+
57+
print_success "Changes committed successfully!"
58+
59+
# Ask about pushing
60+
echo ""
61+
echo "Next steps:"
62+
echo "1. Push to GitHub:"
63+
echo " git push"
64+
echo ""
65+
echo "2. Create and push a test tag:"
66+
echo " git tag v1.0.2"
67+
echo " git push origin v1.0.2"
68+
echo ""
69+
echo "3. Or manually trigger GitHub Action workflow"
70+
71+
else
72+
print_warning "No uncommitted changes found. All files are already committed."
73+
74+
# Show current status
75+
print_status "Current git status:"
76+
git status --porcelain
77+
fi
78+
79+
print_status "Summary of fixes applied:"
80+
echo "✅ Removed python3-venv dependency (not available in CentOS Stream 9)"
81+
echo "✅ Added python3-devel dependency (provides development headers)"
82+
echo "✅ Fixed changelog date generation in GitHub Action"
83+
echo "✅ Updated documentation and troubleshooting guide"
84+
echo ""
85+
print_success "Ready to test the build process!"

0 commit comments

Comments
 (0)