1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-15 19:09:01 +00:00

Modify the macosx makefile and add files necessary to build a managed

metapackage (.mpkg) installer. The installer lets you pick if you want to
install Nmap or Zenmap or both. It puts Nmap in /usr/local and the previously
developed Zenmap.app in /Applications.
This commit is contained in:
david
2008-04-24 22:54:19 +00:00
parent 6982bacef5
commit 7d2a93ec02
6 changed files with 146 additions and 16 deletions

View File

@@ -4,30 +4,59 @@
NMAP_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_VERSION' ../nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q')
NMAP_NUM_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_NUM_VERSION' ../nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q')
IMAGE_NAME = zenmap-$(NMAP_VERSION)$(if $(APPENDAGE),-$(APPENDAGE))
STAGING_DIR = $(IMAGE_NAME)
NAME_VERSION = nmap-$(NMAP_VERSION)$(if $(APPENDAGE),-$(APPENDAGE))
DIST_FILES = $(addprefix $(STAGING_DIR)/,Zenmap.app COPYING README)
IMAGE_STAGING_DIR = $(NAME_VERSION)
NMAP_STAGING_DIR = Nmap
ZENMAP_STAGING_DIR = Zenmap
NMAP_BUILD_DIR = nmap-build
$(IMAGE_NAME).dmg: $(DIST_FILES)
IMAGE_NAME = $(NAME_VERSION).dmg
PKG_NAME = $(NAME_VERSION).mpkg
PREFIX = /usr/local
PACKAGEMAKER = /Developer/usr/bin/packagemaker
EXTRA_DIST_FILES = $(addprefix $(IMAGE_STAGING_DIR)/,COPYING README)
$(IMAGE_NAME): $(IMAGE_STAGING_DIR)/$(PKG_NAME) $(EXTRA_DIST_FILES)
rm -f $@
hdiutil create -imagekey zlib-level=9 -srcfolder $(STAGING_DIR) $@
hdiutil create -imagekey zlib-level=9 -srcfolder $(IMAGE_STAGING_DIR) $@
$(STAGING_DIR)/Zenmap.app:
mkdir -p $(STAGING_DIR)
$(IMAGE_STAGING_DIR)/$(PKG_NAME): stage-nmap stage-zenmap
mkdir -p $(IMAGE_STAGING_DIR)
$(PACKAGEMAKER) --doc nmap.pmdoc --title "Nmap $(NMAP_VERSION)" -o $@
stage-nmap:
rm -rf $(NMAP_BUILD_DIR)
svn export .. $(NMAP_BUILD_DIR)
svn export ../nsock $(NMAP_BUILD_DIR)/nsock
svn export ../nbase $(NMAP_BUILD_DIR)/nbase
svn export ../zenmap $(NMAP_BUILD_DIR)/zenmap
cd $(NMAP_BUILD_DIR) && ./configure --prefix="$(PREFIX)" --without-zenmap --with-libdnet=included --with-libpcap=included --with-libpcre=included --with-liblua=included
make -C $(NMAP_BUILD_DIR)
rm -rf $(NMAP_STAGING_DIR)
make -C $(NMAP_BUILD_DIR) install DESTDIR="`pwd`/$(NMAP_STAGING_DIR)"
stage-zenmap:
mkdir -p $(ZENMAP_STAGING_DIR)/Applications
cd ../zenmap && install_scripts/macosx/make-bundle.sh
cp -rf ../zenmap/dist/Zenmap.app $(STAGING_DIR)/
cp -rf ../zenmap/dist/Zenmap.app $(ZENMAP_STAGING_DIR)/Applications/
$(STAGING_DIR)/README:
mkdir -p $(STAGING_DIR)
cp -f README $(STAGING_DIR)/
$(IMAGE_STAGING_DIR)/README:
mkdir -p $(IMAGE_STAGING_DIR)
cp -f README $(IMAGE_STAGING_DIR)/
$(STAGING_DIR)/COPYING:
mkdir -p $(STAGING_DIR)
cp -f ../COPYING $(STAGING_DIR)/
$(IMAGE_STAGING_DIR)/COPYING:
mkdir -p $(IMAGE_STAGING_DIR)
cp -f ../COPYING $(IMAGE_STAGING_DIR)/
clean:
rm -rf $(STAGING_DIR)
rm -f $(IMAGE_NAME).dmg
rm -rf $(IMAGE_STAGING_DIR)
rm -rf $(NMAP_STAGING_DIR)
rm -rf $(ZENMAP_STAGING_DIR)
rm -rf $(NMAP_BUILD_DIR)
rm -f $(IMAGE_NAME)
.PHONY: clean

