-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
48 lines (33 loc) · 1.03 KB
/
Makefile
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
mets := $(patsubst %.tif, %.mets, $(wildcard *.tif))
jp2s := $(patsubst %.tif, %.jp2, $(wildcard *.tif))
mfiles := $(cat issues.txt)
jp2files : $(jp2s)
metsfiles : $(mets)
rdffiles : $(mfiles)
%.rdf : %.xml
saxon -s:$< -xsl:mjp2rdf.xsl -o:$@
%.jp2 : %.tif
kdu_compress -i $< -o $@ -rate .80 Clevels=5 Clayers=5 Cuse_precincts=yes Cprecincts=\{256,256\} Cblk=\{64,64\} Corder=RPCL ORGgen_plt=yes ORGtparts=R Stiles=\{256,256\} \
-jp2_space sRGB \
-double_buffering 10 \
-num_threads 2 \
-no_weights \
-quiet \
%.jpg : %.tif
gm convert -scale 25% -quality 70% -colorspace sRGB $< $@
%.pdf : %.jpg
gm convert $< $@
%.xmp : %.tif
exiftool -xmp -b $< > $@
%.md5 : %.tif
openssl md5 $< | sed -e 's/^.*= \(.*\)$\/\1/' > $@
%.sha1 : %.tif
openssl sha1 $< | sed -e 's/^.*= \(.*\)$\/\1/' > $@
%.mets : %.xmp %.jp2 %.md5
xsltproc --stringparam fname $* \
--stringparam md5 `md5 -q $*.tif` \
--stringparam sha1 `openssl sha1 $< | sed -e 's/^.*= \(.*\)$\/\1/'` \
-o $@ xmp2mets.xsl $<
.PHONY: clean
clean:
rm *.mets *.sha1 *.md5