1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 10:59:02 +00:00

The licence formatting sed scripts are now compatible with gnu and bsd sed, so they can now be used to build a macOSX installer

This commit is contained in:
michael
2008-07-11 20:02:09 +00:00
parent 18e9fe6dc4
commit 1b9b15f45a
7 changed files with 35 additions and 42 deletions

View File

@@ -15,7 +15,7 @@ winbuild:
@cat ./nsis/Nmap.nsi | sed 's/VIProductVersion ".*"/VIProductVersion "$(NMAP_NUM_VERSION)"/' > ./nmap.nsi.tmp
@cat ./nmap.nsi.tmp | sed 's/!define VERSION ".*"/!define VERSION "$(NMAP_VERSION)"/' > ./nsis/Nmap.nsi
@rm ./nmap.nsi.tmp ./nmap.rc.tmp
@sed -f ./license-sed/lic_sedexp_1 ../COPYING | sed -f ./license-sed/lic_sedexp_2 | sed -f ./license-sed/lic_sedexp_3 | sed -f ./license-sed/lic_sedexp_4 > LICENSE
@./license-format/licformat.sh ../COPYING > LICENSE
$(VCEXPRESS) nmap.sln /build release /log $(LOGLOC)
$(MAKENSIS) winpcap/winpcap-nmap.nsi

View File

@@ -0,0 +1,12 @@
#!/bin/bash
sed -f ./license-format/licsed_1 $1 | tr '\n' ' '| awk 'NR==1{printf("\n%s", $0) }' |
awk '{for (i=1&&j=2; i <= NF; i++&&j++) if($i=="SDFGHJdblnewline"){printf("\n\n")}
else if($i=="oSDFGHbullet"){printf(" \no ")}
else if($i=="Copyright" && $j=="(C)"){printf("\n%s ",$i)}
else if($i=="author" && $j=="Gnomovision"){printf("author\n")}
else if($i=="1989" && $j== "Ty"){printf("1989\n")}
else{printf("%s ",$i)}}' |
sed -f ./license-format/licsed_2

View File

@@ -2,7 +2,7 @@
s@\*\*@@g
# preserve double hyphens between words in GNU GPL
s@\([^\S\-]\)\-\-\([^\S\-]\)@\1SDFGHdbldash\2@g
s@\([^\-]\)\-\-\([^\-]\)@\1SDFGHdbldash\2@g
# remove horizontal hyphens
s@\-\-@@g
@@ -11,22 +11,26 @@ s@\-\-@@g
s@SDFGHdbldash@--@g
# remove trailing asterisk
s@\s*\*\s*$@@g
s@[ ]*\*[ ]*$@@g
# remove leading asterisk
s@^\s*\*\s*@@g
s@^[ ]*\*@@
# remove lonely slash
s@^/$@@g
# remove leading whitespace
s@^\s\+@@g
s@^[ ]*@@g
# preserve bullets
s@^o\s@oSDFGHbullet@g
s@^o @ oSDFGHbullet @g
# preserve sentence spacing
s@\.\s\s\(\S\)@.SDFGHJdblspace\1@g
s@\. \([A-Za-z0-9]\)@.SDFGHJdblspace\1@g
# remove first line
1d
# read entire input and preserve paragraph separation
s@^$@ SDFGHJdblnewline @

View File

@@ -0,0 +1,12 @@
# collapse whitespace
s@ @ @g
s@ $@@g
2d
# reintroduce bullets
s@oSDFGHbullet@o @g
# reintroduce sentence spacing
s@SDFGHJdblspace@ @g

View File

@@ -1,8 +0,0 @@
# read entire input and preserve paragraph separation
: more
$!N
t enough
$!b more
: enough
s@\n\n@SDFGHJdblnewline@g

View File

@@ -1,8 +0,0 @@
# read entire input and replace all newlines with a space
: more
$!N
t enough
$!b more
: enough
s@\n@ @g

View File

@@ -1,19 +0,0 @@
# newline first line
s@^\s\(COPYING\)@\n\1@g
# collapse whitespace
s@\s\s@ @g
# reintroduce double newlines
s@SDFGHJdblnewline@\n\n@g
# reintroduce bullets
s@oSDFGHbullet@\no @g
# reintroduce sentence spacing
s@SDFGHJdblspace@ @g
# Clean up GNU "How to apply"
s@\.\s\(Copyright (C) 19yy\)@\.\n\1@g
s@\(name\sof\sauthor\)\s\(Gnomovision\)@\1\n\2@g
s@1989 Ty Coon@1989\nTy Coon@g