From 99b5bbd19ed3e9dd1411c03a493c16ad53ae76b0 Mon Sep 17 00:00:00 2001 From: Andre lorbach Date: Tue, 29 Oct 2024 11:41:06 +0100 Subject: [PATCH] Remove unused grok dependencies and improve PPA upload script - Removed `libgrok-dev` and `libgrok1` dependencies from `debian/control` files in both `focal/master` and `focal/v8-stable` branches. - Commented out unused `rsyslog-mmgrok` package references, streamlining dependency management and package definitions. - Enhanced `uploadppa.sh` script with improvements: - Added Debian branch selection based on available directories. - Automatically generates a changelog entry when opted for. - Refined PPA upload handling, utilizing `$UPLOAD_PPA` variable. closes: https://github.com/rsyslog/rsyslog-pkg-ubuntu/issues/175 --- .github/workflows/ci.yml | 26 ++-- .../install-rsyslog-packages-from-obs.yml | 2 +- .../install-rsyslog-packages-from-ppa.yml | 4 +- rsyslog/focal/master/debian/control | 20 ++- rsyslog/focal/v8-stable/debian/control | 21 ++-- rsyslog/focal/v8-stable/debian/rules | 2 +- rsyslog/noble/v8-stable/debian/control | 21 ++-- rsyslog/noble/v8-stable/debian/rules | 2 +- scripts/uploadppa.sh | 114 +++++++++++------- 9 files changed, 120 insertions(+), 92 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a09434e..b4eb93b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: # When set to true, cancel all in-progress jobs if any matrix job fails. fail-fast: false matrix: - release: [18.04, 20.04] # , 22.04] + release: [22.04] # , 22.04] steps: - name: git checkout packging project @@ -99,45 +99,45 @@ jobs: ls -l - name: save ${{ matrix.release }} DEBs - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: debs-${{ matrix.release }} path: debs-${{ matrix.release }} - check_20_04: + check_22_04: runs-on: ubuntu-22.04 needs: build timeout-minutes: 30 steps: - - name: Download 20.04 debs + - name: Download 22.04 debs uses: actions/download-artifact@v1 with: - name: debs-20.04 + name: debs-22.04 - name: merge support libraries from OBS run: | mkdir tt cd tt - wget -q http://download.opensuse.org/repositories/home:/rgerhards/xUbuntu_20.04/Packages + wget -q http://download.opensuse.org/repositories/home:/rgerhards/xUbuntu_22.04/Packages grep Filename: Packages | grep amd64 | grep -v rsyslog \ - | sed 's/Filename: /wget -q http:\/\/download.opensuse.org\/repositories\/home:\/rgerhards\/xUbuntu_20.04\//' \ + | sed 's/Filename: /wget -q http:\/\/download.opensuse.org\/repositories\/home:\/rgerhards\/xUbuntu_22.04\//' \ > tmp source tmp # get .deb files ls -l - mv *deb $GITHUB_WORKSPACE/debs-20.04 + mv *deb $GITHUB_WORKSPACE/debs-22.04 cd .. rm -rf tt - name: prepare local repository run: | - cd debs-20.04 + cd debs-22.04 dpkg-scanpackages . /dev/null >Packages cd $GITHUB_WORKSPACE - name: check package install run: | - docker run --rm -v $GITHUB_WORKSPACE/debs-20.04:/debs ubuntu:20.04 bash -c \ + docker run --rm -v $GITHUB_WORKSPACE/debs-22.04:/debs ubuntu:22.04 bash -c \ ' echo "deb [trusted=yes] file:///debs ./" >> /etc/apt/sources.list apt-get update @@ -152,7 +152,7 @@ jobs: strategy: fail-fast: false matrix: - release: [20.04] #22.04 + release: [22.04] #22.04 steps: - name: Download ${{ matrix.release }} debs @@ -174,7 +174,7 @@ jobs: - name: get support libraries from OBS run: | cd /var/www/html/repo - wget -q -r -np -l2 -A "dsc,l*.deb" --no-host --cut-dirs 4 http://download.opensuse.org/repositories/home:/rgerhards/xUbuntu_18.04/ + wget -q -r -np -l2 -A "dsc,l*.deb" --no-host --cut-dirs 4 http://download.opensuse.org/repositories/home:/rgerhards/xUbuntu_22.04/ ls -l find . @@ -246,7 +246,7 @@ jobs: cd $GITHUB_WORKSPACE - name: save ${{ matrix.release }} DEB Repo - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: repo-${{ matrix.release }} path: /var/www/html/repo diff --git a/.github/workflows/install-rsyslog-packages-from-obs.yml b/.github/workflows/install-rsyslog-packages-from-obs.yml index 49e9cac4..e1e393aa 100644 --- a/.github/workflows/install-rsyslog-packages-from-obs.yml +++ b/.github/workflows/install-rsyslog-packages-from-obs.yml @@ -59,7 +59,7 @@ jobs: # Explicitly list supported LTS versions # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on # Note: As of 2020-06 ubuntu-latest' maps to 'ubuntu-18.04', not ubuntu-20.04 - os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04] + os: [ubuntu-22.04, ubuntu-24.04] steps: - name: Install stock Ubuntu-provided rsyslog diff --git a/.github/workflows/install-rsyslog-packages-from-ppa.yml b/.github/workflows/install-rsyslog-packages-from-ppa.yml index 6f5a024c..231fa28f 100644 --- a/.github/workflows/install-rsyslog-packages-from-ppa.yml +++ b/.github/workflows/install-rsyslog-packages-from-ppa.yml @@ -60,7 +60,7 @@ jobs: # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on # Note: 'ubuntu-latest' currently maps to 'ubuntu-18.04' #os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, ubuntu-latest] - os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04] + os: [ubuntu-22.04, ubuntu-24.04] steps: - name: Install stock Ubuntu-provided rsyslog @@ -217,7 +217,7 @@ jobs: # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on # Note: 'ubuntu-latest' currently maps to 'ubuntu-18.04' #os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, ubuntu-latest] - os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04] + os: [ubuntu-22.04, ubuntu-24.04] steps: - name: Install stock Ubuntu-provided rsyslog diff --git a/rsyslog/focal/master/debian/control b/rsyslog/focal/master/debian/control index 9d0b115e..fd299cd5 100644 --- a/rsyslog/focal/master/debian/control +++ b/rsyslog/focal/master/debian/control @@ -11,8 +11,6 @@ Build-Depends: debhelper (>= 12), librabbitmq-dev, librabbitmq4, zlib1g-dev, - libgrok-dev, - libgrok1, libmysqlclient-dev, libpq-dev, libmongoc-dev, @@ -250,14 +248,14 @@ Depends: ${shlibs:Depends}, liblognorm5 Description: Parse all fields of the message into structured data inside the JSON tree. -Package: rsyslog-mmgrok -Architecture: any -Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libgrok1, - rsyslog (= ${binary:Version}), -Description: Provides the mmgrok rsyslog plugin +#Package: rsyslog-mmgrok +#Architecture: any +#Priority: extra +#Depends: ${shlibs:Depends}, +# ${misc:Depends}, +# libgrok1, +# rsyslog (= ${binary:Version}), +#Description: Provides the mmgrok rsyslog plugin Package: rsyslog-omrabbitmq Architecture: any @@ -273,9 +271,9 @@ Architecture: any Priority: extra Depends: ${shlibs:Depends}, ${misc:Depends}, - libgrok1, rsyslog (= ${binary:Version}), Description: Provides the imdocker rsyslog plugin +# libgrok1, Package: rsyslog-improg Architecture: any diff --git a/rsyslog/focal/v8-stable/debian/control b/rsyslog/focal/v8-stable/debian/control index f0bff849..d9c315a0 100644 --- a/rsyslog/focal/v8-stable/debian/control +++ b/rsyslog/focal/v8-stable/debian/control @@ -11,7 +11,6 @@ Build-Depends: debhelper (>= 12), librabbitmq-dev, librabbitmq4, zlib1g-dev, - libgrok-dev, libmysqlclient-dev, libpq-dev, libmongoc-dev, @@ -251,15 +250,15 @@ Depends: ${shlibs:Depends}, liblognorm5 Description: Parse all fields of the message into structured data inside the JSON tree. -Package: rsyslog-mmgrok -Architecture: any -Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libgrok1, - libgrok-dev, - rsyslog (= ${binary:Version}), -Description: Provides the mmgrok rsyslog plugin +#Package: rsyslog-mmgrok +#Architecture: any +#Priority: extra +#Depends: ${shlibs:Depends}, +# ${misc:Depends}, +# libgrok1, +# libgrok-dev, +# rsyslog (= ${binary:Version}), +#Description: Provides the mmgrok rsyslog plugin Package: rsyslog-omrabbitmq Architecture: any @@ -275,9 +274,9 @@ Architecture: any Priority: extra Depends: ${shlibs:Depends}, ${misc:Depends}, - libgrok1, rsyslog (= ${binary:Version}), Description: Provides the imdocker rsyslog plugin +# libgrok1, Package: rsyslog-improg Architecture: any diff --git a/rsyslog/focal/v8-stable/debian/rules b/rsyslog/focal/v8-stable/debian/rules index fa4038e4..a9ef36ce 100755 --- a/rsyslog/focal/v8-stable/debian/rules +++ b/rsyslog/focal/v8-stable/debian/rules @@ -25,7 +25,6 @@ override_dh_auto_configure: --enable-omrabbitmq \ --enable-imczmq \ --enable-omczmq \ - --enable-mmgrok \ --enable-omuxsock \ --enable-mysql \ --enable-pgsql \ @@ -73,6 +72,7 @@ override_dh_auto_configure: --with-systemdsystemunitdir=/lib/systemd/system # +# --enable-mmgrok \ # --enable-omkafka \ # --enable-guardtime \ # --enable-gt-ksi \ diff --git a/rsyslog/noble/v8-stable/debian/control b/rsyslog/noble/v8-stable/debian/control index 6f275198..7b02caa4 100644 --- a/rsyslog/noble/v8-stable/debian/control +++ b/rsyslog/noble/v8-stable/debian/control @@ -11,7 +11,6 @@ Build-Depends: debhelper (>= 12), librabbitmq-dev, librabbitmq4, zlib1g-dev, - libgrok-dev, libtirpc-dev, libmysqlclient-dev, libpq-dev, @@ -252,15 +251,15 @@ Depends: ${shlibs:Depends}, liblognorm5 Description: Parse all fields of the message into structured data inside the JSON tree. -Package: rsyslog-mmgrok -Architecture: any -Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libgrok1, - libtirpc3, - rsyslog (= ${binary:Version}), -Description: Provides the mmgrok rsyslog plugin +#Package: rsyslog-mmgrok +#Architecture: any +#Priority: extra +#Depends: ${shlibs:Depends}, +# ${misc:Depends}, +# libgrok1, +# libtirpc3, +# rsyslog (= ${binary:Version}), +#Description: Provides the mmgrok rsyslog plugin Package: rsyslog-omrabbitmq Architecture: any @@ -276,9 +275,9 @@ Architecture: any Priority: extra Depends: ${shlibs:Depends}, ${misc:Depends}, - libgrok1, rsyslog (= ${binary:Version}), Description: Provides the imdocker rsyslog plugin +# libgrok1, Package: rsyslog-improg Architecture: any diff --git a/rsyslog/noble/v8-stable/debian/rules b/rsyslog/noble/v8-stable/debian/rules index be4a1b53..2e051cd3 100755 --- a/rsyslog/noble/v8-stable/debian/rules +++ b/rsyslog/noble/v8-stable/debian/rules @@ -26,7 +26,6 @@ override_dh_auto_configure: --enable-omrabbitmq \ --enable-imczmq \ --enable-omczmq \ - --enable-mmgrok \ --enable-omuxsock \ --enable-mysql \ --enable-pgsql \ @@ -74,6 +73,7 @@ override_dh_auto_configure: --with-systemdsystemunitdir=/lib/systemd/system # +# --enable-mmgrok \ # --enable-omkafka \ # --enable-guardtime \ # --enable-gt-ksi \ diff --git a/scripts/uploadppa.sh b/scripts/uploadppa.sh index 8c74d70e..7be1bd15 100755 --- a/scripts/uploadppa.sh +++ b/scripts/uploadppa.sh @@ -4,11 +4,8 @@ echo load config from $(dirname "$0")/config.sh source $(dirname "$0")/config.sh -#set -o xtrace # use for debugging - # If we assume the directory is named after the package, PACKAGENAME=$(basename `readlink -f .`) -#PACKAGENAME="$PACKAGENAME`cat CURR_LIBSONAME`" TARGZFILES=` ls -d */ | grep $PACKAGENAME` echo TARG: $TARGZFILES @@ -25,42 +22,77 @@ echo "--- Prep Release for $TARGZFILES" echo "-------------------------------------------" szPrepareDir=$TARGZFILES echo "Select package repository:" -select szBranch in $BRANCHES +select UPLOAD_PPA in $BRANCHES +do + echo "Select Ubuntu DIST:" + select szPlatform in $PLATFORM + do + break; + done + break; +done + +# Set Debian branch based on available subfolders in $szPlatform +DEBIAN_BRANCHES=($(ls -d $szPlatform/*/ | xargs -n 1 basename)) +if [ ${#DEBIAN_BRANCHES[@]} -eq 0 ]; then + echo "No available Debian branch subfolders found in $szPlatform" + exit 1 +fi + +echo "Select Debian branch:" +select szBranch in "${DEBIAN_BRANCHES[@]}" do - echo "Select Ubuntu DIST:" - select szPlatform in $PLATFORM - do - break; - done - break; + if [ -n "$szBranch" ]; then + break; + fi + echo "Invalid selection. Please try again." done -#szSourceBase=`basename $szSourceFile .tar.gz` -#szSourceBase=`echo $szSourceBase | sed 's/_/-/'` -# -#echo "$szSourceBase"; -#exit; +# Get VERSION from the tarball name +VERSION=$(echo $TARGZFILES | grep -oP '(?<=-)[0-9]+\.[0-9]+\.[0-9]+') + +if [ -z "$VERSION" ]; then + echo "Unable to determine version from tarball name." + exit 1 +fi -#tar xfz $szSourceFile -#mv $szSourceFile $szReplaceFile.orig.tar.gz +echo "Using PPA: $UPLOAD_PPA" +echo "Using Debian branch: $szBranch" +echo "Detected VERSION: $VERSION" -read -p "Generate Changelog entry for $szPlatform/$szBranch (y/n)? " RESULT +read -p "Generate Changelog entry for $szPlatform/$szBranch automatically (y/n)? " GEN_CHANGELOG cp -r $szPlatform/$szBranch/debian $szPrepareDir || exit 1 cd $szPrepareDir -if [ "$RESULT" == "y" ]; then - dch -D $szPlatform -i +if [ "$GEN_CHANGELOG" == "y" ]; then + read -p "Enter SUBVERSION number (default is 1): " SUBVERSION + SUBVERSION=${SUBVERSION:-1} + echo "Using SUBVERSION: $SUBVERSION" + + NEW_ENTRY="$PACKAGENAME ($VERSION-0adiscon1$szPlatform$SUBVERSION) $szPlatform; urgency=low + + * Packages for ${VERSION} on ${szPlatform} + + -- Adiscon package maintainers $(date -R)" + echo -e "$NEW_ENTRY\n$(cat debian/changelog)" > debian/changelog + echo "Automatic changelog entry added:" + echo "$NEW_ENTRY" +else + read -p "Generate Changelog entry for $szPlatform/$szBranch (y/n)? " GEN_CHANGELOG + if [ "$GEN_CHANGELOG" == "y" ]; then + dch -D $szPlatform -i + fi fi # Build Source package now! if [ -v PACKAGE_SIGNING_KEY_ID ]; then - echo "RUN debuild -S -sa -rfakeroot -k $PACKAGE_SIGNING_KEY_ID - debuild -S -sa -rfakeroot -k"$PACKAGE_SIGNING_KEY_ID" + echo "RUN debuild -S -sa -rfakeroot -k $PACKAGE_SIGNING_KEY_ID" + debuild -S -sa -rfakeroot -k"$PACKAGE_SIGNING_KEY_ID" else - echo "RUN WITHOUT KEY debuild -S -sa -rfakeroot -us -uc + echo "RUN WITHOUT KEY debuild -S -sa -rfakeroot -us -uc" debuild -S -sa -rfakeroot -us -uc fi if [ $? -ne 0 ]; then - echo "FAIL in debuild for $PACKAGENAME $VERSION on $szPlatform" + echo "FAIL in debuild for $PACKAGENAME $VERSION on $szPlatform" exit 1 fi @@ -71,15 +103,15 @@ chmod -f g+w * # files are generated in the home directory. cd .. -if [ "$RESULT" == "y" ]; then - szDebian="debian" - echo # (optional) move to a new line - read -p "Copy $szPrepareDir$szDebian folder back to $szPlatform/$szBranch/$szDebian (y/n)? " RESULT - echo # (optional) move to a new line - if [ "$RESULT" == "y" ]; then - cp -r $szPrepareDir$szDebian $szPlatform/$szBranch/ - echo "$szPrepareDir$szDebian copied back." - fi +if [ "$GEN_CHANGELOG" == "y" ]; then + szDebian="debian" + echo # (optional) move to a new line + read -p "Copy $szPrepareDir$szDebian folder back to $szPlatform/$szBranch/$szDebian (y/n)? " COPYBACK + echo # (optional) move to a new line + if [ "$COPYBACK" == "y" ]; then + cp -r $szPrepareDir$szDebian $szPlatform/$szBranch/ + echo "$szPrepareDir$szDebian copied back." + fi fi echo "-------------------------------------" @@ -93,28 +125,28 @@ echo "-------------------------------------" CHANGESFILES=`ls *.changes` if [ -z "$CHANGESFILES" ]; then - echo "FAILED: ls *.changes No changefiles found" - exit 1 + echo "FAILED: ls *.changes No changefiles found" + exit 1 fi echo "Select Changefile:" select szChangeFile in $CHANGESFILES do - break; + break; done # Upload changes to PPA now! echo "Sign $szChangeFile" debsign -k $PACKAGE_SIGNING_KEY_ID $szChangeFile -echo "Upload to ppa:adiscon/$szBranch" -dput -f ppa:adiscon/$szBranch $szChangeFile +echo "Upload to $UPLOAD_PPA" +dput -f ppa:adiscon/$UPLOAD_PPA $szChangeFile if [ $? -ne 0 ]; then - echo "FAILED dput, PPA upload to Launchpad ppa:adiscon/$szBranch for $PACKAGENAME failed" - exit 1 + echo "FAILED dput, PPA upload to Launchpad $UPLOAD_PPA for $PACKAGENAME failed" + exit 1 fi # cleanup rm -v *.changes -rm -v *.debian.tar.gz +rm -v *.debian.tar.xz # Fix filepermissions chmod -f g+w *