« Auto-éditer un wikilivre/addappendix/reconstruction et tests du script addappendix » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 823 :
[[Faire_fleurir_le_sel/Annexe|'''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">
#!/bin/make
# file:Makefile to install ubuntu addappendix
# addappendix-O~220313
# updated by french wikibooks user:Goelette_Cardabela
#
# To test make -d clean install DESTDIR=../tests
# Lors de l'installation les fichiers sources doivent être recopiés
# d'un autre répertoire qui peut être ~/Add_appendix/tests
#
# /usr/local directory
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
# system directories
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
 
# local Add_appendix directories as variables
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>
 
=== liste des réperoires créés ===
 
{{AutoCat}}