Skip to content

Commit 11c97b6

Browse files
committed
Fix more stuff
1 parent 4617908 commit 11c97b6

File tree

6 files changed

+135
-30
lines changed

6 files changed

+135
-30
lines changed

Makefile

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ all: all_pdf_assets latex/ugent2016-nl.pdf latex/ugent2016-en.pdf
3030
# -interaction=nonstopmode keeps the pdflatex backend from stopping at a
3131
# missing file reference and interactively asking you for an alternative.
3232

33-
pdf_assets := $(patsubst assets/%,latex/logos/%,$(patsubst %.eps,%.pdf,$(wildcard assets/*.eps)))
33+
pdf_assets := $(patsubst assets/%,latex/%,$(patsubst %.eps,%.pdf,$(wildcard assets/*.eps)))
3434

3535
latex/ugent2016-nl.pdf: latex/ugent2016-nl.tex \
3636
latex/ugent2016-title-report.pdf \
@@ -55,36 +55,48 @@ example.pdf: example.tex
5555
latexmk -cd lualatex -interaction=nontopmode -use-make $<
5656

5757
# Create all assets
58-
all_pdf_assets: $(pdf_assets) latex/logos/ugent2016-logo-global-nl.pdf latex/logos/ugent2016-logo-kortrijk-en.pdf
58+
all_pdf_assets: $(pdf_assets) latex/ugent2016-logo-global-nl.pdf latex/ugent2016-logo-kortrijk-en.pdf
5959

6060
# These two are created using symlinks rather than links.
61-
latex/logos/ugent2016-logo-global-nl.pdf: latex/logos/ugent2016-logo-global-en.pdf
61+
latex/ugent2016-logo-global-nl.pdf: latex/ugent2016-logo-global-en.pdf
6262
powershell New-Item -Force -ItemType SymbolicLink -Name $@ -Value $<
6363

64-
latex/logos/ugent2016-logo-kortrijk-en.pdf: latex/logos/ugent2016-logo-kortrijk-nl.pdf
64+
latex/ugent2016-logo-kortrijk-en.pdf: latex/ugent2016-logo-kortrijk-nl.pdf
6565
powershell New-Item -Force -ItemType SymbolicLink -Name $@ -Value $<
6666

67-
# Create the directory
68-
latex/logos:
69-
powershell mkdir -f latex/logos
70-
7167
# Convert a single asset
72-
latex/logos/%.pdf: assets/%.eps latex/logos
68+
latex/%.pdf: assets/%.eps
7369
epstopdf --outfile=$@ $<
7470

7571
# Clean up some stuff
76-
clean:
72+
clean-win:
7773
cd latex && latexmk -cd -use-make -C
78-
-powershell Remove-Item latex/logos -Recurse -Force -ErrorAction Ignore
74+
-powershell Remove-Item latex/*.pdf -Recurse -Force -ErrorAction Ignore
7975
-powershell Remove-Item latex/_minted-ugent2016-en -Recurse -Force -ErrorAction Ignore
8076
-powershell Remove-Item latex/_minted-ugent2016-nl -Recurse -Force -ErrorAction Ignore
8177
-powershell Remove-Item ugent2016.zip -Force -ErrorAction Ignore
8278
-powershell Remove-Item ugent2016.tds.zip -Force -ErrorAction Ignore
83-
-powershell Remove-Item ugent2016 -Recurse -Force -ErrorAction Ignore
79+
-powershell Remove-Item ctanout -Recurse -Force -ErrorAction Ignore
8480
-powershell Remove-Item tdsout -Recurse -Force -ErrorAction Ignore
8581

86-
ugent2016.zip: all ugent2016.tds.zip
82+
clean:
83+
cd latex && latexmk -cd -use-make -C
84+
rm -f latex/*.pdf
85+
rm -rf latex/_minted-ugent2016-en
86+
rm -rf latex/_minted-ugent2016-nl
87+
rm -rf ugent2016.zip
88+
rm -rf ugent2016.tds.zip
89+
rm -rf ctanout
90+
rm -rf tdsout
91+
92+
ugent2016.zip-win: all ugent2016.tds.zip-win
8793
powershell ./generate-ctan.ps1
8894

89-
ugent2016.tds.zip: all
95+
ugent2016.tds.zip-win: all
9096
powershell ./generate-tds.ps1
97+
98+
ugent2016.zip: all ugent2016.tds.zip
99+
powershell ./generate-ctan.sh
100+
101+
ugent2016.tds.zip: all
102+
powershell ./generate-tds.sh

generate-ctan.ps1

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ param(
1010
)
1111

1212
$in = "tdsout"
13-
$out = "ugent2016"
13+
$out = "ctanout"
1414

1515
# We need the following files in the zip for ctan:
1616
# - The class files
@@ -20,23 +20,20 @@ $out = "ugent2016"
2020
# - The readme
2121

2222
# First, create the output directory
23-
New-Item -ItemType Directory -Force -Path $out
23+
New-Item -ItemType Directory -Force -Path $out/ugent2016
2424

2525
Get-ChildItem $in -Recurse -File -Depth 3 | ForEach-Object {
2626
$filename = "$($_.BaseName)$($_.Extension)"
2727
Write-Host $_.FullName
28-
Copy-Item $_.FullName -Destination $out/$filename
28+
Copy-Item $_.FullName -Destination $out/ugent2016/$filename
2929
}
3030

31-
# Copy logos
32-
Copy-Item "$in/tex/latex/ugent2016/logos" -Destination "$out/logos" -Recurse
33-
3431
# Add tds-compliant zip file if necessary
3532
if (!$ExcludeTds) {
3633
Copy-Item ugent2016.tds.zip -Destination $out
3734
}
3835

39-
Compress-Archive -Path $out -DestinationPath ugent2016.zip -Force
36+
Compress-Archive -Path $out/* -DestinationPath ugent2016.zip -Force
4037

4138
if ($RemoveOut) {
4239
Remove-Item $out -Recurse -Force

generate-ctan.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
3+
#
4+
# Generate a zip file suitable for uploading to CTAN.
5+
#
6+
# This script relies on the TDS directory having been made.
7+
#
8+
9+
REMOVE_OUT=false
10+
EXCLUDE_TDS=false
11+
12+
while getopts 'abf:v' flag; do
13+
case "${flag}" in
14+
RemoveOut) REMOVE_OUT=true ;;
15+
ExcludeTds) EXCLUDE_TDS=true ;;
16+
*) break ;;
17+
esac
18+
done
19+
20+
in="tdsout"
21+
out="ctanout"
22+
23+
# We need the following files in the zip for ctan:
24+
# - The class files
25+
# - The style files
26+
# - The docs (including the pdf versions)
27+
# - The logos
28+
# - The readme
29+
30+
# First, create the output directory
31+
mkdir -p "$out/ugent2016"
32+
33+
find ${in} -type f -exec cp "{}" "$out/ugent2016" ";"
34+
35+
# Add tds-compliant zip file if necessary
36+
if [[ ${EXCLUDE_TDS} = false ]]; then
37+
cp ugent2016.tds.zip ${out}
38+
fi
39+
40+
cd ${out}
41+
zip --filesync -r ../ugent2016.zip *
42+
43+
if [[ "$REMOVE_OUT" = true ]]; then
44+
rm -rf ${out}
45+
fi

generate-tds.ps1

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# Generate a zip file suitable for uploading to CTAN.
2+
# Generate a TDS compliant zip.
3+
# Note: this is experimental on Windows.
34
#
45

56
param(
@@ -9,13 +10,6 @@ param(
910
$out = "tdsout"
1011
$in = "latex"
1112

12-
# We need the following files in the zip for ctan:
13-
# - The class files
14-
# - The style files
15-
# - The docs (including the pdf versions)
16-
# - The logos
17-
# - The readme
18-
1913
$latex = "$out/tex/latex/ugent2016"
2014
$doc = "$out/doc/latex/ugent2016"
2115
$source = "$out/source/latex/ugent2016"
@@ -44,7 +38,7 @@ Get-ChildItem -Path "$in/*" -File -Include *.tex | ForEach-Object {
4438
}
4539

4640
# Copy the logos to the output folder
47-
Copy-Item "$in/logos" -Destination "$latex/logos" -Recurse
41+
Copy-Item "$in/ugent2016-logo-*.pdf" -Destination "$latex" -Recurse
4842

4943
# Copy the documentation pdfs to the folder
5044
Copy-Item "$in/ugent2016-nl.pdf" -Destination "$doc"

generate-tds.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
3+
#
4+
# Generate a TDS compliant zip
5+
#
6+
7+
REMOVE_OUT=false
8+
9+
while getopts 'abf:v' flag; do
10+
case "${flag}" in
11+
RemoveOut) REMOVE_OUT=true ;;
12+
*) break ;;
13+
esac
14+
done
15+
16+
out="tdsout"
17+
in="latex"
18+
19+
20+
latex="$out/tex/latex/ugent2016"
21+
doc="$out/doc/latex/ugent2016"
22+
source="$out/source/latex/ugent2016"
23+
24+
mkdir -p ${latex}
25+
mkdir -p ${doc}
26+
mkdir -p ${source}
27+
28+
# Copy all latex files
29+
find ${in} -name '*.cls' -o -name '*.sty' -exec cp "{}" ${latex} ";"
30+
31+
# Copy all doc files
32+
find ${in} -name '*.md' -exec cp "{}" ${doc} ";"
33+
34+
# Copy all source files
35+
find ${in} -name '*.tex' -exec cp "{}" ${source} ";"
36+
37+
# Convert all line endings
38+
find ${out} -type f -print0 | xargs -0 dos2unix
39+
40+
# Copy logos
41+
find ${in} -name 'ugent2016-logo-*.pdf' -exec cp "{}" ${latex} ";"
42+
43+
# Copy the documentation pdfs to the folder
44+
cp "$in/ugent2016-nl.pdf" ${doc}
45+
cp "$in/ugent2016-en.pdf" ${doc}
46+
47+
# Fix all permissions
48+
find ${out} -type f -exec chmod 644 "{}" ";"
49+
50+
cd ${out}
51+
zip --filesync -r ../ugent2016.tds.zip *
52+
53+
chmod 644 ../ugent2016.tds.zip
54+
55+
if [[ "$REMOVE_OUT" = true ]]; then
56+
rm -rf ${out}
57+
fi
File renamed without changes.

0 commit comments

Comments
 (0)