diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-09-09 12:09:59 +0200 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-09-09 12:09:59 +0200 |
commit | 60b340f898db847ab6e72ed70de6c3a81314570b (patch) | |
tree | 2a4b37a8f2d15e247058d27f7564c9b5d2091b6e | |
parent | 582eaef7e5d2ca8c883e080150c71f15f1d2b4ce (diff) |
made MANIFEST.BIN depend on configuration
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | MANIFEST.BIN.m4 (renamed from MANIFEST.BIN) | 15 | ||||
-rwxr-xr-x | actions | 3 | ||||
-rwxr-xr-x | configure | 13 | ||||
-rw-r--r-- | confninja.sh | 25 |
5 files changed, 34 insertions, 25 deletions
@@ -20,3 +20,6 @@ pm_to_blib .configured JWebmail-srcdist/ JWebmail-bindist/ +lib/JWebmail/Config.pm +.perlcriticrc +MANIFEST.BIN diff --git a/MANIFEST.BIN b/MANIFEST.BIN.m4 index 58d4dc9..fcacc01 100644 --- a/MANIFEST.BIN +++ b/MANIFEST.BIN.m4 @@ -1,10 +1,10 @@ b/extract.pl -bin/jwebmail-extract +ifelse(MAILDIR_EXTRACTOR_NAME, `extractrs', `bin/jwebmail-extract') +ifelse(MAILDIR_EXTRACTOR_NAME, `extractpy', `script/qmauth.py') +ifelse(MAILDIR_EXTRACTOR_NAME, `extractpl', `script/qmauth.pl') script/jwebmail -script/qmauth.pl -script/qmauth.py lib/JWebmail/Controller/Webmail.pm lib/JWebmail/I18N/de.pm @@ -29,9 +29,16 @@ lib/JWebmail/I18N.pm lib/JWebmail.pm public/css/my_bulma.css +ifelse(JWM_MODE, `development', `public/css/my_bulma.css.map') public/src/displayheaders.js -public/src/login_cram.js +ifelse(JWM_MODE, `development', `public/src/displayheaders.js.map') + +ifelse(JWM_LOGIN_SCHEME, `cram_md5', +`public/src/login_cram.js +ifelse(JWM_MODE, `development', `public/src/login_cram.js.map')') + public/src/rendermail.js +ifelse(JWM_MODE, `development', `public/src/rendermail.js.map') t/Extract.t t/I18N2.t @@ -11,7 +11,8 @@ dev_config () { help_text="$help_text unconfigure\t[]\tresets the build\n" unconfigure () { - rm -f .configured jwebmail.service lib/JWebmail/Config.pm + rm build.ninja lib/JWebmail/Config.pm MANIFEST.BIN + rm -r JWebmail-srcdist/ JWebmail-bindist/ } help_text="$help_text build\t[]\t\n" @@ -3,7 +3,7 @@ set -euC check_command () { - printf 'Checking for command %s ... ' "$1" + echo -n "Checking for command $1 ... " if command -v "$1" >/dev/null then echo 'found!' else echo 'not available!'; exit 1 @@ -13,7 +13,7 @@ check_command () { check_perl_deps () { for d in "$@" do - printf 'Checking for perl module %s ... ' "$d" + echo "Checking for perl module $d ... " if perl -Ilib -e "use $d;" then echo 'found!' else echo 'not available!'; exit 1 @@ -22,7 +22,7 @@ check_perl_deps () { } check_node_module () { - printf 'Checking for node module %s ... ' "$1" + echo -n "Checking for node module $1 ... " if [ -d "node_modules/$1" ] then echo 'found!' else echo 'not available!'; exit 1 @@ -32,7 +32,7 @@ check_node_module () { check_ninja_version () { ninja_file="$(mktemp -t jwm-build-XXXXXXXX)" echo "ninja_required_version = $1" >>"$ninja_file" - printf 'Checking ninja version at least %s ... ' "$1" + echo -n "Checking ninja version at least $1 ... " if ninja -f "$ninja_file" >/dev/null then echo 'sufficient!' else echo 'inadequate!'; exit 1 @@ -94,6 +94,7 @@ check_command hypnotoad check_command npm check_command esbuild check_command sass +check_command m4 check_command ninja check_ninja_version 1.11 @@ -135,6 +136,6 @@ export JWM_EXTRACTRS_DIR export JWM_READ_MODEL export JWM_MODE -sh confninja.sh >|build.ninja - perl -pe 's/@(\w+)@/$ENV{$1}/ga' lib/JWebmail/Config.pm.in >|lib/JWebmail/Config.pm +m4 -DJWM_LOGIN_SCHEME="$JWM_LOGIN_SCHEME" -DJWM_MODE="$JWM_MODE" -DMAILDIR_EXTRACTOR_NAME="$MAILDIR_EXTRACTOR_NAME" MANIFEST.BIN.m4 >|MANIFEST.BIN +sh confninja.sh >|build.ninja diff --git a/confninja.sh b/confninja.sh index f1507a0..fc5fbcf 100644 --- a/confninja.sh +++ b/confninja.sh @@ -38,7 +38,7 @@ build test: perltest END echo "confargs = $CONFARGS" -echo "build build.ninja lib/JWebmail/Config.pm: configure configure confninja.sh lib/JWebmail/Config.pm.in MANIFEST" +echo "build build.ninja lib/JWebmail/Config.pm MANIFEST.BIN: configure configure confninja.sh lib/JWebmail/Config.pm.in MANIFEST MANIFEST.BIN.m4" case "$JWM_MODE" in (development) @@ -56,17 +56,20 @@ esac case "$MAILDIR_EXTRACTOR_NAME" in (extractrs) echo "extractrs_dir = $JWM_EXTRACTRS_DIR" - printf '%s' 'build bin/jwebmail-extract: cargo' + echo -n 'build bin/jwebmail-extract: cargo' FILES_RS='arguments.rs cmd.rs error.rs main.rs rfc822.rs cmd/count.rs cmd/folders.rs cmd/list.rs cmd/raw.rs' for f in $FILES_RS do - printf '%s' " \$extractrs_dir/src/$f" + echo -n " \$extractrs_dir/src/$f" done echo ;; esac -FILES_JS='src/displayheaders.js src/login_cram.js src/rendermail.js' +FILES_JS='src/displayheaders.js src/rendermail.js' +if [ "$LOGIN_SCHEME" = cram_md5 ] +then FILES_JS="$FILES_JS src/login_cram.js" +fi for f in $FILES_JS do case "$JWM_MODE" in (development) echo "build public/$f | public/$f.map: bundle $f";; @@ -86,24 +89,18 @@ while read f do [ -n "$f" ] && echo "build JWebmail-srcdist/$f: cpy $f" done <MANIFEST -printf '%s' "build JWebmail-srcdist.tar.zstd: dist" +echo -n "build JWebmail-srcdist.tar.zstd: dist" while read f -do [ -n "$f" ] && printf '%s' " JWebmail-srcdist/$f" +do [ -n "$f" ] && echo -n " JWebmail-srcdist/$f" done <MANIFEST echo -#if [ "$JWM_MODE" = production ] -#then for f in -#do echo "build JWebmail-bindist/$f: cp $f" -#done -#fi - while read f do [ -n "$f" ] && echo "build JWebmail-bindist/$f: cpy $f" done <MANIFEST.BIN -printf '%s' "build JWebmail-bindist.tar.zstd: dist" +echo -n "build JWebmail-bindist.tar.zstd: dist" while read f -do [ -n "$f" ] && printf '%s' " JWebmail-bindist/$f" +do [ -n "$f" ] && echo -n " JWebmail-bindist/$f" done <MANIFEST.BIN echo |