preinstall-usr-local.bash.
<syntaxhighlight>
VERSION=220313
sudo install -d /usr/local/datas
sudo cp ~/Add_appendix /datas/*.dat /usr/local/datas/.
ls /usr/local/datas
</syntaxhighlight>
script addapendix.sh 22/03/10.
VERSION=220310
TEXTDOMAIN=addappendix
TEXTDOMAINDIR="/usr/share/locale"
export TEXTDOMAINDIR
. gettext.sh
 if test -z $1
 then 
 echo -n -e "\033[31m"
 echo -n $"No parameter. addappendix [ full URL of book | ? | --v ]"
 echo -e "\033[0m"
 exit -1
 fi
 if [ "$1" = "?" ]
 then 
 echo -n -e "\033[32m"
 echo $"Syntax: addappendix [ full URL of book | ? | --v ]"
 echo $" Example 1 : addappendix https://en.wikibooks.org/wiki/Wikibooks:Collections/Guide_to_Unix"
 echo $" Example 2 : addappendix https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel" 
 echo -e "\033[0m"
 exit 0
 fi
 if [ "$1" = "--v" ]
 then
 echo -n -e "\033[32m"
 echo -n $"addapendix version : $VERSION"
 echo -e "\033[0m"
 exit 0
 fi
 if echo $1 | grep wikibooks.org/wiki 
 then 
 echo -n -e "\033[32m" 
 echo -n $" is a wiki-book"
 echo -e "\033[0m"
 else
 echo -n -e "\033[31m" 
 echo -n $"$1 is not a wiki-book on wikibooks.org"
 echo -e "\033[0m"
 exit -1
 fi
 if wget --spider $1 2>/dev/null; then
 echo -n -e "\033[32m" 
 echo -n $"File $1 is found"
 echo -e "\033[0m" 
 else
 echo -n -e "\033[31m" 
 echo -n $"File $1 is not found"
 echo -e "\033[0m"
 exit -1
 fi
 echo $1 | awk -F"/" ' { print $NF }' > bookname.txt
 read Bookname<bookname.txt
 echo; echo -n -e "\033[1;32m" 
 echo -n $"Book name : $Bookname"
 echo -e "\033[0m"
 echo $1 | awk -F"/" ' { print $3 }' > site.txt
 read Site<site.txt
 echo; echo -n -e "\033[1;32m" 
 echo -n $"Site name : $Site"
 echo -e "\033[0m"
 echo $1 | awk -F"/" ' { print $5 }' > compilations.txt
 read Compilations<compilations.txt
 echo -n -e "\033[1;32m" 
 echo -n $"Compilations name: $Compilations"
 echo -e "\033[0m"
 if [ "$Compilations" = "Wikilivres:Compilations" ]; then Suffix=compiled; fi
 if [ "$Compilations" = "Wikibooks:Collections" ]; then Suffix=compiled; fi
 if test -z $Suffix; then Suffix=compiled; fi
 echo -n -e "\033[1;32m" 
 echo "Suffix = $Suffix"
 echo -e "\033[0m"
 install -d ~/Add_appendix/books/$Bookname
 Projectdir=~/Add_appendix/books/$Bookname
 Workdir=~/Add_appendix
 mkdir -p $Workdir/temp
 mkdir -p $Projectdir/resources/TMP
 cd $Projectdir/resources/TMP
 rm -Rf $Projectdir/resources/TMP/* 2> /dev/null
 wget -N $1 -o $Workdir/temp/wget-log-télécharger.txt
 ls -1 > ../filename.txt
 read Filename<../filename.txt
 if [ "$Filename" = "filename.txt" ]; then echo $"line 113: \$Filename = filename.txt error, exit -1"; exit -1; fi
 rm ../filename.txt
 cd ..
 if test -e $Filename; then rm -R $Filename; fi
 if test -d $Filename 2>/dev/null
 then rm -R $Filename 2>/dev/null
 fi 
 mv TMP $Filename
 cd $Filename
 cat $Filename|grep "<li><a href=">extract-li
 cat extract-li | sed "s/title=\"/\ngrep -v "<li><a href=" |sed "s/\">/\n/g"|grep -v "</a>\|Cat\|<div" >extract-li1
 cat $Filename|grep "<dd><a href=">extract-dd
 cat extract-dd | sed "s/title=\"/\ngrep -v "<dd><a href=" |sed "s/\">/\n/g"|grep -v "</a>" >extract-dd1
 cat extract-dd1 > $Bookname.$Suffix
 cat extract-li1 » $Bookname.$Suffix
 cp $Bookname.$Suffix $Projectdir/$Bookname.$Suffix
 if test -e $Projectdir/$Bookname.$Suffix
 then
 echo -n -e "\033[1;32m" 
 echo -n "$Bookname.$Suffix : "
 echo -e "\033[0m"
 cat $Projectdir/$Bookname.$Suffix
 fi
 echo; echo "Dowload $1"
 wget -r -linf -k -p -E "$1" -o $Workdir/temp/wget-log-télécharger.txt
 if test -e /usr/local/datas/content_cleaner.dat; then Datasdir=/usr/local/datas
 else
 echo -n -e "\033[12;31m"
 echo -n $"content_cleaner.dat not found in /usr/local/datas"
 echo -e "\33[0m"
 exit -1
 fi
 if test -e "$Projectdir/$Bookname.compiled"
 then 
 echo $" Found Compiled page : $Projectdir/$Bookname.compiled"; echo
 echo " Create $Projectdir/$Bookname.list with :"; echo " $Projectdir/$Bookname.compiled"; echo
 cat "$Projectdir/$Bookname.compiled" | sed -f $Datasdir/content_cleaner.dat > $Projectdir/$Bookname.compiled.cleaned
 cat "$Projectdir/$Bookname.compiled.cleaned" | grep -v '=' | sed "s/\[\[/https:\/\/$Site\/wiki\//g" | sed "s/\]\]//g" | grep "wiki" | tr ' ' '_' | cut -d '|' -f1 > $Projectdir/$Bookname.list
 cat "$Projectdir/$Bookname.compiled.cleaned" | grep -v '=' | sed "s/\[\| sed "s/\\]//g" | cut -d '|' -f1 > $Projectdir/$Bookname.prj
 fi
 cat $Projectdir/$Bookname.prj
 cd $Projectdir
 echo $"download all sub-directories of the book '$Bookname'"
 wget -r -linf -k -p -E -i $Bookname.list -o $Workdir/temp/wget-log-download.txt
 echo "----------"
 echo "create the complete concatenated hierarchy of the directories of the book '$Bookname'"
 cat $Projectdir/$Bookname.list | sed "s/https:\/\///g" | sed "s/\ /\\\ /g" | tr '\n' ',' > $Projectdir/$Bookname.locale.list
 echo " Concatenated local list $Projectdir/$Bookname.locale.list :"
 echo ""
 cat $Projectdir/$Bookname.locale.list
 echo "----------" 
 echo
 echo $"Create the page from the local link to the main page, 'the book'"
 cat $Projectdir/$Bookname.locale.list | sed "s/ /\\ /g" | cut -d ',' -f1 > $Projectdir/$Bookname.mainPage
 echo "----------"
 read mainPage < $Projectdir/$Bookname.mainPage
 echo "variable mainPage = $mainPage" 
 #T cat $Projet/$1.mainPage | awk -F"/" '{print NF}' > nbchamps
 #T read NbChamps < nbchamps
 #T echo "Variable NbChamps = $NbChamps"
 echo "----------"
 ls "$mainPage" | sed "s/.html//g" > $Projectdir/$Bookname.dirs
 echo "sub-working-diectories : "
 cat $Projectdir/$Bookname.dirs
 echo "----------" 
 while read line
 do
 echo "$line".html | sed "s/https:\/\///g" | tr '\n' ' ' > source
 read Source < source
 echo "Source = $Source"
 echo "$line" | awk -F"/" '{ print $NF }'| tr '\n' '/' > destination 
 read dir < destination
 mkdir $dir
 echo "$line".html | awk -F"/" '{ print $NF }' » destination
 read Destination < destination
 echo "Destination = $Destination"
 echo $"Copy : 'cp -f ./$Source $Destination'"
 cp -f "./$Source" "$Destination"
 done < $Projectdir/$Bookname.list
 rm source ; rm destination
 PageSclt=$Projectdir/$Bookname.sclt
 echo "----------"
 echo "$(gettext '= Appendix = ')" > $PageSclt
 echo » $PageSclt
 echo "$(gettext '== References == ')" » $PageSclt
 echo "$(gettext '<references /> ')" » $PageSclt
 echo » $PageSclt
 echo "<div style='page-break-before:always'></div>" » $PageSclt
 echo "$(gettext '== Contents == ')" » $PageSclt
 echo "<div style='font-zize:85%'>" » $PageSclt
 cat $Projectdir/$Bookname.list | tr ' ' '_' | tr '\n' '%' | sed "s/%/\n\n/g" » $PageSclt
 echo "</div>" » $PageSclt
 echo "$(gettext '=== Source for this edition === ')" » $PageSclt
 echo "<div style='font-zize:85%';>" » $PageSclt
 echo -n "https://" » $PageSclt
 cat $Projectdir/$Bookname.mainPage | sed "s/\\\ /_/g" » $PageSclt
 echo "</div>" » $PageSclt
 echo " " » $PageSclt
 echo "<div style='page-break-before:always'></div>" » $PageSclt
 echo "$(gettext '== Articles Sources, and Contributors == ')" » $PageSclt
 echo -n "<span style='font-zize:85%';>" » $PageSclt
 echo "$(gettext 'The "sources" listed for each article provide more detailled licencing information including the copyright status, the copyleft owner and the license conditions..</span> ')" » $PageSclt
 echo " " » $PageSclt
 echo "<div style='font-zize:72%';>" » $PageSclt
echo "----------"
 cat $Projectdir/$Bookname.list | awk -F"/" '{ print $NF }' > $Projectdir/$Bookname.pj
 Pjlist=$Projectdir/$Bookname.pj
 echo "Pjlist : "$PjList
 while read line
 do 
 echo
 echo $" line read = $line"
 echo
 mkd -pws '**' "$line/$line.html" $Projectdir/$line/$line.tmp | tr ',' '\n' > $Projectdir/$line/$line.str
 echo "*** References : articles, src, lic, contrib. "
 if [ $line != $Bookname ]
 then 
 echo "$line" » $PageSclt
 fi
 echo ""$line"" > $Projectdir/$line/$line.article
 cat $Projectdir/$line/$line.article
 echo -n $", "source : "https://"$Site"/w/index.php?oldid=" > $Projectdir/$line/$line.RevisionId
 cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e wgRevisionId | tr -d ':' | sed "s/\"/%/g" | cut -d'%' -f3 » $Projectdir/$line/$line.RevisionId
 if [ "$line" != "$Bookname" ]
 then 
 cat $Projectdir/$line/$line.RevisionId » $PageSclt
 fi
 cat $Projectdir/$line/$line.RevisionId
 echo -n $", "license : "" > $Projectdir/$line/$line.license
 #T cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e license | sed "s/\"\//%\//g" | cut -d'%' -f4 » $Projectdir/$line/$line.license
 cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e license | sed "s/\"\//%\//g" | tr '"' '%' | cut -d'%' -f4 » $Projectdir/$line/$line.license
 #T cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e license | sed "s/\"\//%\//g" | cut -d'%' -f2 | sed "s/\/\//https:\/\//g" » $Projectdir/$line/$line.license
 if [ $line != $Bookname ]
 then 
 cat $Projectdir/$line/$line.license » $PageSclt
 fi
 cat $Projectdir/$line/$line.license
 #P spécial pour bas de page fr ## 
 cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e footer-info-copyright | sed "s/\"\//%\//g" | tr '"' '%' | cut -d'%' -f4 > $Projectdir/$line/$line.license
 echo -n $", "authors : "" > $Projectdir/$line/$line.author 
 cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e wgRelevantUserName | sed "s/\"/%/g" | cut -d'%' -f4 > tmp
 if test -s tmp 
 then cat tmp » $Projectdir/$line/$line.author; rm tmp
 else 
 echo $"Author not found ! " » $Projectdir/$line/$line.author
 if wget --spider https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/$line 2>/dev/null
 then
 echo "$(gettext '. -see :') https://xtools.wmflabs.org/articleinfo/$Sitename/$line" » $Projectdir/$line/$line.author
 elif wget --spider https://xtools.wmflabs.org/articleinfo/$Sitename/$Bookname/$line 2>/dev/null
 then 
 echo "$(gettext '. -see :') https://xtools.wmflabs.org/articleinfo/$Sitename/$Bookname/$line" » $Projectdir/$line/$line.author
 else 
 cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e wgRelevantPageName | sed "s/\"/%/g" | cut -d'%' -f4 > tmp
 if test -s tmp
 then
 #T echo "&action=history" » tmp
 echo -n "$(gettext '. -see "contributors" in book, history page of ')" » $Projectdir/$line/$line.author
 cat tmp » $Projectdir/$line/$line.author; rm tmp
 fi
 fi
 fi
 #https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/Guide_to_Unix/Introduction
 if [ $line != $Bookname ]
 then
 cat $Projectdir/$line/$line.author » $PageSclt
 cat $Projectdir/$line/$line.author
 fi
 echo » $PageSclt
 done < $Pjlist
 echo "</div>" » $PageSclt
 echo "<div style='page-break-before:always'></div>" » $PageSclt
 Headscli=$Projectdir/$Bookname.scli
 echo > $Headscli
 echo
 echo -n "$Headscli"; echo $" english version"; echo
 echo $"== Images Sources Licenses and Contributors ==" > $Headscli
 echo -n "<span style='font-size:85%'>"; echo $"The "sources" listed for each illustration provide more detailed licensing information, including copyright status, the holders of these rights and the license conditions.</span>" » $Headscli
 echo " " » $Headscli
 echo "<div style='font-size:72%'>" » $Headscli
 echo » $Headscli
 if test -e $Projectdir/$Bookname/$Bookname.str
 then
 cat $Projectdir/$Bookname/$Bookname.str | grep -n -i -e fichier: -e file: -e image: > $Projectdir/$Bookname/$Bookname.files
 cat $Projectdir/$Bookname/$Bookname.str | grep -n -i -e fichier: -e .jpg -e .png -e .gif > $Projectdir/$Bookname/$Bookname.picts
 cat $Projectdir/$Bookname/$Bookname.files | grep title |sed "s/<\/div>//g" | awk -F">" '{print $NF}' > $Projectdir/$Bookname/$Bookname.illustrations
 cat $Projectdir/$Bookname/$Bookname.files | awk -F"=" '{for (i=1;i<=NF;i++) print $i "\n"}' | grep https | sed "s/\"/!/g" | cut -d '!' -f3 \
 | grep https | tr '>' ! | sed "s/<\/a//g" |sed "s/!//g" > $Projectdir/$Bookname/$Bookname.links
 wget -P $Projectdir/$Bookname -r -linf -k -p -E -i $Projectdir/$Bookname/$Bookname.links 
 cd $Bookname
 if test -e commons.wikimedia.org; then cp -R commons.wikimedia.org/wiki/*.html . ; fi
 echo -n "" > html.list
 if test -s $Projectdir/$Bookname/$Bookname.links
 then 
 echo $"$Projectdir/$Bookname/$Bookname.links is not empty" 
 while read line
 do
 echo $line | awk -F"/" '{print $NF}' | cut -d '%' -f1 | cut -d '.' -f1 > tmp
 read Image < tmp
 ls $Image*.html » html.list
 echo "Image : "$Image.html 
 done < $Projectdir/$Bookname/$Bookname.links
 elif test -s $Projectdir/html.list; then cp $Projectdir/html.list $Projectdir/$Bookname/html.list
 else echo $"No images found in $Projectdir/$Bookname"; exit 0
 fi
 echo " *** References : image, src, lic, contrib."
 while read line
 do
 echo
 echo
 echo $"**** line = $line ****"
 echo
 mkd -pw '**' $line $line.tmp
 cat $line.tmp | tr ',' '\n' > $line.str 
 echo -n $"Illustration : " > $line.title
 cat $line.str |grep wgTitle | cut -d '"' -f4 » $line.title
 cat $line.title » $PageSclic 
 cat $line.title
 echo -n $", " source : ')"https://"$Site"/w/index.php?title= " > $line.source
 echo $line | sed "s/.html//g" » $line.source
 cat $line.source » $PageSclic
 cat $line.source
 echo -n $", "license : "" > $line.license
 cat $line.str | grep licensetpl_short | sed "s/<td>//g" | sed "s/<span class//g" | sed "s/<\/span>//g" | sed "s/style=\"display:none;\"//g" | tr '=' '\n' | grep licensetpl_short | awk -F">" '{print $NF}' » $line.license
 cat $line.license » $PageSclic
 cat $line.license
 echo -n $", authors : "" > $line.authors
 rm tmp
 cat $line.str | grep -i -n -m1 -A 1 -e Author | grep -i -e user -e utilisteur -e auteur | tr '/' '\n' | grep -i -e user -e utilisteur -e auteur | cut -d '"' -f1 > tmp
 if test -s tmp 
 then cat tmp » $line.authors
 else echo "-" » $line.authors
 fi
 cat $line.authors » $PageSclic
 cat $line.authors 
 echo » $PageSclic
 done < html.list
 echo "</div>" » $PageSclic
 echo "<div style='page-break-before:always'></div>" » $PageSclic
 else 
 echo -e "\033[31m"
 echo $"Can not create $Projectdir/$Bookname/$Bookname.sclic. URL page of book is not found"
 echo -e "\033[0m"
 fi
 Pagesclipco="$Projectdir/$Bookname.sclipco"
 echo $Pagesclipco
 cat $Projectdir/$Bookname.scli > $Pagesclipco
cat $Pagesclipco
 while read pjline
 do
 if [ $pjline != $Bookname ]
 then
 cd $Projectdir/$pjline
 cat $Projectdir/$pjline/$pjline.str | grep -n -i -e Fichier: -e file: -e image: | sed -f $RepCom/$Conversions > $Projectdir/$pjline/$pjline.files
 cat $Projectdir/$pjline/$pjline.str | grep -n -i -e fichier: -e .jpg -e .png -e .gif | sed -f $RepCom/$Conversions> $Projectdir/$pjline/$pjline.picts
 cat $Projectdir/$pjline/$pjline.files | grep title |sed "s/<\/div>//g" | awk -F">" '{print $NF}' > $Projectdir/$pjline/$pjline.illustrations
 cat $Projectdir/$pjline/$pjline.files | awk -F"=" '{for (i=1;i<=NF;i++) print $i "\n"}' | grep https://$Site | sed "s/\"/!/g" | cut -d '!' -f2 > $Projectdir/$pjline/$pjline.images
 cat $Projectdir/$pjline/$pjline.images | sed "s/$Site/commons.wikimedia.org/g"| sed "s/Fichier/File/g" > $Projectdir/$pjline/$pjline.commonsimages
 wget -P $Projectdir/$pjline -r -linf -k -p -E -i $Projectdir/$pjline/$pjline.commonsimages
 cp $Projectdir/$pjline/commons.wikimedia.org/wiki/*.html $Projectdir/$pjline/. 
 echo -n "" > commonshtml.doublons 
 while read pictline
 do
 #echo $pictline | awk -F"/" '{for (i=1;i<=NF;i+=2) print $i "\n"}' #| cut -d '%' -f1 | cut -d '.' -f1 > tmp
 echo $pictline | awk -F"/" '{ print $NF".html"}' » commonshtml.doublons
 echo -n "" > commonshtml.list
 END { for ( i = 1 ; i <= NR ; i=i+2 ) {
 print memfile[i] » "commonshtml.list"
 # print "Fin"
 } ' commonshtml.doublons
 done < $Projectdir/$pjline/$pjline.commonsimages
 echo "Article : $pjline<br />" » $Pagesclipco
 echo "Article : $pjline"
 while read htmlline
 do
 echo ""
 echo ""
 echo $" ---- line read = $htmlline --- "
 echo ""
 mkd -pw '**' $htmlline $htmlline.tmp
 cat $htmlline.tmp | tr ',' '\n' > $htmlline.co.str 
 echo -n $"Illustration : " > $htmlline.co.title
 cat $htmlline.co.str | grep wgTitle | cut -d '"' -f4 » $htmlline.co.title
 cat $htmlline.co.title » $Pagesclipco 
 cat $htmlline.co.title
 echo -n $", "source : "https://commons.wikimedia.org/wiki/" > $htmlline.co.source
 ##echo -n ","$(gettext 'source : ')"https://commons.wikimedia.org/wiki/" > $htmlline.co.source
 echo -n $htmlline | sed "s/.html//g" | sed "s/.str//g" » $htmlline.co.source
 if [ "$Site" = "fr.wikibooks.org" ]; then echo "?uselang=fr" » $htmlline.co.source
 elif [ "$Site" = "en.wikibooks.org" ]; then echo "?uselang=en" » $htmlline.co.source
 else echo
 fi
 cat $htmlline.co.source » $Pagesclipco
 cat $htmlline.co.source
 echo -n $", "license : " " > $htmlline.co.license
 cat $htmlline.co.str | grep licensetpl_short | sed "s/<td>//g" | sed "s/<span class//g" | sed "s/<\/span>//g" | sed "s/style=\"display:none;\"//g" | tr '=' '\n' | grep licensetpl_short | awk -F">" '{print $NF}' » $htmlline.co.license
 cat $htmlline.co.license » $Pagesclipco
 cat $htmlline.co.license
 rm -rf tmp
 echo -n $", "authors : "" > $htmlline.co.authors
 cat $htmlline.co.str | grep -i -n -m1 -A 1 -e Author -e Auteur | tr '/' '\n' | grep -i -e user -e utilisteur -e auteur -e author | cut -d '"' -f1 | grep -i -e user -e utilisteur -e auteur -e author > tmp 
 if test -s tmp; then echo ; else echo "-" > tmp; fi
 cat tmp » $htmlline.co.authors
 cat $htmlline.co.authors » $Pagesclipco
 cat $htmlline.co.authors 
 echo "" » $Pagesclipco
 done < commonshtml.list
 fi 
 done < $Projectdir/$Bookname.pj
 rm -rf tmp
 echo "</div>" » $Pagesclipco
 #T echo "$(gettext ' ')" » $Pagesclipco 
 echo "<div style='page-break-before:always'></div>" » $Pagesclipco
 cat $Projectdir/$Bookname.sclt>$Projectdir/$Bookname.appendix
 cat $Projectdir/$Bookname.sclipco»$Projectdir/$Bookname.appendix
 echo $"= License of articles and sofware ="»$Projectdir/$Bookname.appendix
 echo "<div style='font-zize:85%'>"»$Projectdir/$Bookname.appendix
 echo "Creative Commons Attribution Share Alike 3.0"»$Projectdir/$Bookname.appendix
 echo "//creativecommons.org/licenses/by-sa/3.0/"»$Projectdir/$Bookname.appendix
 echo »$Projectdir/$Bookname.appendix
 echo $"This appendix is created with addappendix software version $VERSION"»$Projectdir/$Bookname.appendix
 echo "https://fr.wikibooks.org/wiki/Auto-éditer_un_wikilivre/addappendix"»$Projectdir/$Bookname.appendix
 echo "</div>"»$Projectdir/$Bookname.appendix
 echo "<div style='page-break-before:always'></div>"»$Projectdir/$Bookname.appendix
 echo;echo -e "\033[1;32mcopy and paste the text displayed and add after the book $Bookname.\033[0m"
 cat $Projectdir/$Bookname.appendix 
 echo;echo -e "\033[1;32mcopy and paste the text displayed and add after the book.$Bookname\033[0m"
 exit 0
script tests_addappendix.bash.
VERSION=220119
echo -e "\033[1;033mtest addappendix.sh with first param empty\033[0m"
./addappendix.sh
sleep 3
echo "----"
echo -e "\033[1;033mtest addappendix.sh with first param = '?'\033[0m"
./addappendix.sh ?
sleep 3
echo "----"
echo -e "\033[1;033mtest addappendix.sh with first param = '--v'\033[0m"
./addappendix.sh --v
sleep 3
echo "----"
echo -e "\033[1;033mtest addappendix.sh with param = https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel\033[0m"
./addappendix.sh https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel
Appendix en créée avec addappendix le 25 février 2022.
Appendix de la compilation , le 25 février 2022, avec la version internationalisée addappendix pour l'empaquetage linux;
Annexe en créée avec addappendix le 6 mars 2022.
Annexes de la compilation avec la traduction fr/LC_MESSAGES/addappendix.mo
Annexe de "Faire_fleurir_le_sel", Juin 2020, avec la première version Annexer
Tests du script d’installation du logiciel par Makefile.
Script du Makefile.
<Syntaxhighlight lang = "make">
VERSION=220313
BIN = $(DESTDIR)/usr/local/bin
DOCU = $(DESTDIR)/usr/local/share/addappendix/doc
CATMANDIR = $(DESTDIR)/var/cache/man
CATMANDIR_FR = $(DESTDIR)/var/cache/man/fr.UTF-8/cat1 debian
DATAS = $(DESTDIR)/usr/local/datas
DOC = $(DESTDIR)/usr/local/share/doc/Add_appendix
ETC = $(DESTDIR)/usr/local/etc
LIB = $(DESTDIR)/usr/local/lib
SLIBS = annex.lib.sh cpcleaned2bin.sh ecfpb.sh ecfpc.sh findbook.sh killalldoc.sh
ICONS = $(DESTDIR)/usr/share/icons/hicolor
LANG = $(DESTDIR)/usr/share/locale
MAN = $(DESTDIR)/usr/share/man
MIME = $(DESTDIR)/usr/share/mime
SRC = $(DESTDIR)/usr/local/src/Add_appendix
SRCS = addappendix.sh
SBIN = $(DESTDIR)/usr/local/sbin
SBINS = compil2bin.sh findversions.sh install_annex.sh \
 install_datasfiles.sh makeman_annex.sh users_install_annex.sh
PGM = addappendix
Installdir=.
Workdir=.
Bindir=./bin
Booksdir=./books
Datasdir=./datas
Libdir=./lib
Sharedir=./share
Srcdir=./src/Add_appendix
Sbindir=./sbin
Testsdir=./tests
Varsdir=./vars
Langdir=./share/addappendix/resources/lang/po
Localedir=./share/locale
Mandir=./share/man
install: $(PGM)
$(PGM): 
 @echo "*** DESTDIR : $(DESTDIR)"
 # Create all directories to making up the application
 install -d $(BIN) $(DOCU) $(CATMANDIR_FR) $(DATAS) $(LIB) $(ETC) $(SBIN) $(SRC)
 # Copy all sources files in SRC directory
 cp -f $(Srcdir)/* $(SRC)/.
 # Copy all executables files in BIN directory
 cp -f $(Bindir)/* $(BIN)/.
 # Copy all datas files to DATAS directory
 cp -f $(Datasdir)/* $(DATAS)/.
 # Copy all sbin executables files to SBIN directory
 cp -rf $(Sbindir)/* $(SBIN)/.
 # Copy all lib files to LIB directory
 cp -rf $(Libdir)/* $(LIB)/.
 # Create new Add_appendix directory and essential sub-directories from package
 @if [ -e ~/Add_appendix ]; then echo "~/Add_appendix exist, ok"; else mkdir -p ~/Add_appendix; fi
 @if [ -e ~/Add_appendix/books ]; then echo "~/Add-appendix/books exist ok"; else mkdir -p ~/Add_appendix/books; fi
 @if [ -e ~/Add_appendix/vars ]; then echo "~/Add_appendix/vars exist ok"; else mkdir -p ~/Add_appendix/vars; fi
 @if [ -e ~/Add_appendix/temp ]; then mkdir -p ~/Add_appendix/temp; fi
install: $(PGM)
 # Create SHARE sub directories
 install -d $(ICON) $(LANG) $(MAN) $(MIME)
 #install icons and update cache
 install -d $(ICONS) $(ICONS)/scalable/mimetypes $(ICONS)/256x256/mimetypes
 install -d $(ICONS)/256x256/apps $(ICONS)/48x48/apps $(ICONS)/32x32/apps $(ICONS)/16x16/apps $(ICONS)/8x8/apps
 #cp -f $(Sharedir)/icons/AA256x256.svg $(ICONS)/scalable/mimetypes/addappendix.svg
 cp -f $(Sharedir)/icons/hicolor/scalable/mimetypes/addappendix.svg $(ICONS)/scalable/mimetypes/addappendix.svg
 #cp -f $(Sharedir)/icons/AA256x256.png $(ICONS)/256x256/mimetypes/addappendix.png
 cp -f $(Sharedir)/icons/hicolor/256x256/mimetypes/addappendix.png $(ICONS)/256x256/mimetypes/addappendix.png
 #cp -f $(Sharedir)/icons/AA256x256.svg $(ICONS)/256x256/mimetypes/addappendix.svg
 cp -f $(Sharedir)/icons/hicolor/256x256/mimetypes/addappendix.svg $(ICONS)/256x256/mimetypes/addappendix.svg
 #cp -f $(Sharedir)/icons/AA48x48bleu.png $(ICONS)/48x48/apps/addappendix.png
 cp -f $(Sharedir)/icons/hicolor/48x48/apps/addappendix.png $(ICONS)/48x48/apps/addappendix.png
 #cp -f $(Sharedir)/icons/AA32x32bleu.png $(ICONS)/32x32/apps/addappendix.png
 cp -f $(Sharedir)/icons/hicolor/32x32/apps/addappendix.png $(ICONS)/32x32/apps/addappendix.png
 #cp -f $(Sharedir)/icons/AA16x16bleu.png $(ICONS)/16x16/apps/addappendix.png
 cp -f $(Sharedir)/icons/hicolor/16x16/apps/addappendix.png $(ICONS)/16x16/apps/addappendix.png
 #cp -f $(Sharedir)/icons/AA8x8bleu.png $(ICONS)/8x8/apps/addappendix.png
 cp -f $(Sharedir)/icons/hicolor/8x8/apps/addappendix.png $(ICONS)/8x8/apps/addappendix.png
 # Attention il faut que toute la commande soit sur la même ligne d'où le caractère escape '\'
 # On ne peut mettre à jour la base de données que si les images sont installées dans le système
 # La ligne suivante est à inclure dans 'postinst' du paquet ubuntu
 @if [ -z $(DESTDIR) ]; then sudo gtk-update-icon-cache -t /usr/share/icons/hicolor;fi
 # Install languages after directories installation
 install -d $(LANG)/de/LC_MESSAGES $(LANG)/en/LC_MESSAGES $(LANG)/fr/LC_MESSAGES $(LANG)/es/LC_MESSAGES
 ## de
 #cp -f $(Localedir)/de/LC_MESSAGES/*.mo $(LANG)/de/LC_MESSAGES/.
 ## en
 #cp -f $(Localedir)/en/LC_MESSAGES/*.mo $(LANG)/en/LC_MESSAGES/.
 ## es
 #cp -f $(Localedir)/es/LC_MESSAGES/*.mo $(LANG)/es/LC_MESSAGES/.
 ## fr
 cp -f $(Localedir)/fr/LC_MESSAGES/*.mo $(LANG)/fr/LC_MESSAGES/.
 cp -u $(Langdir)/fr/addappendix.mo $(LANG)/fr/LC_MESSAGES/addappendix.mo
 cp -u $(Langdir)/fr/annex.mo $(LANG)/fr/LC_MESSAGES/annex.mo
 cp -u $(Langdir)/fr/header.inc.mo $(LANG)/fr/LC_MESSAGES/header.inc.mo
 #install manuals
 install -d $(MAN) $(MAN)/man1 $(MAN)/de/man1 $(MAN)/en/man1 $(MAN)/es/man1 $(MAN)/fr/man1 $(MAN)/fr.UTF-8/man1
 ## Default manual
 @if [ -e $(Mandir)/man1/addappendix.1.gz ]; then catman -M $(Man)/man1/addappendix.1.gz; fi
 @if [ -e $(mandir)/man1/annex.1.gz ]; then catman -M $(MAN)/man1/annex.1.gz; fi
 @if [ -e $(mandir)/man1/compil2bin.1.gz; then catman -M $(MAN)/man1/compil2bin.1.gz; fi
 ## de
 ## en
 ## es
 ## fr
 @if [ -e $(Mandir)/fr.UTF-8/man1/addappendix.1.gz ]; then catman -M $(MAN)/fr.UTF-8/man1/addappendix.1.gz; fi
 @if [ -e $(Mandir)/fr.UTF-8/man1/annex.1.gz; then catman -M $(MAN)/fr.UTF-8/man1/annex.1.gz; fi
 @if [ -e $(Mandir)/fr.UTF-8/man1/annexer.1.gz; then catman -M $(MAN)/fr.UTF-8/man1/annexer.1.gz; fi
 # La ligne suivante est à inclure dans 'postinst' du paquet ubuntu
 @if [ -z $(DESTDIR) ]; then mandb -u; fi
 #install mime
 install -d $(MIME)
 @if [ -e $Sharedir/mime/packages/addappendix.xml ]; then cp -f $Sharedir/mime/package/addappendix.xml $(MIME)/packages/addappendix.xml; fi
 @if [ -e $Sharedir/mime/packages/annexer.xml ]; then cp -f $Sharedir/mime/packages/annexer.xml $(MIME)/packages/annexer.xml; fi
 # La ligne suivante est à inclure dans 'postinst' du paquet ubuntu
 @if [ -z $(DESTDIR) ]; then sudo update-mime-database /usr/share/mime; fi
 #install archives
 #install -d $(ARCHIVES)/books
 #cp -rf ./archives/books/* $(ARCHIVES)/books/.
clean:
 rm -rf ./tmp
</Syntaxhighlight>