Commit ef9f1284 authored by Idir Lankri's avatar Idir Lankri

Fix releasedata target of SETUP/MMakefile

We use the command apachectl to get information about the user
configuration of Apache.
parent afc393f5
......@@ -14,9 +14,8 @@ value make ~corpus_dir:corpus_dir ~sentence_no:sentence_no ~translit:translit
chunker encode text
in
let save_sentence file =
let mode = [ Open_wronly; Open_creat; Open_trunc; Open_text ] in
do
{ Web.output_channel.val := open_out_gen mode 0o666 file
{ Web.output_channel.val := open_out file
; Interface.safe_engine ()
; Gen.dump sentence metadata_file
; close_out Web.output_channel.val
......
......@@ -39,6 +39,14 @@ SKTCORPUS = #SKTCORPUS
# Path to the corpus in the server area.
SERVERCORPUS = $(SERVERPUBLICDIR)CORPUS
# Macro to extract information from the Apache configuration.
apache_config_extract = $(shell apachectl -S | grep $(1) | \
cut -d ' ' -f 2 | cut -d '=' -f 2)
# User and group under which CGIs are executed.
APACHE_USER = $(call apache_config_extract,"User")
APACHE_GROUP = $(call apache_config_extract,"Group")
# Virtual path for make
VPATH=ML
......@@ -509,8 +517,10 @@ releasedata: abrevs
fi # default language from lexicon parameter
cp -R $(DICO) $(SERVERPUBLICDIR) # hypertext Heritage dictionary
if [ $(SKTCORPUS) ]; then \
cp -RT $(SKTCORPUS) $(SERVERCORPUS); \
chown -R www-data $(SERVERCORPUS); \
mkdir -p $(SERVERCORPUS); \
cp -R $(SKTCORPUS)* $(SERVERCORPUS); \
chown -R $(APACHE_USER):$(APACHE_GROUP) \
$(SERVERCORPUS); \
fi # Sanskrit corpus
# so that cgis invocations in DICO pages are relocated consistently with config:
cd $(SERVERPUBLICDIR) && for i in `ls DICO/*.html`; do (\
......
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