summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBjörn Mattsson <bjorn@sunet.se>2022-11-18 13:54:15 +0100
committerBjörn Mattsson <bjorn@sunet.se>2022-11-18 13:54:15 +0100
commit7a91e93a308425e869fc6f28c3f317413eea2129 (patch)
treefca5d74793c1e074d6fa273c0be202c673b51e12 /Makefile
parent65081e7eba296b4ba54a8ae6c9ce4dc9c206ea7e (diff)
Uppdated scripts to support new directorys
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile89
1 files changed, 60 insertions, 29 deletions
diff --git a/Makefile b/Makefile
index 3d759a48..6be780e8 100644
--- a/Makefile
+++ b/Makefile
@@ -23,10 +23,12 @@ TOU := swamid-tou-en.txt swamid-tou-sv.txt
-include $(SWAMID_MK_CONFIG)
-all: clean dependencies test sign clean web
+all: clean dependencies signtest sign clean web
MXML=$(shell echo *.mxml)
-SWAMIDXML=$(patsubst swamid-2.0/%.xml,.time/%.time,$(wildcard swamid-2.0/*.xml))
+EDUGAINXML=$(patsubst swamid-edugain/%.xml,.time/%.time,$(wildcard swamid-edugain/*.xml))
+SWAMID20XML=$(patsubst swamid-2.0/%.xml,.time/%.time,$(wildcard swamid-2.0/*.xml))
+TESTINGXML=$(patsubst swamid-testing/%.xml,.time/%.time,$(wildcard swamid-testing/*.xml))
sign: swamid upstream
@@ -100,8 +102,8 @@ tidy:
@for x in `find $(SRCDIRS) -name \*.xml`; do xsltproc xslt/clean-entitydescriptor.xsl $$x > $$x.c && mv $$x.c $$x; done
testMetadataUsage:
- @echo "Checking for files in swamid-2.0 that isn't used"
- @for file in swamid-2.0/* ; do if ! grep -q $$file *.mxml; then echo " $$file is not referenced in any mxml file"; fi; done | sed 's/.*/&/'
+ @echo "Checking for files in swamid-edugain swamid-2.0 and swamid-testing that isn't used"
+ @for file in `find $(SRCDIRS) -name \*.xml` ; do if ! grep -q $$file *.mxml; then echo " $$file is not referenced in any mxml file"; fi; done | sed 's/.*/&/'
testRefedsRnS:
@echo "Checking for refeds R&S compatibillity for entities exported to eduGAIN"
@@ -135,7 +137,7 @@ testEduGAINchecks:
testMDUI:
@echo "Checking for uniq IdP MDUI DisplayName"
- @for lang in `cat swamid-2.0/*.xml | sed -n 's/.*xml:lang="\([^"]*\)".*/\1/p' | sort -u` ; do for x in `find $(SRCDIRS) -name \*.xml | xargs grep -l IDPSSODescriptor` ; do cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/IDPSSODescriptor/Extensions/UIInfo/DisplayName[@xml:lang='$$lang']" - 2>/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)</[^>]*>;\1\n;g' | sed "s;^; $$x $$lang ;" | sed 's/.*/&/' ; done | sort -k 3 | uniq -d -f 2 ; done | grep . && exit 1 || true
+ @for lang in `find $(SRCDIRS) -name \*.xml -exec cat {} \; | sed -n 's/.*xml:lang="\([^"]*\)".*/\1/p' | sort -u` ; do for x in `find $(SRCDIRS) -name \*.xml | xargs grep -l IDPSSODescriptor` ; do cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/IDPSSODescriptor/Extensions/UIInfo/DisplayName[@xml:lang='$$lang']" - 2>/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)</[^>]*>;\1\n;g' | sed "s;^; $$x $$lang ;" | sed 's/.*/&/' ; done | sort -k 3 | uniq -d -f 2 ; done | grep . && exit 1 || true
testIdPinSP:
@echo "Check that SP:s does not define IDPSSODescriptor"
@@ -175,49 +177,78 @@ checkInvalidChars:
fi;\
done | grep . && exit 1 || exit 0
-test: syntaxtest testMDUI testALlevel testEduGAINchecks testRefedsRnS testMetadataUsage testBadStrings testIdPinSP testRegistrationAuthority checkInvalidChars
+createMXMLfiles:
+ @echo Recreating MXML files
+ @scripts/create_mxml.sh | sed 's/.*/&/' | grep . && exit 1 || exit 0
-test2: $(SWAMIDXML) schematest testALlevel testEduGAINchecks testRefedsRnS testMetadataUsage testBadStrings testIdPinSP testRegistrationAuthority checkInvalidChars
+signtest: syntaxtest testMDUI testALlevel testEduGAINchecks testRefedsRnS testMetadataUsage testBadStrings testIdPinSP testRegistrationAuthority checkInvalidChars
+test: createMXMLfiles signtest
+
+test2: $(EDUGAINXML) $(SWAMID20XML) $(TESTINGXML) test
+
+.time/%.time: swamid-edugain/%.xml
+ @# make tidy
+ @xsltproc --stringparam regDate $(NOW) xslt/add-rpi.xsl $< > $<.c && mv $<.c $<
+ @xsltproc xslt/clean-entitydescriptor.xsl $< > $<.c && mv $<.c $<
+
+ @# make schematest
+ @xmllint --xinclude --nowarning --noout --path schema --schema schema.xsd $< 2>&1
+
+ @echo $< done
+ @touch -r $< $@
.time/%.time: swamid-2.0/%.xml
+ @# make tidy
+ @xsltproc --stringparam regDate $(NOW) xslt/add-rpi.xsl $< > $<.c && mv $<.c $<
+ @xsltproc xslt/clean-entitydescriptor.xsl $< > $<.c && mv $<.c $<
+
@# make schematest
@xmllint --xinclude --nowarning --noout --path schema --schema schema.xsd $< 2>&1
+ @echo $< done
+ @touch -r $< $@
+
+.time/%.time: swamid-testing/%.xml
@# make tidy
@xsltproc --stringparam regDate $(NOW) xslt/add-rpi.xsl $< > $<.c && mv $<.c $<
@xsltproc xslt/clean-entitydescriptor.xsl $< > $<.c && mv $<.c $<
- @# make testMDUI
- @echo "Checking for bad lang codes"
- @# Lang = ISO_639-1
- @cat $< | sed -n 's/.*xml:lang="\([^"]*\)".*/\1/p' | sort -u | grep -vxE 'cs|da|de|en|fi|fr|it|sv|no|nn|nb|is' | sed 's/.*/Bad lang code : &/' | grep . && exit 1 || true
- @if [ `grep EntityAttributes $< | wc -l ` -gt 2 ]; then echo "Multiple EntityAttributes" | sed 's/.*/&/' ; exit 1; fi
- @if ( grep -q IDPSSODescriptor $< ) ; then \
- echo "Do IdP checks" ; \
- echo ">Checking for uniq IdP MDUI DisplayName"; \
- for lang in `cat $< | sed -n 's/.*xml:lang="\(..\)".*/\1/p' | sort -u` ; do \
- mdui_displayname=`cat $< | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/IDPSSODescriptor/Extensions/UIInfo/DisplayName[@xml:lang='$$lang']" - 2>/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)</[^>]*>;\1\n;g'`;\
- organizationdisplayname=`cat $< | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/Organization/OrganizationDisplayName[@xml:lang='$$lang']" - 2>/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)</[^>]*>;\1\n;g'` ;\
- for x in `find $(SRCDIRS) -name \*.xml | xargs grep -l IDPSSODescriptor | egrep -v $<` ; do cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/IDPSSODescriptor/Extensions/UIInfo/DisplayName[@xml:lang='$$lang']" - 2>/dev/null | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)</[^>]*>;\1\n;g' | egrep "^$$mdui_displayname$$" | sed "s;^;Duplicate DisplayName in $$x for lang = $$lang\n;" | sed 's/.*/&/' ; done | grep . && exit 1 || true;\
- done; \
- echo ">Checking for invalid IPHint"; \
- cat $< | sed -n 's;.*<[a-z0-9:]*IPHint>\(.*\)</[a-z0-9:]*IPHint>;\1;p' | grep -vE '^$$|^[0-9./a-fA-F:]*$$' | sed 's/.*/&/'; \
- echo ">Checking for invalid geodata (syntax is geo:xx.yy,zz.vv)";\
- cat $< | sed -n 's;.*<[a-z0-9:]*GeolocationHint>\(.*\)</[a-z0-9:]*GeolocationHint>;\1;p' | grep -vE '^$$|^geo:[0-9][0-9][0-9.]*,[0-9][0-9][0-9.]*$$' | sed 's/.*/&/' ; \
- echo ">Check for IdP:s with Logos over http";\
- cat $< | grep 'Logo .*http://' | sed 's/.*>\(.*\)<.*/\1/' | grep . && exit 1 || exit 0 ; \
- fi
+ @# make schematest
+ @xmllint --xinclude --nowarning --noout --path schema --schema schema.xsd $< 2>&1
@echo $< done
@touch -r $< $@
+old_check:
+ @# make testMDUI
+ @#echo "Checking for bad lang codes"
+ @# Lang = ISO_639-1
+ @#cat $< | sed -n 's/.*xml:lang="\([^"]*\)".*/\1/p' | sort -u | grep -vxE 'cs|da|de|en|fi|fr|it|sv|no|nn|nb|is' | sed 's/.*/Bad lang code : &/' | grep . && exit 1 || true
+ @#if [ `grep EntityAttributes $< | wc -l ` -gt 2 ]; then echo "Multiple EntityAttributes" | sed 's/.*/&/' ; exit 1; fi
+ @#if ( grep -q IDPSSODescriptor $< ) ; then \
+ #echo "Do IdP checks" ; \
+ #echo ">Checking for uniq IdP MDUI DisplayName"; \
+ #for lang in `cat $< | sed -n 's/.*xml:lang="\(..\)".*/\1/p' | sort -u` ; do \
+ #mdui_displayname=`cat $< | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/IDPSSODescriptor/Extensions/UIInfo/DisplayName[@xml:lang='$$lang']" - 2>/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)</[^>]*>;\1\n;g'`;\
+ #organizationdisplayname=`cat $< | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/Organization/OrganizationDisplayName[@xml:lang='$$lang']" - 2>/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)</[^>]*>;\1\n;g'` ;\
+ #for x in `find $(SRCDIRS) -name \*.xml | xargs grep -l IDPSSODescriptor | egrep -v $<` ; do cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/IDPSSODescriptor/Extensions/UIInfo/DisplayName[@xml:lang='$$lang']" - 2>/dev/null | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)</[^>]*>;\1\n;g' | egrep "^$$mdui_displayname$$" | sed "s;^;Duplicate DisplayName in $$x for lang = $$lang\n;" | sed 's/.*/&/' ; done | grep . && exit 1 || true;\
+ #done; \
+ #echo ">Checking for invalid IPHint"; \
+ #cat $< | sed -n 's;.*<[a-z0-9:]*IPHint>\(.*\)</[a-z0-9:]*IPHint>;\1;p' | grep -vE '^$$|^[0-9./a-fA-F:]*$$' | sed 's/.*/&/'; \
+ #echo ">Checking for invalid geodata (syntax is geo:xx.yy,zz.vv)";\
+ #cat $< | sed -n 's;.*<[a-z0-9:]*GeolocationHint>\(.*\)</[a-z0-9:]*GeolocationHint>;\1;p' | grep -vE '^$$|^geo:[0-9][0-9][0-9.]*,[0-9][0-9][0-9.]*$$' | sed 's/.*/&/' ; \
+ #echo ">Check for IdP:s with Logos over http";\
+ #cat $< | grep 'Logo .*http://' | sed 's/.*>\(.*\)<.*/\1/' | grep . && exit 1 || exit 0 ; \
+ #fi
+
+
deeptest: test testMDUIreach
commit2: test2
@git diff --color || true
@echo ; echo -n "Run 'git commit -av'? [Y/n/skip] " ; read x ; case $$x in "Y"|"y"|"") git commit -av ;; s|skip) ;; *) exit 1 ;; esac
@git status -u
- @echo "Checking for not committed files in swamid-2.0/" ; if git status --porcelain --ignored | awk '{print $$2}' | grep "^swamid-2.0/" | sed 's/^/ /' | grep . ; then echo "Not committed files in swamid-2.0/, aborting" ; exit 1 ; fi
+ @echo "Checking for not committed files in swamid-*/" ; if git status --porcelain --ignored | awk '{print $$2}' | egrep "^swamid-edugain|^swamid-2.0/|^swamid-testing/" | sed 's/^/ /' | grep . ; then echo "Not committed files in swamid-*/, aborting" ; exit 1 ; fi
@echo ; echo -n "Run 'git push'? [Y/n] " ; read x ; case $$x in "Y"|"y"|"") ;; *) exit 1 ;; esac
@git push
@@ -225,6 +256,6 @@ commit: tidy test
@git diff --color || true
@echo ; echo -n "Run 'git commit -av'? [Y/n/skip] " ; read x ; case $$x in "Y"|"y"|"") git commit -av ;; s|skip) ;; *) exit 1 ;; esac
@git status -u
- @echo "Checking for not committed files in swamid-2.0/" ; if git status --porcelain --ignored | awk '{print $$2}' | grep "^swamid-2.0/" | sed 's/^/ /' | grep . ; then echo "Not committed files in swamid-2.0/, aborting" ; exit 1 ; fi
+ @echo "Checking for not committed files in swamid-*/" ; if git status --porcelain --ignored | awk '{print $$2}' | egrep "^swamid-edugain|^swamid-2.0/|^swamid-testing/" | sed 's/^/ /' | grep . ; then echo "Not committed files in swamid-*/, aborting" ; exit 1 ; fi
@echo ; echo -n "Run 'git push'? [Y/n] " ; read x ; case $$x in "Y"|"y"|"") ;; *) exit 1 ;; esac
@git push