-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.lua
120 lines (103 loc) · 4.02 KB
/
build.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
-- Build script for newpax
packageversion="0.55"
packagedate="2023-11-08"
module = "newpax"
ctanpkg = "newpax"
--tdsroot = "lualatex"
local ok, mydata = pcall(require, "ulrikefischerdata.lua")
if not ok then
mydata= {email="XXX",github="XXX",name="XXX"}
end
uploadconfig = {
pkg = ctanpkg,
version = "v"..packageversion.." "..packagedate,
author = mydata.name,
license = "lppl1.3c",
summary = "Experimental package to extract and reinsert PDF annotations",
ctanPath = "/macros/latex/contrib/newpax",
repository = mydata.github .. "newpax",
bugtracker = mydata.github .. "newpax/issues",
support = mydata.github .. "newpax/issues",
uploader = mydata.name,
email = mydata.email,
update = true ,
topic= "pdf-feat",
note = [[ Uploaded automatically by l3build...]],
description=[[The package is based on the pax package from Heiko Oberdiek.
If offers a lua-based alternative to the java based pax.jar to extract the annotations from a PDF. The resulting file
can then be used together with pax.sty. It also offers an extended style which works with all three major engines.]],
announcement_file="ctan.ann"
}
checkengines = {"luatex","pdftex","xetex"}
stdengine = "luatex"
checkconfigs = {"build"}
checkruns = 3
checksuppfiles = {"newpax-input.pdf"}
docfiledir = "./doc"
-- ctan setup
docfiles = {"*.tex"}
textfiles= {"doc/CTANREADME.md"}
ctanreadme= "CTANREADME.md"
typesetexe = "lualatex-dev"
packtdszip = false
installfiles = { "*.sty", "*.lua" }
sourcefiles = {"*.dtx","*.ins","*.sty"}
typesetfiles = {"newpax.tex","doc-use-newpax.tex","doc-use-pax.tex"}
typesetdemofiles = {"doc-input1.tex","doc-input2.tex"}
typesetruns = 4
tagfiles = {"Readme.md",
"newpax.dtx",
"newpax.ins",
"doc/newpax.tex",
"doc/CTANREADME.md"
}
function update_tag (file,content,tagname,tagdate)
tagdate = packagedate
if string.match (file, "%.dtx$" ) then
content = string.gsub (content,
"%d%d%d%d%-%d%d%-%d%d v%d%.%d+ ",
packagedate.. " v"..packageversion .. " ")
content = string.gsub (content,
'(version%s*=%s*")%d%.%d+(",%s*--TAGVERSION)',
"%1"..packageversion.."%2")
content = string.gsub (content,
'(date%s*=%s*")%d%d%d%d%-%d%d%-%d%d(",%s*--TAGDATE)',
"%1"..packagedate.."%2")
return content
elseif string.match (file, "^Readme.md$") then
content = string.gsub (content,
"Version: %d%.%d+",
"Version: " .. packageversion )
content = string.gsub (content,
"version%-%d%.%d+",
"version-" .. packageversion )
content = string.gsub (content,
"for %d%.%d+",
"for " .. packageversion )
content = string.gsub (content,
"%d%d%d%d%-%d%d%-%d%d",
packagedate )
local imgpackagedate = string.gsub (packagedate,"%-","--")
content = string.gsub (content,
"%d%d%d%d%-%-%d%d%-%-%d%d",
imgpackagedate)
return content
elseif string.match (file, "%.md$") then
content = string.gsub (content,
"Packageversion: %d%.%d+",
"Packageversion: " .. packageversion )
content = string.gsub (content,
"Packagedate: %d%d%d%d/%d%d/%d%d",
"Packagedate: " .. tagdate )
return content
elseif string.match (file, "%.tex$" ) then
content = string.gsub (content,
"package@version{%d%.%d+}",
"package@version{" .. packageversion .."}" )
content = string.gsub (content,
"package@date{%d%d%d%d%-%d%d%-%d%d}",
"package@date{" .. packagedate .."}" )
return content
end
return content
end