From d92d29803be86a96926ad3926fc9653f7481cef4 Mon Sep 17 00:00:00 2001 From: Eric F Crist Date: Sun, 25 Oct 2015 22:37:17 -0500 Subject: [PATCH] Repackaging to include Windows utilities needed. In the 3.0.0 release, Windows utilities were mistakenly omitted from the package. The build utility has been updated to include these files, as well as to convert the .md documentation files to html. Signed-off-by: Eric F Crist --- build/build-dist.sh | 64 ++++++++++++++++--- .../{EasyRSA Start.bat => EasyRSA-Start.bat} | 0 2 files changed, 55 insertions(+), 9 deletions(-) rename distro/windows/{EasyRSA Start.bat => EasyRSA-Start.bat} (100%) diff --git a/build/build-dist.sh b/build/build-dist.sh index 467963c..89f64be 100755 --- a/build/build-dist.sh +++ b/build/build-dist.sh @@ -1,7 +1,7 @@ #!/bin/bash # Easy-RSA 3 distribution packager: -# creates ready-to-use tarball files for Unixes +# creates ready-to-use tarball files for Unixes and a zip file for windows # operational defaults (CLI processing overrides) VERSION="git-development" @@ -45,7 +45,8 @@ main() { PV="$PRODUCT-$VERSION" dist_clean - stage_files + stage_unix + stage_win make_tar make_zip } @@ -60,26 +61,71 @@ dist_clean() { mkdir -p "$DIST_ROOT" || die "dist_clean failed to mkdir" } -# file stager -stage_files() { +# stage unix files +stage_unix() { + # make our unix stage if it doesn't exist + mkdir -p "$DIST_ROOT/unix/$PV" + # Copy files into $PV, starting with easyrsa3 as the initial root dir - src_files="easyrsa3/ Licensing/ doc/ COPYING ChangeLog README.quickstart.md" + src_files="easyrsa3/ Licensing/ COPYING ChangeLog README.quickstart.md" for f in $src_files do - cp -a "$SRC_ROOT/$f" "$DIST_ROOT/$PV" || die "failed to copy $f" + cp -a "$SRC_ROOT/$f" "$DIST_ROOT/unix/$PV" || die "failed to copy $f" done + + cp -R $SRC_ROOT/doc $DIST_ROOT/unix/$PV/ || die "failed to copy unix doc" # files not included - rm -rf "$DIST_ROOT/$PV/doc/TODO" || die "failed rm TODO" + rm -rf "$DIST_ROOT/unix/$PV/doc/TODO" || die "failed rm TODO" +} + +stage_win() { + # make our windows stage if it doesn't exist + mkdir -p "$DIST_ROOT/windows/$PV" + + # make doc dir + mkdir -p "$DIST_ROOT/windows/$PV/doc" + + for f in `ls $SRC_ROOT/doc/*.md`; + do + fname=`basename -s .md $f` + python -m markdown $f > $DIST_ROOT/windows/$PV/doc/$fname.html + done + + python -m markdown $SRC_ROOT/README.quickstart.md > $DIST_ROOT/windows/$PV/README.quickstart.html + # Copy files into $PV, starting with easyrsa3 as the initial root dir + src_files="easyrsa3/ COPYING ChangeLog" + for f in $src_files + do + cp -a "$SRC_ROOT/$f" "$DIST_ROOT/windows/$PV" || die "failed to copy $f" + done + + src_files="Licensing distro/windows/Licensing" + for f in $src_files + do + cp -R "$SRC_ROOT/$f" "$DIST_ROOT/windows/$PV" || die "failed to copy $f" + done + src_files="README-Windows.txt EasyRSA-Start.bat" + for f in $src_files + do + cp -a "$SRC_ROOT/distro/windows/$f" "$DIST_ROOT/windows/$PV" || die "failed to copy $f" + done + + # create bin dir with windows binaries + cp -R "$SRC_ROOT/distro/windows/bin" "$DIST_ROOT/windows/$PV/" || die "failed to copy bin" + + # files not included + rm -rf "$DIST_ROOT/windows/$PV/doc/TODO" || die "failed rm TODO" + } make_tar() { - (cd "$DIST_ROOT"; tar cz "$PV") > "$BIN_DEST/${PV}.tgz" || die "tar failed" + (cd "$DIST_ROOT/unix/"; tar cz "$PV") > "$BIN_DEST/${PV}.tgz" || die "tar failed" note "tarball created at: $BIN_DEST/${PV}.tgz" } make_zip() { - (cd "$DIST_ROOT"; zip -qr "../$BIN_DEST/${PV}.zip" "$PV") || die "zip failed" + (cd "$DIST_ROOT/windows/"; zip -qr "../$BIN_DEST/${PV}.zip" "$PV") || die "zip failed" note "zip file created at: $BIN_DEST/${PV}.zip" } diff --git a/distro/windows/EasyRSA Start.bat b/distro/windows/EasyRSA-Start.bat similarity index 100% rename from distro/windows/EasyRSA Start.bat rename to distro/windows/EasyRSA-Start.bat