aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2017-06-08 17:09:22 +0200
committerMikle Kolyada <zlogene@gentoo.org>2019-06-09 17:54:33 +0300
commitade7dffc96ffa8f4ee50954450f4126c8dc9fca2 (patch)
tree53529f37afef1aa8c122a4bb8ae92e2dd74c6e3b /scripts/texlive/tlpsrc
parentfix old typo (diff)
downloadtex-ade7dffc96ffa8f4ee50954450f4126c8dc9fca2.tar.gz
tex-ade7dffc96ffa8f4ee50954450f4126c8dc9fca2.tar.bz2
tex-ade7dffc96ffa8f4ee50954450f4126c8dc9fca2.zip
generate license from texlive files instead of parsing html with regexpes...
Diffstat (limited to 'scripts/texlive/tlpsrc')
-rw-r--r--scripts/texlive/tlpsrc/Makefile13
-rw-r--r--scripts/texlive/tlpsrc/Makefile-dist6
-rwxr-xr-xscripts/texlive/tlpsrc/cataloguelicense2gentoolicense.sh30
-rwxr-xr-xscripts/texlive/tlpsrc/getlicense.sh2
4 files changed, 37 insertions, 14 deletions
diff --git a/scripts/texlive/tlpsrc/Makefile b/scripts/texlive/tlpsrc/Makefile
index e35bcd9..900fad3 100644
--- a/scripts/texlive/tlpsrc/Makefile
+++ b/scripts/texlive/tlpsrc/Makefile
@@ -30,7 +30,7 @@ unpacked : $(FULLDESC:%=%.unpacked)
%.srclist: %.tlpobj
./gensrc.sh $(shell cat $(<:%.tlpobj=%.list)) > $@
-%.licenselist: %.cataloguehtml
+%.licenselist: %.tlplic
./getlicense.sh $(shell cat $(@:%.licenselist=%.list)) | sort | uniq | tr '\n' ' ' > $@
%.gentoolicense: %.licenselist
@@ -65,6 +65,7 @@ clean:
$(RMF) $(FULLDESC:%=%.list)
$(RMF) $(FULLDESC:%=%.srclist)
$(RMF) $(FULLDESC:%=%.doclist)
+ $(RMF) $(FULLDESC:%=%.fulllist)
$(RMF) $(FULLDESC:%=%.licenselist)
$(RMF) $(FULLDESC:%=%.base)
$(RMF) $(FULLDESC:%=%.versionnedzips)
@@ -76,7 +77,6 @@ clean:
$(RMF) $(DESC:%=%.metadata)
$(RMF) *.tlpobj
$(RMF) *.tlplic
- $(RMF) *.cataloguehtml
$(RMF) *.unpacked
$(RMF) tldir
@@ -100,12 +100,11 @@ clean:
$(MAKE) CONTENTS="$(shell cat $<)" -f Makefile-dist tlpobj
touch $@
-%.tlplic: %.list
- $(MAKE) CONTENTS="$(shell cat $<)" -f Makefile-dist tlplic
- touch $@
+%.fulllist: %.list %.doclist %.srclist
+ cat $^ | tr '\n' ' ' > $@
-%.cataloguehtml: %.list
- $(MAKE) CONTENTS="$(shell cat $<)" -f Makefile-dist cataloguehtml
+%.tlplic: %.fulllist
+ $(MAKE) CONTENTS="$(shell cat $<)" -f Makefile-dist tlplic
touch $@
%-post-ebuild:
diff --git a/scripts/texlive/tlpsrc/Makefile-dist b/scripts/texlive/tlpsrc/Makefile-dist
index 3a7c625..023e141 100644
--- a/scripts/texlive/tlpsrc/Makefile-dist
+++ b/scripts/texlive/tlpsrc/Makefile-dist
@@ -22,12 +22,6 @@ tlplic: $(CONTENTS:%=%.tlplic)
%.tlpobj: $(TL_TRUNK)/Master/tlpkg/tlpsrc/%.tlpsrc
$(TL_TRUNK)/Master/tlpkg/bin/tl-update-tlpdb -master=$(TL_TRUNK)/Master -output=$@ --tlpsrc-from-cmdline $<
-%.cataloguehtml:
- curl -I http://www.ctan.org/pkg/$(@:%.cataloguehtml=%) | grep 404 || wget -O $@ http://www.ctan.org/pkg/$(@:%.cataloguehtml=%)
- touch $@
-
-cataloguehtml: $(CONTENTS:%=%.cataloguehtml)
-
tldir:
mkdir tlunpackdir
touch $@
diff --git a/scripts/texlive/tlpsrc/cataloguelicense2gentoolicense.sh b/scripts/texlive/tlpsrc/cataloguelicense2gentoolicense.sh
index 512022a..6a13b4d 100755
--- a/scripts/texlive/tlpsrc/cataloguelicense2gentoolicense.sh
+++ b/scripts/texlive/tlpsrc/cataloguelicense2gentoolicense.sh
@@ -13,6 +13,10 @@ while [ $# -gt 0 ] ; do
echo "GPL-3";;
gpl3+)
echo "GPL-3+";;
+ gpl3+cc-by-sa-4)
+ $0 gpl3+ cc-by-sa-4;;
+ gplofllppl)
+ $0 gpl ofl lppl;;
lppl1)
echo "LPPL-1.3";;
lppl)
@@ -23,6 +27,18 @@ while [ $# -gt 0 ] ; do
echo "LPPL-1.3";;
lppl1.3c)
echo "LPPL-1.3c";;
+ # Some tlpobj from texlive have this like that. This means both and are
+ # only few of them, so split manually.
+ lppl1.3ofl)
+ $0 lppl1.3 ofl;;
+ lppl1.3lppl1.3)
+ $0 lppl1.3;;
+ lpplgpl)
+ $0 lppl gpl;;
+ lpplgpl2)
+ $0 lppl gpl2;;
+ lppllppl)
+ $0 lppl;;
gfl)
echo "LPPL-1.3";;
gfsl)
@@ -37,6 +53,10 @@ while [ $# -gt 0 ] ; do
echo "GPL-2";;
other-free)
echo "TeX-other-free";;
+ other-freelppl)
+ $0 other-free lppl;;
+ other-freelppl1.3)
+ $0 other-free lppl1.3;;
#other)
# echo "TeX-other";;
other-nonfree)
@@ -49,6 +69,8 @@ while [ $# -gt 0 ] ; do
echo "LGPL-3";;
pd)
echo "public-domain";;
+ pdgpl3)
+ $0 pd gpl3;;
apache2)
echo "Apache-2.0";;
artistic2)
@@ -65,10 +87,18 @@ while [ $# -gt 0 ] ; do
echo "FDL-1.1";;
ofl)
echo "OFL";;
+ oflapache2lppl1.3)
+ $0 ofl apache2 lppl1.3;;
+ ofllppl)
+ $0 ofl lppl;;
+ ofllppl1.3)
+ $0 ofl lppl1.3;;
opl)
echo "OPL";;
mit)
echo "MIT";;
+ mitlppl)
+ $0 mit lppl;;
bsd2)
echo "BSD-2";;
#nosell)
diff --git a/scripts/texlive/tlpsrc/getlicense.sh b/scripts/texlive/tlpsrc/getlicense.sh
index 4ab1779..a417e22 100755
--- a/scripts/texlive/tlpsrc/getlicense.sh
+++ b/scripts/texlive/tlpsrc/getlicense.sh
@@ -1,5 +1,5 @@
#!/bin/bash
while [ $# -gt 0 ] ; do
- cat $1.cataloguehtml | tr '"' '\n' | grep '\/license\/' | tr '/' ' ' | awk '{print $2}'
+ grep '^catalogue-license' $1.tlplic | awk '{print $2}'
shift
done