Skip to content

Commit

Permalink
Remove unused grok dependencies and improve PPA upload script
Browse files Browse the repository at this point in the history
- 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: #175
  • Loading branch information
alorbach committed Oct 29, 2024
1 parent b1fc2aa commit 359a09b
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 78 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ 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 }}
Expand Down Expand Up @@ -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
Expand Down
20 changes: 9 additions & 11 deletions rsyslog/focal/master/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Build-Depends: debhelper (>= 12),
librabbitmq-dev,
librabbitmq4,
zlib1g-dev,
libgrok-dev,
libgrok1,
libmysqlclient-dev,
libpq-dev,
libmongoc-dev,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
21 changes: 10 additions & 11 deletions rsyslog/focal/v8-stable/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Build-Depends: debhelper (>= 12),
librabbitmq-dev,
librabbitmq4,
zlib1g-dev,
libgrok-dev,
libmysqlclient-dev,
libpq-dev,
libmongoc-dev,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rsyslog/focal/v8-stable/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ override_dh_auto_configure:
--enable-omrabbitmq \
--enable-imczmq \
--enable-omczmq \
--enable-mmgrok \
--enable-omuxsock \
--enable-mysql \
--enable-pgsql \
Expand Down Expand Up @@ -73,6 +72,7 @@ override_dh_auto_configure:
--with-systemdsystemunitdir=/lib/systemd/system

#
# --enable-mmgrok \
# --enable-omkafka \
# --enable-guardtime \
# --enable-gt-ksi \
Expand Down
21 changes: 10 additions & 11 deletions rsyslog/noble/v8-stable/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Build-Depends: debhelper (>= 12),
librabbitmq-dev,
librabbitmq4,
zlib1g-dev,
libgrok-dev,
libtirpc-dev,
libmysqlclient-dev,
libpq-dev,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rsyslog/noble/v8-stable/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ override_dh_auto_configure:
--enable-omrabbitmq \
--enable-imczmq \
--enable-omczmq \
--enable-mmgrok \
--enable-omuxsock \
--enable-mysql \
--enable-pgsql \
Expand Down Expand Up @@ -74,6 +73,7 @@ override_dh_auto_configure:
--with-systemdsystemunitdir=/lib/systemd/system

#
# --enable-mmgrok \
# --enable-omkafka \
# --enable-guardtime \
# --enable-gt-ksi \
Expand Down
114 changes: 73 additions & 41 deletions scripts/uploadppa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 <[email protected]> $(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

Expand All @@ -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 "-------------------------------------"
Expand All @@ -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 *

0 comments on commit 359a09b

Please sign in to comment.