Skip to content
Snippets Groups Projects
Commit 86fe6c4a authored by Thomas FOURIER's avatar Thomas FOURIER
Browse files

add autoinstall

parent 57511fe0
No related branches found
No related tags found
No related merge requests found
2022 Copyright Thomas Fourier
2022 Copyright Antoine Bak 2022 Copyright Antoine Bak
2020 Copyright Alexis Roger 2020 Copyright Alexis Roger
2019-2020 Copyright Sosthène Guédon 2019-2020 Copyright Sosthène Guédon
......
.PHONY:all %.all install %.install clean %.clean cleandist %.cleandist release
SUBMAKE:=make -s -C
SUBMAKABLE:=$(shell find . -mindepth 2 -name '[Mm]akefile' | sed 's%^./%%;s%/[^/]*%%')
define submake
@tput setaf 3
@echo make[$1] $2
@tput sgr0
@$3 $(SUBMAKE) $1 $2
endef
all: $(patsubst %,%.all,$(SUBMAKABLE))
%.all:
$(call submake,$*,,)
install: $(patsubst %,%.install,$(SUBMAKABLE))
%.install:
$(call submake,$*,install,sudo)
clean: $(patsubst %,%.clean,$(SUBMAKABLE))
%.clean:
$(call submake,$*,clean,)
cleandist: $(patsubst %,%.cleandist,$(SUBMAKABLE))
%.cleandist:
$(call submake,$*,cleandist,)
release:
$(call submake,.,,)
$(call submake,.,clean,)
...@@ -6,8 +6,7 @@ Pour l'installation de LaTeX et du package, se reporter au fichier `guide/instal ...@@ -6,8 +6,7 @@ Pour l'installation de LaTeX et du package, se reporter au fichier `guide/instal
Il est aussi simple d'installer le package sous linux depuis le dépôt avec le `Makefile`, après l'avoir téléchargé (avec `git clone` ou en téléchargeant un `.zip` ou `.tar.gz`) : Il est aussi simple d'installer le package sous linux depuis le dépôt avec le `Makefile`, après l'avoir téléchargé (avec `git clone` ou en téléchargeant un `.zip` ou `.tar.gz`) :
```bash ```bash
cd polytechnique bash auto_install
make && make install
``` ```
## Test ## Test
......
No preview for this file type
#!/bin/bash
#cd "$(readlink -m "$0/../../")" # chdir to the root directory of the package archive
cd $(dirname $0)
cd ..
TEXMFLOCALS="$(kpsewhich -var-value TEXMFLOCAL)"
IFS=':' TEXMFLOCALTOKENS=( $TEXMFLOCALS )
TEXMFLOCAL="${TEXMFLOCALTOKENS[0]}" #Sometimes TEXMFLOCAL is the concatenation of multiple paths, we choose the first
PACKAGE="$TEXMFLOCAL/tex/latex/polytechnique/"
PERMS="Dg+s,ug+w,o-w,+X,+r"
mkdir -p "$PACKAGE"
printf "%s> Installing source files...%s\n" "$(tput setaf 2)" "$(tput sgr0)"
rsync --recursive --exclude-from=install/.exclude --delete-excluded --chmod=$PERMS source/ $PACKAGE/
printf "%s> Updating database...%s\n" "$(tput setaf 2)" "$(tput sgr0)"
{ texhash || mktexlsr; } >/dev/null
printf "%sDONE !%s\n" "$(tput setaf 2)" "$(tput sgr0)"
@ECHO OFF
CD ..
FOR /F %%i IN ('kpsewhich -var-value TEXMFLOCAL') DO SET TEXMFLOCAL=%%i
SET PACKAGEFOLDER=%TEXMFLOCAL%/tex/latex/beamerx
SET FONTSFOLDER=%TEXMFLOCAL%/fonts
XCOPY "source" "%PACKAGEFOLDER%" /S /I /R /Y
texhash
PAUSE
@echo off
7z a -tzip polytechnique-LaTeX.zip makefile_windows.bat makefile_unix.sh README.md source/*.pdf source/*.eps source/polytechnique.sty source/polytechnique.dtx guide/installation.pdf guide/installation.tex guide/logo.pdf
pause
\ No newline at end of file
@echo off
cd source
pdflatex polytechnique.dtx
makeindex -s gind.ist -o polytechnique.ind polytechnique.idx
pdflatex polytechnique.dtx
del *.aux
del *.glo
del *.idx
del *.ilg
del *.ind
del *.log
del *.toc
del *.out
kpsewhich -var-value TEXMFLOCAL > temp.txt
set /p installdir=<temp.txt
del temp.txt
md "%installdir%/tex/latex/polytechnique"
md "%installdir%/tex/latex/polytechnique/resources"
md "%installdir%/source/latex/polytechnique"
md "%installdir%/source/latex/polytechnique/resources"
md "%installdir%/doc/latex/polytechnique"
copy polytechnique.dtx "%installdir%/source/latex/polytechnique"
copy polytechnique.sty "%installdir%/tex/latex/polytechnique"
copy polytechnique.pdf "%installdir%/doc/latex/polytechnique"
copy *.eps "%installdir%/source/latex/polytechnique/resources"
copy *.pdf "%installdir%/source/latex/polytechnique/resources"
copy *.eps "%installdir%/tex/latex/polytechnique/resources"
copy *.pdf "%installdir%/tex/latex/polytechnique/resources"
echo ************************************************
echo * La base de donnees des packages est en train *
echo * d'etre mise a jour. Cela peut prendre un peu *
echo * de temps. Merci de patienter. *
echo ************************************************
initexmf --update-fndb
echo ************************************************
echo * Le package a ete installe ! La documentation *
echo * se trouve a l'emplacement suivant : *
echo %installdir%/doc/latex/polytechnique
echo * Les fichiers sources et resources a *
echo * l'endroit suivant : *
echo %installdir%/source/latex/polytechnique
echo * Et le .sty a l'endroit suivant : *
echo %installdir%/tex/latex/polytechnique
echo * Bonne utilisation ! *
echo ************************************************
pause
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment