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
|
# Generate template files of MIT license collection
# 1. Place "copyright" file from xorg-common package in the same directory
# 2. Run "make" to check sanity
PWD=$(shell realpath $(shell pwd))
TEST_FILE ?= @1_c.txt
PYTHONPATH:=$(shell realpath $(shell pwd)/../../src)
export PYTHONPATH
PATH:=$(shell realpath $(shell pwd)/../../src/debmake):$(PATH)
export PATH
LC_ALL=C.UTF-8
export LC_ALL
all: test
# Please place data from SPDX in src/dspdx/*
spdx:
for x in dspdx/* ; do \
y=$$(basename $$x).txt; \
: > ../$$y ;\
echo '#%#%#%# This is copyright analyser test data by Osamu Aoki.' >> ../$$y ;\
echo '#%#%#%# The following lines shall not be considered copyright statement.' >> ../$$y ;\
echo '#%#%#%# ' >> ../$$y ;\
cat $$x >> ../$$y ;\
done
# Please place external data in src/dpick/*
pick:
for x in dpick/* ; do \
y="@$$(basename $$x).txt"; \
: > ../$$y ;\
echo '#%#%#%# This is copyright analyser test data by Osamu Aoki.' >> ../$$y ;\
echo '#%#%#%# The following lines shall not be considered copyright statement.' >> ../$$y ;\
echo '#%#%#%# ' >> ../$$y ;\
cat $$x >> ../$$y ;\
done
# Please place "copyright" file from xorg-common package" in src/
mit:
@if [ ! -f copyright ]; then \
echo "Please place "copyright" file from xorg-common package"; \
fi
cd .. ; \
sed -n -e '1,47p' -e '53,$$p' src/copyright | \
grep -v "^SGI FREE SOFTWARE LICENSE B" > copyright-clean
cd ..; src/split copyright-clean
rm -f ../copyright-clean
test: test-dep5
test-dep5:
echo $$PATH
echo $$PYTHONPATH
cd .. ;\
: 2> $(PWD)/../.FULL_LICENSE.STDERR; \
(for x in $$(ls *.txt); do \
echo "File: $$x " >&2; \
checkdep5.py $$x 2>> $(PWD)/../.FULL_LICENSE.STDERR; \
done ) > $(PWD)/../.FULL_LICENSE.LOG
diff -u $(PWD)/../.FULL_LICENSE.KEEP $(PWD)/../.FULL_LICENSE.LOG > $(PWD)/../.FULL_LICENSE.DIFF
# If different, above line returns non-zero(=ERROR) and exit
@echo "=== SUCCESS ==="
test-id:
echo $$PATH
echo $$PYTHONPATH
cd .. ;\
: 2> $(PWD)/../.LICENSE.STDERR; \
(for x in $$(ls *.txt); do \
echo "File: $$x " >&2; \
checkdep5.py -i $$x 2>> $(PWD)/../.LICENSE.STDERR; \
done ) > $(PWD)/../.LICENSE.LOG
diff -u $(PWD)/../.LICENSE.KEEP $(PWD)/../.LICENSE.LOG > $(PWD)/../.LICENSE.DIFF
# If different, above line returns non-zero(=ERROR) and exit
@echo "=== SUCCESS ==="
test1:
echo $$PATH
echo $$PYTHONPATH
cd .. ;\
echo "File: $(TEST_FILE) "; \
checkdep5.py $(TEST_FILE)
@echo "=== SUCCESS ==="
clean:
rm -f $(PWD)/../.LICENSE.LOG $(PWD)/../.LICENSE.DIFF $(PWD)/../.FULL_LICENSE.STDERR
distclean: clean
|