# Authors:
# Joni Hahkala <Joni.Hahlaka@cern.ch>
# Akos Frohner <Akos.Frohner@cern.ch>
+# John White <John.White@cern.ch>
#
-if [ "$1" == "--all" ]; then
- # CATYPES='trusted'
- # CATYPES='fake'
- # CATYPES='big'
- # CATYPES='expired'
- CATYPES='trusted fake big expired'
- ALL='yes'
- shift
-else
- CATYPES='trusted'
-fi
-
-BASEDIR=$1
-
-CONFIGDIR=$PWD/$(dirname $0)/../test
-export PASSWORD='changeit'
-DAYS=10000
-
-##PROJDIR=$PWD/$(dirname $0)/../project
-##VERSION='v'
-##VERSION=${VERSION}$(awk -F'[ =]' '/module.version/ { print $2} ' project/version.properties)
-##VERSION=${VERSION}'-'
-##VERSION=${VERSION}$(awk -F'[ =]' '/module.age/ { print $2} ' project/version.properties)
# generating the PKCS#12 format
function create_p12 {
############################## main ################################
-if [ -z "$BASEDIR" ]; then
+if [ "$1" == "--all" ]; then
+ CATYPES='trusted fake big expired'
+ ALL='yes'
+ shift
+else
+ CATYPES='trusted'
+fi
+
+#define all used dirs
+TARGETDIR=$1
+MODULEDIR=$(dirname $0)/..
+CONFIGDIR=$MODULEDIR/test
+
+export PASSWORD='changeit'
+DAYS=10000
+
+if [ -z "$TARGETDIR" ]; then
echo "Please specify the destination directory!"
exit -1
fi
-BASEDIR="$BASEDIR/share/test/certificates"
-mkdir -p $BASEDIR
-cd $BASEDIR
+mkdir -p $TARGETDIR
+
+cd $TARGETDIR
echo "Current directory now: `pwd`"
+echo "Config directory now: ${CONFIGDIR}"
+
mkdir -p tmp
-ABSBASEDIR=$(pwd)
+ABSTARGETDIR=$(pwd)
for catype in $CATYPES; do
echo "+-----------------------"
echo "| $catype"
echo "+-----------------------"
- cd $ABSBASEDIR
+ cd $ABSTARGETDIR
export CATYPE=${catype}
export CA_DIR=${catype}-ca
continue
fi
if [ -d "$CA_DIR" ]; then
- echoclean "CA directory already exists: $CA_DIR"
+ echo "CA directory already exists: $CA_DIR"
else
cp -a $CONFIGDIR/${catype}-ca $CA_DIR
fi
============================================== -->
<target name="localinit"/>
- <target name="clean"/>
+ <target name="clean">
+ <delete dir="${stage.dir}/share/test/certificates"/>
+ </target>
<target name="doc"/>
<target name="localdistbin"/>
+ <target name="dist" depends="stage"/>
+
<target name="stage" depends="envcheck">
- <exec executable="./bin/generate-test-certificates.sh">
- <arg line="${stage.dir}"/>
+ <echo>path: ${stage.dir}/share/test/certificates</echo>
+ <echo>path: "${module.dir}/bin"</echo>
+ <exec executable="${module.dir}/bin/generate-test-certificates.sh">
+ <arg line="--all ${stage.dir}/share/test/certificates"/>
</exec>
</target>