Fixing stuff in ynh-custom-builds and add stuff for unscd

This commit is contained in:
Alexandre Aubin 2018-05-03 02:03:29 +02:00
parent e92c239a8a
commit b50e2a4fdc

View file

@ -5,8 +5,6 @@ readonly BRANCH="testing"
readonly DISTRIB="stretch" readonly DISTRIB="stretch"
readonly DEBIAN_BRANCH="testing" readonly DEBIAN_BRANCH="testing"
readonly BUILD_MESSAGE="YunoHost custom build." readonly BUILD_MESSAGE="YunoHost custom build."
readonly YUNOHOST_PREFIX="+yunohost"
readonly YUNOHOST_REVISION="-1"
source /home/vinaigrette/config/config source /home/vinaigrette/config/config
@ -14,17 +12,33 @@ function main()
{ {
build_metronome build_metronome
build_rspamd build_rspamd
build_unscd
} }
function build_metronome() function build_metronome()
{ {
local PACKAGE="metronome" local PACKAGE="metronome"
cd $GIT_REPOS/$PACKAGE
# For some reason metronome version must include a revision ("-x") # For some reason metronome version must include a revision ("-x")
local VERSION="3.8.13${YUNOHOST_PREFIX}${YUNOHOST_REVISION}" local VERSION="$(dpkg-parsechangelog -S Version 2>/dev/null)+yunohost-1"
build $PACKAGE $VERSION build $PACKAGE $VERSION
} }
function build_unscd()
{
local PACKAGE="unscd"
cd $GIT_REPOS/$PACKAGE
local VERSION="$(dpkg-parsechangelog -S Version 2>/dev/null)+yunohost"
build $PACKAGE $VERSION
}
function build_rspamd() function build_rspamd()
{ {
@ -36,7 +50,7 @@ function build_rspamd()
# Get last tag and deduce version number to user... # Get last tag and deduce version number to user...
local LASTTAG=$(git tag --list | grep "^1." | sort -n | tail -n1) local LASTTAG=$(git tag --list | grep "^1." | sort -n | tail -n1)
local VERSION="${LASTTAG}${YUNOHOST_PREFIX}" local VERSION="${LASTTAG}+yunohost"
git checkout $LASTTAG git checkout $LASTTAG
build $PACKAGE $VERSION build $PACKAGE $VERSION
@ -49,7 +63,7 @@ function build()
# SVERSION is VERSION without the -1 at the end ... # SVERSION is VERSION without the -1 at the end ...
local SVERSION=$(echo $VERSION | tr '-' ' ' | awk '{print $1}') local SVERSION=$(echo $VERSION | tr '-' ' ' | awk '{print $1}')
cd $GIT_REPOS/$PACKAGE cd $GIT_REPOS/$PACKAGE
# Tweak the changelog temporarily # Tweak the changelog temporarily
@ -61,7 +75,7 @@ function build()
-v "${VERSION}" \ -v "${VERSION}" \
-D "${DEBIAN_BRANCH}" \ -D "${DEBIAN_BRANCH}" \
--force-distribution \ --force-distribution \
$BUILD_MESSAGE \ $BUILD_MESSAGE \
> /dev/null 2>&1 > /dev/null 2>&1
# Create temporary folder # Create temporary folder
@ -69,9 +83,9 @@ function build()
# Extract git archive a desired tag # Extract git archive a desired tag
echo "> Exporting in $TMP_FOLDER ... " echo "> Exporting in $TMP_FOLDER ... "
git ls-files | xargs tar -czf archive.tar.gz git ls-files | xargs tar -czf archive.tar.gz
cat archive.tar.gz | tar -xz -C $TMP_FOLDER cat archive.tar.gz | tar -xz -C $TMP_FOLDER
# For some reason, these wants archive named # For some reason, these wants archive named
# e.g. metronome_x.y.z+stuff.orig.tar.gz # e.g. metronome_x.y.z+stuff.orig.tar.gz
# in the parent folder... # in the parent folder...
mv archive.tar.gz $TMP_FOLDER/../${PACKAGE}_${SVERSION}.orig.tar.gz mv archive.tar.gz $TMP_FOLDER/../${PACKAGE}_${SVERSION}.orig.tar.gz