summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-09-23 23:12:45 +0200
committerJannis M. Hoffmann <jannis@fehcom.de>2023-09-23 23:12:45 +0200
commitb1aba43d6ccab69a1e8402e86f1fde06d664da3f (patch)
treeac76ad475fd84a1fcfdd59e5b018fd980e3bb917
parentd662147bbe4bccfac2307dab0ae8f62c0c36a118 (diff)
adjust systemd unit file path
-rw-r--r--confninja.sh47
1 files changed, 25 insertions, 22 deletions
diff --git a/confninja.sh b/confninja.sh
index 93df808..eb68ea1 100644
--- a/confninja.sh
+++ b/confninja.sh
@@ -31,7 +31,7 @@ rule perltest
rule perlman
command = pod2man $in >$out
- description = POD2MAN
+ description = POD2MAN $out
rule configure
command = ./configure $confargs
@@ -115,7 +115,7 @@ echo "build public: phony $PUBLIC"
# INSTALL
-install_file () { echo "build \$destdir/\$$2/$4: $1 $3/$4"; ALL_INST="$ALL_INST \$destdir/\$$2/$4"; }
+install_file () { echo "build \$destdir/$2/$4: $1 $3/$4"; ALL_INST="$ALL_INST \$destdir/$2/$4"; }
echo "destdir = $DESTDIR"
@@ -134,16 +134,16 @@ echo "man3dir = \$prefix/share/man/man3"
ALL_INST=
case "$MAILDIR_EXTRACTOR_NAME" in
- (extractrs) install_file instexec bindir bin jwebmail-extract;;
- (extractpy) install_file instexec scriptdir script extract.py;;
- (extractpl) install_file instexec scriptdir script extract.pl;;
+ (extractrs) install_file instexec \$bindir bin jwebmail-extract;;
+ (extractpy) install_file instexec \$scriptdir script extract.py;;
+ (extractpl) install_file instexec \$scriptdir script extract.pl;;
esac
-install_file instexec scriptdir script jwebmail
-install_file instexec scriptdir script testauthenticator.pl
+install_file instexec \$scriptdir script jwebmail
+install_file instexec \$scriptdir script testauthenticator.pl
while read f
-do install_file instdata perldir lib "$f"
+do install_file instdata \$perldir lib "$f"
done <<'END'
JWebmail/Controller/Webmail.pm
JWebmail/I18N/de.pm
@@ -193,21 +193,21 @@ END
#JWebmail/Plugin/I18N2/Maketext.pm
#JWebmail/Plugin/I18N2/INI.pm
-install_file instdata datadir . public/css/my_bulma.css
-[ "$JWM_MODE" = development ] && install_file instdata datadir . public/css/my_bulma.css.map
-install_file instdata datadir . public/src/displayheaders.js
-[ "$JWM_MODE" = development ] && install_file instdata datadir . public/src/displayheaders.js.map
-install_file instdata datadir . public/src/rendermail.js
-[ "$JWM_MODE" = development ] && install_file instdata datadir . public/src/rendermail.js.map
+install_file instdata \$datadir . public/css/my_bulma.css
+[ "$JWM_MODE" = development ] && install_file instdata \$datadir . public/css/my_bulma.css.map
+install_file instdata \$datadir . public/src/displayheaders.js
+[ "$JWM_MODE" = development ] && install_file instdata \$datadir . public/src/displayheaders.js.map
+install_file instdata \$datadir . public/src/rendermail.js
+[ "$JWM_MODE" = development ] && install_file instdata \$datadir . public/src/rendermail.js.map
if [ "$LOGIN_SCHEME" = cram_md5 ]
then
- install_file instdata datadir . public/src/login_cram.js
- [ "$JWM_MODE" = development ] && install_file instdata datadir . public/src/login_cram.js.map
+ install_file instdata \$datadir . public/src/login_cram.js
+ [ "$JWM_MODE" = development ] && install_file instdata \$datadir . public/src/login_cram.js.map
fi
while read f
-do install_file instdata datadir . "$f"
+do install_file instdata \$datadir . "$f"
done <<'END'
templates/displayheaders/_bot_nav.html.ep
templates/displayheaders/_folders.html.ep
@@ -226,17 +226,20 @@ templates/exception_.html.ep
templates/not_found.html.ep
END
-install_file instdata confdir . jwebmail.development.toml
-install_file instdata confdir . jwebmail.production.toml
+install_file instdata \$confdir . jwebmail.development.toml
+install_file instdata \$confdir . jwebmail.production.toml
for f in CHANGES.md LICENSE README.md
-do install_file instdata docdir . "$f"
+do install_file instdata \$docdir . "$f"
done
if [ "$JWM_INIT" = systemd ]
then
- echo "build \$destdir/\$confdir/systemd/system/jwebmail.service: instdata jwebmail.service"
- ALL_INST="$ALL_INST \$destdir/\$confdir/systemd/system/jwebmail.service"
+ case "$PREFIX" in
+ (usr) install_file instdata etc/systemd/system . jwebmail.service;;
+ (usr/local) install_file instdata usr/local/lib/systemd/system . jwebmail.service;;
+ (*) echo 'unknown prefix' >&2; exit 1;;
+ esac
fi
echo "build install: phony $ALL_INST"