Commit 4a4b8549 authored by Ophélie Gagnard's avatar Ophélie Gagnard

Allow to use custom distribution files instead of the template-generated ones.

parent 58c82a75
......@@ -4,6 +4,10 @@ set -e
source build-scripts/configuration_information.sh
cd $INITIAL_DIR
# Clean temporary directory for templates
rm -rf $DISTRIB_TEMPLATES_DIR/tmp/
rm -rf $DISTRIB_FILES_DIR
# Clean the temporary directory of distribution files for $SOFTWARE_NAME
rm -rf $DISTRIB_TEMPLATES_DIR/tmp/$SOFTWARE_NAME
# Only delete the directory is the file .toclean-stam is present in it. It should only be created
# when the directory is automatically generated so that the cleaning script can reverse the action.
if [ -e $DISTRIB_FILES_DIR/.toclean-stamp ]; then
rm -rf $DISTRIB_FILES_DIR
fi
......@@ -5,16 +5,26 @@ source build-scripts/configuration_information.sh
cd $INITIAL_DIR
# Prepare the templates in $DISTRIB_TEMPLATES_DIR/tmp/
mkdir -p $DISTRIB_TEMPLATES_DIR/tmp/debian/
sed $ALL_REGEX $DISTRIB_TEMPLATES_DIR/default.dsc.in > $DISTRIB_TEMPLATES_DIR/tmp/$SOFTWARE_AND_VERSION.dsc
TMP_TARGET=$DISTRIB_TEMPLATES_DIR/tmp/$SOFTWARE_NAME/
mkdir -p $TMP_TARGET
sed $ALL_REGEX $DISTRIB_TEMPLATES_DIR/default.dsc.in > $TMP_TARGET/$SOFTWARE_AND_VERSION.dsc
# debian directory
sed $ALL_REGEX $DISTRIB_TEMPLATES_DIR/debian_default/changelog.in > $DISTRIB_TEMPLATES_DIR/tmp/debian/changelog
sed $ALL_REGEX $DISTRIB_TEMPLATES_DIR/debian_default/control.in > $DISTRIB_TEMPLATES_DIR/tmp/debian/control
sed $ALL_REGEX $DISTRIB_TEMPLATES_DIR/debian_default/dirs.in > $DISTRIB_TEMPLATES_DIR/tmp/debian/dirs
cp -r $DISTRIB_TEMPLATES_DIR/debian_default/{compat,copyright,rules,source} $DISTRIB_TEMPLATES_DIR/tmp/debian/
mkdir -p $TMP_TARGET/debian/
sed $ALL_REGEX $DISTRIB_TEMPLATES_DIR/debian_default/changelog.in > $TMP_TARGET/debian/changelog
sed $ALL_REGEX $DISTRIB_TEMPLATES_DIR/debian_default/control.in > $TMP_TARGET/debian/control
sed $ALL_REGEX $DISTRIB_TEMPLATES_DIR/debian_default/dirs.in > $TMP_TARGET/debian/dirs
cp -r $DISTRIB_TEMPLATES_DIR/debian_default/{compat,copyright,rules,source} $TMP_TARGET/debian/
# TODO: do it with "find" instead?
#find $DISTRIB_TEMPLATES_DIR/debian_defaults/ -type f -name * -exec sed $ALL_REGEX {} + > $DISTRIB_TEMPLATES_DIR/tmp/debian/
#find $DISTRIB_TEMPLATES_DIR/debian_defaults/ -type f -name * -exec sed $ALL_REGEX {} + > $TMP_TARGET/debian/
mkdir -p $INITIAL_DIR/distribution-specifics/$SOFTWARE_NAME/
cp -r $DISTRIB_TEMPLATES_DIR/tmp/* $DISTRIB_FILES_DIR/
# If a directory for the current software does not already exist in distrubion-specifics:
# create it and copy the product of the templates in it,
# otherwise do nothing.
# The files created form the templates are still available in $TMP_TARGET
if [ ! -d $DISTRIB_FILES_DIR ]; then
mkdir -p $DISTRIB_FILES_DIR
cp -r $TMP_TARGET/* $DISTRIB_FILES_DIR/
# A file is created so that the cleaning script can reverse the action of the current script.
echo -e "This file's only purpose is to tell the cleaning script to delete this directory.\nThere should not be such file in a manually crafted directory.\n" >> $DISTRIB_FILES_DIR/.toclean-stamp
fi
This file's only purpose is to tell the cleaning script to delete this directory.
There should not be such file in a manually crafted directory.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment