Skip to content
Browse files

RPM: Changelog generation

  • Loading branch information...
vookimedlo committed May 4, 2019
1 parent 78f485c commit ff4da53ae3710b3a95055b652b0bea9a91d3b2a8
Showing with 22 additions and 14 deletions.
  1. +3 −0 .gitignore
  2. +19 −14 build/cmake/unix/support/package/rpm/
@@ -64,3 +64,6 @@ debian/vookiimageviewer.substvars

@@ -5,8 +5,8 @@ set -e
cd $(dirname "$0")
readonly SCRIPT_LOCATION=`pwd`

`rm changelog/git2changelog/scripts/ || true`
ln -s ../src/ changelog/git2changelog/scripts/
cp -f changelog/git2changelog/scripts/git2changelog .
cp -f changelog/git2changelog/src/ .

readonly SNAP_GIT_RELEASE=`git rev-parse --short HEAD`
readonly SNAP_DATE_RELEASE=`date +%Y%m%d`
@@ -19,38 +19,43 @@ sed "s/^Release: .\+$/Release: ${SNAP_RELEASE}%{?dist}/" vookiimageviewer.spec >
echo -e "\n\n** Creating RPM build structure for current user"

echo -e "\n\n** Creating a changelog file - all tagged releases"
python ./changelog/git2changelog/scripts/ -b v2017.10.27 -r .
echo -e "\n\n** Fetching git tags"
git fetch -t
git tag -n

echo -e "\n\n** Creating a changelog file - latest tagged release to the head"
echo -e "\n\n** Creating a changelog file - all tagged releases up to the HEAD"
echo -e "%changelog" >> vookiimageviewer-patched.spec
python ./git2changelog -b v2017.10.27 -r ../../../../../.. >> vookiimageviewer-patched.spec

#CHANGELOG_VERSION=`head debian/changelog -n 1 | sed -e 's/^.\+(\([^)]\+\).\+/\1/' | sed -e 's/-1$//'`
#echo -e "\n\n** Current version is $CHANGELOG_VERSION"
echo -e "\n\n** Creating a changelog file - latest tagged release to the head"

CHANGELOG_VERSION=`grep 'Version:' vookiimageviewer-patched.spec | cut -d' ' -f2`
SPEC_VERSION=`grep 'Version:' vookiimageviewer-patched.spec | cut -d' ' -f2`
cd ../../../../../../../

echo -e "\n\n** Creating an original package"
tar cjvf vookiimageviewer-${CHANGELOG_VERSION}.tar.bz2 vooki-image-viewer
cp -f vookiimageviewer-${CHANGELOG_VERSION}.tar.bz2 ~/rpmbuild/SOURCES/
tar cjvf vookiimageviewer-${SPEC_VERSION}.tar.bz2 vooki-image-viewer
cp -f vookiimageviewer-${SPEC_VERSION}.tar.bz2 ~/rpmbuild/SOURCES/

echo -e "\n\n** Creating a RPM package"
rpmbuild -ba vookiimageviewer-patched.spec

echo -e "\n\n** Listing all resulting files"
ls -l ~/rpmbuild/SRPMS/
ls -Rl ~/rpmbuild/RPMS/
find ~/rpmbuild/ -type f -name "*.rpm"

echo -e "\n\n** Resulting packages information"
find ~/rpmbuild/ -type f -name "*.rpm" | xargs -n1 rpm -qi || true

echo -e "\n\n** Resulting package changelog"
find ~/rpmbuild/ -type f -name "*.rpm" | grep -v debug | grep -v '.src.' | xargs rpm -q --changelog || true

echo -e "\n\n** Installing a resulting package"
find ~/rpmbuild/ -type f -name "*.rpm" | grep -v debug | grep -v '.src.' | xargs rpm -ivh || true

echo -e "\n\n** Removing installed package"
rpm -e vookiimageviewer || true

rm git2changelog >>/dev/null 2>&1 || true
rm >>/dev/null 2>&1 || true

echo -e "\n\n** Done"

0 comments on commit ff4da53

Please sign in to comment.
You can’t perform that action at this time.