Nmap Development mailing list archives

[PATCH] nsis license page


From: jah <jah () zadkiel plus com>
Date: Wed, 19 Mar 2008 21:22:52 +0000

Hi,

Attached is nsis_license.patch which will add a line to mswin32/makefile
(comprising sed commands), create 4 files (in mswin32) containing sed
expressions and modify mswin32/nsis/Nmap.nsi to use the resultant
LICENSE file (a reformatted COPYING) in the installer.

The nsis installer license page would look like the attached
nsis_license_page.png.

It's not the most elegant solution, but the result is a much clearer
license [1] which wraps inside the text-area.  I chose to use the
COPYING file and sed because it seemed to be the solution that required
the least change to the build environment as sed is already in use in
mswin32/makefile (and, for instance, doesn't require extra packages to
be installed under cygwin).

Other than removing the COPYING C-style comments and allowing the text
to wrap, bullet points have been left-aligned and are no longer
indented.  This obviously changes the appearance slightly, but I think
looks better than it would if long lines wrapped to the left of the bullets.

regards,

jah


[1]   Image showing the current license page -
http://seclists.org/nmap-dev/2007/q4/att-0560/nsis_license_png

diff -urNb nmap-4.60/mswin32/Makefile nmap-4.60_nsis_license/mswin32/Makefile
--- nmap-4.60/mswin32/Makefile  Wed Dec 12 02:09:59 2007
+++ nmap-4.60_nsis_license/mswin32/Makefile     Wed Mar 19 20:31:10 2008
@@ -15,6 +15,7 @@
        @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 ./lic_sedexp_1 ../COPYING | sed -f ./lic_sedexp_2 | sed -f ./lic_sedexp_3 | sed -f ./lic_sedexp_4 > 
LICENSE
 
        $(VCEXPRESS) nmap.sln /build release /log $(LOGLOC)
        $(MAKENSIS) winpcap/winpcap-nmap.nsi
diff -urNb nmap-4.60/mswin32/lic_sedexp_1 nmap-4.60_nsis_license/mswin32/lic_sedexp_1
--- nmap-4.60/mswin32/lic_sedexp_1      Thu Jan  1 00:00:00 1970
+++ nmap-4.60_nsis_license/mswin32/lic_sedexp_1 Wed Mar 19 20:24:39 2008
@@ -0,0 +1,32 @@
+# remove horizontal asterisks
+s@\*\*@@g
+
+# preserve double hyphens between words in GNU GPL
+s@\([^\S\-]\)\-\-\([^\S\-]\)@\1SDFGHdbldash\2@g
+
+# remove horizontal hyphens
+s@\-\-@@g
+
+# reintroduce double hyphens
+s@SDFGHdbldash@--@g
+
+# remove trailing asterisk
+s@\s*\*\s*$@@g
+
+# remove leading asterisk
+s@^\s*\*\s*@@g
+
+# remove lonely slash
+s@^/$@@g
+
+# remove leading whitespace
+s@^\s\+@@g
+
+# preserve bullets
+s@^o\s@oSDFGHbullet@g
+
+# preserve sentence spacing
+s@\.\s\s\(\S\)@.SDFGHJdblspace\1@g
+
+# remove first line
+1d
diff -urNb nmap-4.60/mswin32/lic_sedexp_2 nmap-4.60_nsis_license/mswin32/lic_sedexp_2
--- nmap-4.60/mswin32/lic_sedexp_2      Thu Jan  1 00:00:00 1970
+++ nmap-4.60_nsis_license/mswin32/lic_sedexp_2 Wed Mar 19 20:27:01 2008
@@ -0,0 +1,8 @@
+# read entire input and preserve paragraph separation
+
+: more
+$!N
+t enough
+$!b more
+: enough
+s@\n\n@SDFGHJdblnewline@g
diff -urNb nmap-4.60/mswin32/lic_sedexp_3 nmap-4.60_nsis_license/mswin32/lic_sedexp_3
--- nmap-4.60/mswin32/lic_sedexp_3      Thu Jan  1 00:00:00 1970
+++ nmap-4.60_nsis_license/mswin32/lic_sedexp_3 Wed Mar 19 20:25:54 2008
@@ -0,0 +1,8 @@
+# read entire input and replace all newlines with a space
+
+: more
+$!N
+t enough
+$!b more
+: enough
+s@\n@ @g
diff -urNb nmap-4.60/mswin32/lic_sedexp_4 nmap-4.60_nsis_license/mswin32/lic_sedexp_4
--- nmap-4.60/mswin32/lic_sedexp_4      Thu Jan  1 00:00:00 1970
+++ nmap-4.60_nsis_license/mswin32/lic_sedexp_4 Mon Mar 17 13:00:32 2008
@@ -0,0 +1,19 @@
+# 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
\ No newline at end of file
diff -urNb nmap-4.60/mswin32/nsis/Nmap.nsi nmap-4.60_nsis_license/mswin32/nsis/Nmap.nsi
--- nmap-4.60/mswin32/nsis/Nmap.nsi     Fri Feb  8 15:25:14 2008
+++ nmap-4.60_nsis_license/mswin32/nsis/Nmap.nsi        Sat Mar  8 01:18:39 2008
@@ -42,7 +42,7 @@
 ;Pages 
  
 ;  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt" 
-  !insertmacro MUI_PAGE_LICENSE "..\..\COPYING" 
+  !insertmacro MUI_PAGE_LICENSE "..\LICENSE" 
   !insertmacro MUI_PAGE_COMPONENTS 
   !insertmacro MUI_PAGE_DIRECTORY 
   !insertmacro MUI_PAGE_INSTFILES 


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: