diff --git a/.github/workflows/run-copr.yml b/.github/workflows/run-copr.yml index 8382b86d..20dd7bb2 100644 --- a/.github/workflows/run-copr.yml +++ b/.github/workflows/run-copr.yml @@ -3,6 +3,15 @@ name: DMS Copr Stable Release on: workflow_dispatch: inputs: + package: + description: 'Package to build (dms, dms-greeter, or both)' + required: false + default: 'dms' + type: choice + options: + - dms + - dms-greeter + - both version: description: 'Versioning (e.g., 1.0.3, leave empty for latest release)' required: false @@ -13,8 +22,27 @@ on: default: '1' jobs: - build-and-upload: + determine-packages: runs-on: ubuntu-latest + outputs: + packages: ${{ steps.set-packages.outputs.packages }} + steps: + - name: Set package list + id: set-packages + run: | + PACKAGE_INPUT="${{ github.event.inputs.package || 'dms' }}" + if [ "$PACKAGE_INPUT" = "both" ]; then + echo 'packages=["dms","dms-greeter"]' >> $GITHUB_OUTPUT + else + echo "packages=[\"$PACKAGE_INPUT\"]" >> $GITHUB_OUTPUT + fi + + build-and-upload: + needs: determine-packages + runs-on: ubuntu-latest + strategy: + matrix: + package: ${{ fromJSON(needs.determine-packages.outputs.packages) }} steps: - name: Checkout repository @@ -39,7 +67,7 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT echo "release=$RELEASE" >> $GITHUB_OUTPUT - echo "✅ Building DMS hotfix version: $VERSION-$RELEASE" + echo "✅ Building ${{ matrix.package }} version: $VERSION-$RELEASE" - name: Setup build environment run: | @@ -70,29 +98,31 @@ jobs: VERSION="${{ steps.version.outputs.version }}" RELEASE="${{ steps.version.outputs.release }}" CHANGELOG_DATE="$(date '+%a %b %d %Y')" + PACKAGE="${{ matrix.package }}" # Copy spec file from repository - cp distro/fedora/dms.spec ~/rpmbuild/SPECS/dms.spec + cp distro/fedora/${PACKAGE}.spec ~/rpmbuild/SPECS/${PACKAGE}.spec # Replace placeholders with actual values - sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" ~/rpmbuild/SPECS/dms.spec - sed -i "s/RELEASE_PLACEHOLDER/${RELEASE}/g" ~/rpmbuild/SPECS/dms.spec - sed -i "s/CHANGELOG_DATE_PLACEHOLDER/${CHANGELOG_DATE}/g" ~/rpmbuild/SPECS/dms.spec + sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" ~/rpmbuild/SPECS/${PACKAGE}.spec + sed -i "s/RELEASE_PLACEHOLDER/${RELEASE}/g" ~/rpmbuild/SPECS/${PACKAGE}.spec + sed -i "s/CHANGELOG_DATE_PLACEHOLDER/${CHANGELOG_DATE}/g" ~/rpmbuild/SPECS/${PACKAGE}.spec - echo "✅ Spec file generated for v${VERSION}-${RELEASE}" + echo "✅ Spec file generated for ${PACKAGE} v${VERSION}-${RELEASE}" echo "" echo "=== Spec file preview ===" - head -40 ~/rpmbuild/SPECS/dms.spec + head -40 ~/rpmbuild/SPECS/${PACKAGE}.spec - name: Build SRPM id: build run: | cd ~/rpmbuild/SPECS + PACKAGE="${{ matrix.package }}" - echo "🔨 Building SRPM..." - rpmbuild -bs dms.spec + echo "🔨 Building SRPM for ${PACKAGE}..." + rpmbuild -bs ${PACKAGE}.spec - SRPM=$(ls ~/rpmbuild/SRPMS/*.src.rpm | tail -n 1) + SRPM=$(ls ~/rpmbuild/SRPMS/${PACKAGE}-*.src.rpm | tail -n 1) SRPM_NAME=$(basename "$SRPM") echo "srpm_path=$SRPM" >> $GITHUB_OUTPUT @@ -106,7 +136,7 @@ jobs: - name: Upload SRPM artifact uses: actions/upload-artifact@v4 with: - name: dms-stable-srpm-${{ steps.version.outputs.version }} + name: ${{ matrix.package }}-stable-srpm-${{ steps.version.outputs.version }} path: ${{ steps.build.outputs.srpm_path }} retention-days: 90 @@ -127,23 +157,40 @@ jobs: echo "✅ Copr CLI configured" + - name: Determine Copr project + id: copr_project + run: | + PACKAGE="${{ matrix.package }}" + if [ "$PACKAGE" = "dms" ]; then + COPR_PROJECT="avengemedia/dms" + elif [ "$PACKAGE" = "dms-greeter" ]; then + COPR_PROJECT="avengemedia/danklinux" + else + echo "❌ Unknown package: $PACKAGE" + exit 1 + fi + echo "copr_project=$COPR_PROJECT" >> $GITHUB_OUTPUT + echo "✅ Copr project: $COPR_PROJECT" + - name: Upload to Copr run: | SRPM="${{ steps.build.outputs.srpm_path }}" VERSION="${{ steps.version.outputs.version }}" + COPR_PROJECT="${{ steps.copr_project.outputs.copr_project }}" + PACKAGE="${{ matrix.package }}" - echo "🚀 Uploading SRPM to avengemedia/dms..." + echo "🚀 Uploading ${PACKAGE} SRPM to ${COPR_PROJECT}..." echo " SRPM: $(basename $SRPM)" echo " Version: $VERSION" - BUILD_OUTPUT=$(copr-cli build avengemedia/dms "$SRPM" --nowait 2>&1) + BUILD_OUTPUT=$(copr-cli build "$COPR_PROJECT" "$SRPM" --nowait 2>&1) echo "$BUILD_OUTPUT" BUILD_ID=$(echo "$BUILD_OUTPUT" | grep -oP 'Build was added to.*\K[0-9]+' || echo "unknown") if [ "$BUILD_ID" != "unknown" ]; then echo "✅ Build submitted successfully!" - echo "🔗 https://copr.fedorainfracloud.org/coprs/avengemedia/dms/build/$BUILD_ID/" + echo "🔗 https://copr.fedorainfracloud.org/coprs/${COPR_PROJECT}/build/$BUILD_ID/" else echo "⚠️ Could not extract build ID, but upload may have succeeded" fi @@ -151,10 +198,13 @@ jobs: - name: Build summary if: always() run: | - echo "### 🎉 DMS Stable Build Summary" >> $GITHUB_STEP_SUMMARY + PACKAGE="${{ matrix.package }}" + COPR_PROJECT="${{ steps.copr_project.outputs.copr_project }}" + echo "### 🎉 ${PACKAGE} Stable Build Summary" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY + echo "- **Package:** ${PACKAGE}" >> $GITHUB_STEP_SUMMARY echo "- **Version:** ${{ steps.version.outputs.version }}-${{ steps.version.outputs.release }}" >> $GITHUB_STEP_SUMMARY echo "- **SRPM:** ${{ steps.build.outputs.srpm_name }}" >> $GITHUB_STEP_SUMMARY - echo "- **Project:** https://copr.fedorainfracloud.org/coprs/avengemedia/dms/" >> $GITHUB_STEP_SUMMARY + echo "- **Project:** https://copr.fedorainfracloud.org/coprs/${COPR_PROJECT}/" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "Stable release has been built and uploaded to Copr!" >> $GITHUB_STEP_SUMMARY diff --git a/distro/fedora/dms-greeter.spec b/distro/fedora/dms-greeter.spec index 3a6b00b8..56cc2e6d 100644 --- a/distro/fedora/dms-greeter.spec +++ b/distro/fedora/dms-greeter.spec @@ -1,22 +1,22 @@ -# Spec for DMS Greeter - Git builds using rpkg macros +# Spec for DMS Greeter - Stable releases %global debug_package %{nil} -%global version {{{ git_repo_version }}} +%global version VERSION_PLACEHOLDER %global pkg_summary DankMaterialShell greeter for greetd Name: dms-greeter Version: %{version} -Release: 0.git%{?dist} +Release: RELEASE_PLACEHOLDER%{?dist} Summary: %{pkg_summary} License: MIT URL: https://github.com/AvengeMedia/DankMaterialShell -VCS: {{{ git_repo_vcs }}} -Source0: {{{ git_repo_pack }}} -BuildRequires: git-core -# For the _tmpfilesdir macro. -BuildRequires: systemd-rpm-macros +Source0: dms-qml.tar.gz + +BuildRequires: gzip +BuildRequires: wget +BuildRequires: systemd-rpm-macros Requires: greetd Requires: (quickshell-git or quickshell) @@ -24,14 +24,11 @@ Requires(post): /usr/sbin/useradd Requires(post): /usr/sbin/groupadd Recommends: policycoreutils-python-utils -Recommends: setfacl +Recommends: acl Suggests: niri Suggests: hyprland Suggests: sway -# Provides: greetd-dms-greeter = %{version}-%{release} -# Conflicts: greetd-dms-greeter - %description DankMaterialShell greeter for greetd login manager. A modern, Material Design 3 inspired greeter interface built with Quickshell for Wayland compositors. @@ -41,31 +38,26 @@ compositor detection and configuration. Features session selection, user authentication, and dynamic theming. %prep -{{{ git_repo_setup_macro }}} +%setup -q -c -n dms-qml + +%build %install -# Install greeter files to shared data location (from quickshell/ subdirectory) +# Install greeter files to shared data location install -dm755 %{buildroot}%{_datadir}/quickshell/dms-greeter -cp -r quickshell/* %{buildroot}%{_datadir}/quickshell/dms-greeter/ +cp -r %{_builddir}/dms-qml/* %{buildroot}%{_datadir}/quickshell/dms-greeter/ -# Install launcher script -install -Dm755 quickshell/Modules/Greetd/assets/dms-greeter %{buildroot}%{_bindir}/dms-greeter +install -Dm755 %{_builddir}/dms-qml/Modules/Greetd/assets/dms-greeter %{buildroot}%{_bindir}/dms-greeter -# Install documentation -install -Dm644 quickshell/Modules/Greetd/README.md %{buildroot}%{_docdir}/dms-greeter/README.md +install -Dm644 %{_builddir}/dms-qml/Modules/Greetd/README.md %{buildroot}%{_docdir}/dms-greeter/README.md -# Create cache directory for greeter data -install -Dpm0644 quickshell/systemd/tmpfiles-dms-greeter.conf %{buildroot}%{_tmpfilesdir}/dms-greeter.conf +install -Dpm0644 %{_builddir}/dms-qml/systemd/tmpfiles-dms-greeter.conf %{buildroot}%{_tmpfilesdir}/dms-greeter.conf -# Install LICENSE file -install -Dm644 LICENSE %{buildroot}%{_docdir}/dms-greeter/LICENSE +install -Dm644 %{_builddir}/dms-qml/LICENSE %{buildroot}%{_docdir}/dms-greeter/LICENSE -# Create greeter home directory install -dm755 %{buildroot}%{_sharedstatedir}/greeter -# Note: We do NOT install a PAM config here to avoid conflicting with greetd package -# Instead, we verify/fix it in %post if needed - +# Note: We do NOT install a PAM config here to avoid conflicting w/greetd packages # Remove build and development files rm -rf %{buildroot}%{_datadir}/quickshell/dms-greeter/.git* rm -f %{buildroot}%{_datadir}/quickshell/dms-greeter/.gitignore @@ -73,9 +65,8 @@ rm -rf %{buildroot}%{_datadir}/quickshell/dms-greeter/.github rm -rf %{buildroot}%{_datadir}/quickshell/dms-greeter/distro %posttrans -# Clean up old installation path from previous versions (only if empty) if [ -d "%{_sysconfdir}/xdg/quickshell/dms-greeter" ]; then - # Remove directories only if empty (preserves any user-added files) + # Remove directories & preserves any user-added files rmdir "%{_sysconfdir}/xdg/quickshell/dms-greeter" 2>/dev/null || true rmdir "%{_sysconfdir}/xdg/quickshell" 2>/dev/null || true rmdir "%{_sysconfdir}/xdg" 2>/dev/null || true @@ -89,7 +80,7 @@ fi %{_tmpfilesdir}/%{name}.conf %pre -# Create greeter user/group if they don't exist (greetd expects this) +# Create greeter user/group if they don't exist getent group greeter >/dev/null || groupadd -r greeter getent passwd greeter >/dev/null || \ useradd -r -g greeter -d %{_sharedstatedir}/greeter -s /bin/bash \ @@ -127,7 +118,6 @@ chown -R greeter:greeter %{_sharedstatedir}/greeter 2>/dev/null || true # Verify PAM configuration - only fix if insufficient PAM_CONFIG="/etc/pam.d/greetd" if [ ! -f "$PAM_CONFIG" ]; then - # PAM config doesn't exist - create it cat > "$PAM_CONFIG" << 'PAM_EOF' #%PAM-1.0 auth substack system-auth @@ -149,7 +139,6 @@ PAM_EOF # Only show message on initial install [ "$1" -eq 1 ] && echo "Created PAM configuration for greetd" elif ! grep -q "pam_systemd\|system-auth" "$PAM_CONFIG"; then - # PAM config exists but looks insufficient - back it up and replace cp "$PAM_CONFIG" "$PAM_CONFIG.backup-dms-greeter" cat > "$PAM_CONFIG" << 'PAM_EOF' #%PAM-1.0 @@ -198,9 +187,8 @@ command = "/usr/bin/dms-greeter --command COMPOSITOR_PLACEHOLDER" GREETD_EOF sed -i "s|COMPOSITOR_PLACEHOLDER|$COMPOSITOR|" "$GREETD_CONFIG" CONFIG_STATUS="Created new config with $COMPOSITOR ✓" -# If config exists and doesn't have dms-greeter, update it + elif ! grep -q "dms-greeter" "$GREETD_CONFIG"; then - # Backup existing config BACKUP_FILE="${GREETD_CONFIG}.backup-$(date +%%Y%%m%%d-%%H%%M%%S)" cp "$GREETD_CONFIG" "$BACKUP_FILE" 2>/dev/null || true @@ -267,4 +255,6 @@ if [ "$1" -eq 0 ] && [ -x /usr/sbin/semanage ]; then fi %changelog -{{{ git_repo_changelog }}} +* CHANGELOG_DATE_PLACEHOLDER AvengeMedia - VERSION_PLACEHOLDER-RELEASE_PLACEHOLDER +- Stable release VERSION_PLACEHOLDER +- Built from GitHub release diff --git a/distro/scripts/copr-upload.sh b/distro/scripts/copr-upload.sh index 9f7bba78..e18b505d 100755 --- a/distro/scripts/copr-upload.sh +++ b/distro/scripts/copr-upload.sh @@ -2,226 +2,121 @@ set -euo pipefail # Build SRPM locally with correct tarball and upload to Copr -# Usage: ./create-upload-copr.sh VERSION [RELEASE] -# Example: ./create-upload-copr.sh 1.0.0 4 +# Usage: ./copr-upload.sh [PACKAGE] [VERSION] [RELEASE] +# Examples: +# ./copr-upload.sh dms 1.0.3 1 +# ./copr-upload.sh dms-greeter 1.0.3 1 + +PACKAGE="${1:-dms}" +VERSION="${2:-}" +RELEASE="${3:-1}" -VERSION="${1:-1.0.0}" -RELEASE="${2:-1}" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" -echo "Building DMS v${VERSION}-${RELEASE} SRPM for Copr..." +# Determine Copr project based on package +if [ "$PACKAGE" = "dms" ]; then + COPR_PROJECT="avengemedia/dms" +elif [ "$PACKAGE" = "dms-greeter" ]; then + COPR_PROJECT="avengemedia/danklinux" +else + echo "❌ Unknown package: $PACKAGE" + echo "Supported packages: dms, dms-greeter" + exit 1 +fi + +# Get version from latest release if not provided +if [ -z "$VERSION" ]; then + echo "📦 Determining latest version..." + VERSION=$(curl -s https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest | jq -r '.tag_name' | sed 's/^v//') + if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then + echo "❌ Failed to determine version. Please specify manually." + exit 1 + fi + echo "✅ Using latest version: $VERSION" +fi + +echo "Building ${PACKAGE} v${VERSION}-${RELEASE} SRPM for Copr..." # Setup build directories mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} cd ~/rpmbuild/SOURCES -# Create the corrected QML tarball locally -echo "Creating QML tarball with assets..." -TEMP_DIR=$(mktemp -d) -cd "$REPO_ROOT" - -# Copy quickshell contents to temp -cp -r quickshell/* "$TEMP_DIR/" - -# Copy root LICENSE and CONTRIBUTING.md -cp LICENSE CONTRIBUTING.md "$TEMP_DIR/" - -# Copy root assets directory (this is what was missing!) -cp -r assets "$TEMP_DIR/" - -# Create tarball -cd "$TEMP_DIR" -tar --exclude='.git' \ - --exclude='.github' \ - --exclude='*.tar.gz' \ - -czf ~/rpmbuild/SOURCES/dms-qml.tar.gz . - -cd ~/rpmbuild/SOURCES -echo "Created dms-qml.tar.gz with md5sum: $(md5sum dms-qml.tar.gz | awk '{print $1}')" -rm -rf "$TEMP_DIR" - -# Generate spec file -echo "Generating spec file..." -CHANGELOG_DATE="$(date '+%a %b %d %Y')" - -cat >~/rpmbuild/SPECS/dms.spec <<'SPECEOF' -# Spec for DMS stable releases - Built locally - -%global debug_package %{nil} -%global version VERSION_PLACEHOLDER -%global pkg_summary DankMaterialShell - Material 3 inspired shell for Wayland compositors - -Name: dms -Version: %{version} -Release: RELEASE_PLACEHOLDER%{?dist} -Summary: %{pkg_summary} - -License: MIT -URL: https://github.com/AvengeMedia/DankMaterialShell - -Source0: dms-qml.tar.gz - -BuildRequires: gzip -BuildRequires: wget -BuildRequires: systemd-rpm-macros - -Requires: (quickshell or quickshell-git) -Requires: accountsservice -Requires: dms-cli = %{version}-%{release} -Requires: dgop - -Recommends: cava -Recommends: cliphist -Recommends: danksearch -Recommends: matugen -Recommends: wl-clipboard -Recommends: NetworkManager -Recommends: qt6-qtmultimedia -Suggests: qt6ct - -%description -DankMaterialShell (DMS) is a modern Wayland desktop shell built with Quickshell -and optimized for the niri and hyprland compositors. Features notifications, -app launcher, wallpaper customization, and fully customizable with plugins. - -Includes auto-theming for GTK/Qt apps with matugen, 20+ customizable widgets, -process monitoring, notification center, clipboard history, dock, control center, -lock screen, and comprehensive plugin system. - -%package -n dms-cli -Summary: DankMaterialShell CLI tool -License: MIT -URL: https://github.com/AvengeMedia/DankMaterialShell - -%description -n dms-cli -Command-line interface for DankMaterialShell configuration and management. -Provides native DBus bindings, NetworkManager integration, and system utilities. - -%prep -%setup -q -c -n dms-qml - -# Download architecture-specific binaries during build -case "%{_arch}" in - x86_64) - ARCH_SUFFIX="amd64" - ;; - aarch64) - ARCH_SUFFIX="arm64" - ;; - *) - echo "Unsupported architecture: %{_arch}" - exit 1 - ;; -esac - -wget -O %{_builddir}/dms-cli.gz "https://github.com/AvengeMedia/DankMaterialShell/releases/download/v%{version}/dms-distropkg-${ARCH_SUFFIX}.gz" || { - echo "Failed to download dms-cli for architecture %{_arch}" - exit 1 -} -gunzip -c %{_builddir}/dms-cli.gz > %{_builddir}/dms-cli -chmod +x %{_builddir}/dms-cli - -%build - -%install -install -Dm755 %{_builddir}/dms-cli %{buildroot}%{_bindir}/dms - -install -d %{buildroot}%{_datadir}/bash-completion/completions -install -d %{buildroot}%{_datadir}/zsh/site-functions -install -d %{buildroot}%{_datadir}/fish/vendor_completions.d -%{_builddir}/dms-cli completion bash > %{buildroot}%{_datadir}/bash-completion/completions/dms || : -%{_builddir}/dms-cli completion zsh > %{buildroot}%{_datadir}/zsh/site-functions/_dms || : -%{_builddir}/dms-cli completion fish > %{buildroot}%{_datadir}/fish/vendor_completions.d/dms.fish || : - -install -Dm644 assets/systemd/dms.service %{buildroot}%{_userunitdir}/dms.service - -install -Dm644 assets/dms-open.desktop %{buildroot}%{_datadir}/applications/dms-open.desktop -install -Dm644 assets/danklogo.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/danklogo.svg - -install -dm755 %{buildroot}%{_datadir}/quickshell/dms -cp -r %{_builddir}/dms-qml/* %{buildroot}%{_datadir}/quickshell/dms/ - -rm -rf %{buildroot}%{_datadir}/quickshell/dms/.git* -rm -f %{buildroot}%{_datadir}/quickshell/dms/.gitignore -rm -rf %{buildroot}%{_datadir}/quickshell/dms/.github -rm -rf %{buildroot}%{_datadir}/quickshell/dms/distro - -echo "%{version}" > %{buildroot}%{_datadir}/quickshell/dms/VERSION - -%posttrans -if [ -d "%{_sysconfdir}/xdg/quickshell/dms" ]; then - rmdir "%{_sysconfdir}/xdg/quickshell/dms" 2>/dev/null || true - rmdir "%{_sysconfdir}/xdg/quickshell" 2>/dev/null || true - rmdir "%{_sysconfdir}/xdg" 2>/dev/null || true +# Download source tarball from GitHub releases +echo "📦 Downloading source tarball for v${VERSION}..." +if [ ! -f ~/rpmbuild/SOURCES/dms-qml.tar.gz ]; then + wget -O ~/rpmbuild/SOURCES/dms-qml.tar.gz "https://github.com/AvengeMedia/DankMaterialShell/releases/download/v${VERSION}/dms-qml.tar.gz" || { + echo "❌ Failed to download dms-qml.tar.gz for v${VERSION}" + exit 1 + } + echo "✅ Source tarball downloaded" +else + echo "✅ Source tarball already exists" fi -# Signal running DMS instances to reload -pkill -USR1 -x dms >/dev/null 2>&1 || : -%files -%license LICENSE -%doc README.md CONTRIBUTING.md -%{_datadir}/quickshell/dms/ -%{_userunitdir}/dms.service -%{_datadir}/applications/dms-open.desktop -%{_datadir}/icons/hicolor/scalable/apps/danklogo.svg +# Copy and prepare spec file +echo "📝 Preparing spec file..." +SPEC_FILE="$REPO_ROOT/distro/fedora/${PACKAGE}.spec" +if [ ! -f "$SPEC_FILE" ]; then + echo "❌ Spec file not found: $SPEC_FILE" + exit 1 +fi -%files -n dms-cli -%{_bindir}/dms -%{_datadir}/bash-completion/completions/dms -%{_datadir}/zsh/site-functions/_dms -%{_datadir}/fish/vendor_completions.d/dms.fish +cp "$SPEC_FILE" ~/rpmbuild/SPECS/"${PACKAGE}".spec -%changelog -* CHANGELOG_DATE_PLACEHOLDER AvengeMedia - VERSION_PLACEHOLDER-1 -- Stable release VERSION_PLACEHOLDER -- Built locally with corrected tarball -SPECEOF +# Replace placeholders in spec file +CHANGELOG_DATE="$(date '+%a %b %d %Y')" +sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" ~/rpmbuild/SPECS/"${PACKAGE}".spec +sed -i "s/RELEASE_PLACEHOLDER/${RELEASE}/g" ~/rpmbuild/SPECS/"${PACKAGE}".spec +sed -i "s/CHANGELOG_DATE_PLACEHOLDER/${CHANGELOG_DATE}/g" ~/rpmbuild/SPECS/"${PACKAGE}".spec -sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" ~/rpmbuild/SPECS/dms.spec -sed -i "s/RELEASE_PLACEHOLDER/${RELEASE}/g" ~/rpmbuild/SPECS/dms.spec -sed -i "s/CHANGELOG_DATE_PLACEHOLDER/${CHANGELOG_DATE}/g" ~/rpmbuild/SPECS/dms.spec +echo "✅ Spec file prepared for ${PACKAGE} v${VERSION}-${RELEASE}" # Build SRPM -echo "Building SRPM..." +echo "🔨 Building SRPM..." cd ~/rpmbuild/SPECS -rpmbuild -bs dms.spec +rpmbuild -bs "${PACKAGE}".spec -SRPM=$(ls ~/rpmbuild/SRPMS/dms-"${VERSION}"-*.src.rpm | tail -n 1) +SRPM=$(ls ~/rpmbuild/SRPMS/"${PACKAGE}"-"${VERSION}"-*.src.rpm | tail -n 1) if [ ! -f "$SRPM" ]; then - echo "Error: SRPM not found!" + echo "❌ Error: SRPM not found!" + echo "Expected pattern: ${PACKAGE}-${VERSION}-*.src.rpm" + ls -la ~/rpmbuild/SRPMS/ || true exit 1 fi -echo "SRPM built successfully: $SRPM" +echo "✅ SRPM built successfully: $SRPM" # Check if copr-cli is installed if ! command -v copr-cli &>/dev/null; then echo "" - echo "copr-cli is not installed. Install it with:" + echo "⚠️ copr-cli is not installed. Install it with:" echo " pip install copr-cli" echo "" echo "Then configure it with your Copr API token in ~/.config/copr" echo "" echo "SRPM is ready at: $SRPM" - echo "Upload manually with: copr-cli build avengemedia/dms $SRPM" + echo "Upload manually with: copr-cli build $COPR_PROJECT $SRPM" exit 0 fi # Upload to Copr echo "" -echo "Uploading to Copr..." -if copr-cli build avengemedia/dms "$SRPM" --nowait; then +echo "🚀 Uploading to Copr..." +if copr-cli build "$COPR_PROJECT" "$SRPM" --nowait; then echo "" - echo "Build submitted successfully! Check status at:" - echo "https://copr.fedorainfracloud.org/coprs/avengemedia/dms/builds/" + echo "✅ Build submitted successfully!" + echo "📊 Check status at:" + echo " https://copr.fedorainfracloud.org/coprs/${COPR_PROJECT}/builds/" + echo "" + echo "📦 SRPM location: $SRPM" else echo "" - echo "Copr upload failed. You can manually upload the SRPM:" - echo " copr-cli build avengemedia/dms $SRPM" + echo "❌ Copr upload failed. You can manually upload the SRPM:" + echo " copr-cli build $COPR_PROJECT $SRPM" echo "" echo "Or upload via web interface:" - echo " https://copr.fedorainfracloud.org/coprs/avengemedia/dms/builds/" + echo " https://copr.fedorainfracloud.org/coprs/${COPR_PROJECT}/builds/" echo "" echo "SRPM location: $SRPM" exit 1