Skip to content

Commit

Permalink
#1175, added checksum support to build processes of Slackware and Gentoo
Browse files Browse the repository at this point in the history
  • Loading branch information
pbek committed Apr 23, 2019
1 parent 2006ca1 commit 08f9782
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 40 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## 19.4.5
- more checksum generation improvements for the AUR and added checksum support
to the Launchpad Snap build process (for [#1175](https://github.com/pbek/QOwnNotes/issues/1175))
to the build processes of Launchpad Snap, Slackware and Gentoo
(for [#1175](https://github.com/pbek/QOwnNotes/issues/1175))

## 19.4.4
- fixed renaming issue on case-insensitive file-systems
Expand Down
39 changes: 21 additions & 18 deletions build-systems/gentoo/build-for-gentoo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ BRANCH=develop
PROJECT_PATH="/tmp/QOwnNotes-gentoo-$$"
CUR_DIR=$(pwd)

# use temporary checksum variable file
_QQwnNotesCheckSumVarFile="/tmp/QOwnNotes.checksum.vars"

if [[ ! -f ${_QQwnNotesCheckSumVarFile} ]]; then
echo "${_QQwnNotesCheckSumVarFile} doesn't exist. build-tuxfamily-src.sh must be run ahead of build script!"
exit 1
fi

source ${_QQwnNotesCheckSumVarFile}

# check checksum variable from build-systems/tuxfamily/build-tuxfamily-src.sh
if [ -z ${QOWNNOTES_ARCHIVE_SHA512} ]; then
echo "QOWNNOTES_ARCHIVE_SHA512 was not set!"
exit 1
fi

if [ -z ${QOWNNOTES_ARCHIVE_SIZE} ]; then
echo "QOWNNOTES_ARCHIVE_SIZE was not set!"
exit 1
fi

echo "Started the ebuild packaging process, using latest '$BRANCH' git tree"

Expand All @@ -41,24 +61,7 @@ if [ -z $QOWNNOTES_VERSION ]; then
QOWNNOTES_VERSION=`cat src/version.h | sed "s/[^0-9,.]//g"`
fi

cd ..

ARCHIVE_FILE=qownnotes-${QOWNNOTES_VERSION}.tar.xz
wget https://download.tuxfamily.org/qownnotes/src/${ARCHIVE_FILE}

ARCHIVE_SHA512=`sha512sum ${ARCHIVE_FILE} | awk '{ print $1 }'`
ARCHIVE_SIZE=`stat -c "%s" ${ARCHIVE_FILE}`

cd QOwnNotes

echo "Archive sha512: ${ARCHIVE_SHA512}"
echo "Archive size: ${ARCHIVE_SIZE}"

if [ -z ${ARCHIVE_SHA512} ]; then
echo
echo "Archive sha512 is empty!"
exit 1
fi

cd ../overlay/app-office/qownnotes/
cp ../../../QOwnNotes/build-systems/gentoo/qownnotes.ebuild .
Expand All @@ -67,7 +70,7 @@ cp ../../../QOwnNotes/build-systems/gentoo/qownnotes.ebuild .
sed -i "s/VERSION-STRING/$QOWNNOTES_VERSION/g" qownnotes.ebuild

# update the Manifest file
echo "DIST ${ARCHIVE_FILE} ${ARCHIVE_SIZE} SHA512 ${ARCHIVE_SHA512}" >> Manifest
echo "DIST ${ARCHIVE_FILE} ${QOWNNOTES_ARCHIVE_SIZE} SHA512 ${QOWNNOTES_ARCHIVE_SHA512}" >> Manifest

eBuildFile="qownnotes-$QOWNNOTES_VERSION.ebuild"
mv qownnotes.ebuild ${eBuildFile}
Expand Down
37 changes: 16 additions & 21 deletions build-systems/slackware/build-for-slackware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ BRANCH=develop
PROJECT_PATH="/tmp/QOwnNotes-slackware-$$"
CUR_DIR=$(pwd)

# use temporary checksum variable file
_QQwnNotesCheckSumVarFile="/tmp/QOwnNotes.checksum.vars"

if [[ ! -f ${_QQwnNotesCheckSumVarFile} ]]; then
echo "${_QQwnNotesCheckSumVarFile} doesn't exist. build-tuxfamily-src.sh must be run ahead of build script!"
exit 1
fi

source ${_QQwnNotesCheckSumVarFile}

# check checksum variable from build-systems/tuxfamily/build-tuxfamily-src.sh
if [ -z ${QOWNNOTES_ARCHIVE_MD5} ]; then
echo "QOWNNOTES_ARCHIVE_MD5 was not set!"
exit 1
fi

echo "Started the slackware packaging process, using latest '$BRANCH' git tree"

Expand All @@ -42,26 +57,6 @@ if [ -z $QOWNNOTES_VERSION ]; then
QOWNNOTES_VERSION=`cat src/version.h | sed "s/[^0-9,.]//g"`
fi

cd ..

ARCHIVE_FILE=qownnotes-${QOWNNOTES_VERSION}.tar.xz
wget https://download.tuxfamily.org/qownnotes/src/${ARCHIVE_FILE}

ARCHIVE_SHA512=`sha512sum ${ARCHIVE_FILE} | awk '{ print $1 }'`
ARCHIVE_MD5=`md5sum ${ARCHIVE_FILE} | awk '{ print $1 }'`
ARCHIVE_SIZE=`stat -c "%s" ${ARCHIVE_FILE}`

cd QOwnNotes

echo "Archive md5: ${ARCHIVE_MD5}"
echo "Archive size: ${ARCHIVE_SIZE}"

if [ -z ${ARCHIVE_MD5} ]; then
echo
echo "Archive md5 is empty!"
exit 1
fi

buildSystemPath="../../../QOwnNotes/build-systems/slackware"

cd ../slackbuilds/14.1/qownnotes/
Expand All @@ -75,7 +70,7 @@ sed -i "s/VERSION-STRING/$QOWNNOTES_VERSION/g" qownnotes.info
sed -i "s/VERSION-STRING/$QOWNNOTES_VERSION/g" dobuild.sh

# replace the md5sum
sed -i "s/ARCHIVE-MD5/$ARCHIVE_MD5/g" qownnotes.info
sed -i "s/ARCHIVE-MD5/$QOWNNOTES_ARCHIVE_MD5/g" qownnotes.info

path14_2="../../14.2/qownnotes"
cp qownnotes.SlackBuild ${path14_2}
Expand Down
5 changes: 5 additions & 0 deletions build-systems/tuxfamily/build-tuxfamily-src.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,23 @@ tar -cJf $archiveFile $qownnotesSrcDir
QOWNNOTES_ARCHIVE_MD5=`md5sum ${archiveFile} | awk '{ print $1 }' | tee ${archiveFile}.md5`
QOWNNOTES_ARCHIVE_SHA256=`sha256sum ${archiveFile} | awk '{ print $1 }' | tee ${archiveFile}.sha256`
QOWNNOTES_ARCHIVE_SHA512=`sha512sum ${archiveFile} | awk '{ print $1 }' | tee ${archiveFile}.sha512`
QOWNNOTES_ARCHIVE_SIZE=`stat -c "%s" ${archiveFile}`

echo ""
echo "Sums:"
echo $QOWNNOTES_ARCHIVE_MD5
echo $QOWNNOTES_ARCHIVE_SHA256
echo $QOWNNOTES_ARCHIVE_SHA512
echo ""
echo "Size:"
echo $QOWNNOTES_ARCHIVE_SIZE

# write temporary checksum variable file for the deployment scripts
_QQwnNotesCheckSumVarFile="/tmp/QOwnNotes.checksum.vars"
echo "QOWNNOTES_ARCHIVE_MD5=$QOWNNOTES_ARCHIVE_MD5" > ${_QQwnNotesCheckSumVarFile}
echo "QOWNNOTES_ARCHIVE_SHA256=$QOWNNOTES_ARCHIVE_SHA256" >> ${_QQwnNotesCheckSumVarFile}
echo "QOWNNOTES_ARCHIVE_SHA512=$QOWNNOTES_ARCHIVE_SHA512" >> ${_QQwnNotesCheckSumVarFile}
echo "QOWNNOTES_ARCHIVE_SIZE=$QOWNNOTES_ARCHIVE_SIZE" >> ${_QQwnNotesCheckSumVarFile}

remotePath="pbek@ssh.tuxfamily.org:/home/qownnotes/qownnotes-repository/src"
tuxFamilyReadme="tuxfamily-readme.md"
Expand Down

0 comments on commit 08f9782

Please sign in to comment.