View File

@@ -0,0 +1,3 @@
<pkg-contents spec="1.12">
<f n="Nmap" pt="Nmap" m="false" t="file"/>
</pkg-contents>

View File

@@ -0,0 +1,25 @@
<pkgref spec="1.12" uuid="A488395A-3951-449A-B3F6-A74D5E926D69">
<config>
<identifier>org.insecure.nmap.nmap.pkg</identifier>
<version>1</version>
<description />
<post-install type="none" />
<requireAuthorization />
<installFrom relative="true" includeRoot="false">Nmap</installFrom>
<installTo>/</installTo>
<flags>
<followSymbolicLinks />
</flags>
<packageStore type="internal" />
<mod>parent</mod>
<mod>installFrom.isRelativeType</mod>
</config>
<contents>
<file-list>01nmap-contents.xml</file-list>
<filter>/CVS$</filter>
<filter>/\.svn$</filter>
<filter>/\.cvsignore$</filter>
<filter>/\.cvspass$</filter>
<filter>/\.DS_Store$</filter>
</contents>
</pkgref>

View File

@@ -0,0 +1,3 @@
<pkg-contents spec="1.12">
<f n="Zenmap.app" pt="Zenmap/Applications/Zenmap.app" m="false" t="file"/>
</pkg-contents>

View File

@@ -0,0 +1,37 @@
<pkgref spec="1.12" uuid="FC648982-1188-47E2-9FA7-5492BAB9EF2D">
<config>
<identifier>org.insecure.nmap.zenmap.pkg</identifier>
<version>1</version>
<description />
<post-install type="none" />
<requireAuthorization />
<installFrom relative="true" includeRoot="true">Zenmap/Applications/Zenmap.app</installFrom>
<installTo relocatable="true">/Applications</installTo>
<flags>
<followSymbolicLinks />
</flags>
<packageStore type="internal" />
<mod>parent</mod>
<mod>installFrom.isRelativeType</mod>
</config>
<contents>
<file-list>02zenmap-contents.xml</file-list>
<component id="org.insecure.Zenmap"
path="Zenmap/Applications/Zenmap.app"
version="4.60">
<locator-info>
<token title="pkmk-token-199">
<search-rule>
<combo identifier="org.insecure.Zenmap"
default-path="/Applications/Zenmap.app" />
</search-rule>
</token>
</locator-info>
</component>
<filter>/CVS$</filter>
<filter>/\.svn$</filter>
<filter>/\.cvsignore$</filter>
<filter>/\.cvspass$</filter>
<filter>/\.DS_Store$</filter>
</contents>
</pkgref>

View File

@@ -0,0 +1,33 @@
<pkmkdoc spec="1.12">
<properties>
<title>Nmap</title>
<organization>org.insecure</organization>
<userSees ui="both" />
<min-target os="2" />
<domain system="true" />
</properties>
<distribution>
<versions min-spec="1.000000" />
<scripts></scripts>
</distribution>
<contents>
<choice title="Nmap" id="choice92" starts_selected="true"
starts_enabled="true" starts_hidden="false">
<pkgref id="org.insecure.nmap.nmap.pkg" />
</choice>
<choice title="Zenmap" id="choice93" starts_selected="true"
starts_enabled="true" starts_hidden="false">
<pkgref id="org.insecure.nmap.zenmap.pkg" />
</choice>
</contents>
<resources bg-scale="none" bg-align="topleft">
<locale lang="en" />
</resources>
<flags />
<item type="file">01nmap.xml</item>
<item type="file">02zenmap.xml</item>
<mod>properties.customizeOption</mod>
<mod>properties.title</mod>
<mod>properties.anywhereDomain</mod>
<mod>properties.systemDomain</mod>
</pkmkdoc>