aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarino <marino@FreeBSD.org>2013-07-21 22:31:45 +0800
committermarino <marino@FreeBSD.org>2013-07-21 22:31:45 +0800
commit11e4763e9b79c3af1580e457d82d688e15c06119 (patch)
tree4c436836600ac9038f2b69ef64b3b7f132040688
parent074ed681bdacdd876db5de117f32cd0039239393 (diff)
downloadfreebsd-ports-gnome-11e4763e9b79c3af1580e457d82d688e15c06119.tar.gz
freebsd-ports-gnome-11e4763e9b79c3af1580e457d82d688e15c06119.tar.zst
freebsd-ports-gnome-11e4763e9b79c3af1580e457d82d688e15c06119.zip
security/libsparkcrypto: Optionally generate documentation
It was not possible to generate libsparkcrypto documentation before the textproc/adabrowse port was created. Now that AdaBrowse is available, add a "DOCS" options to generate the documentation. While here, convert USE_GMAKE to USES+=gmake and fix DESTDIR to work properly instead of installing during the build phase. The Makefile also had to altered to install the documentation as well. Approved by: bapt (mentor)
-rw-r--r--security/libsparkcrypto/Makefile28
-rw-r--r--security/libsparkcrypto/files/patch-Makefile80
-rw-r--r--security/libsparkcrypto/pkg-plist32
3 files changed, 116 insertions, 24 deletions
diff --git a/security/libsparkcrypto/Makefile b/security/libsparkcrypto/Makefile
index 552122baab10..7bcf2f0e6674 100644
--- a/security/libsparkcrypto/Makefile
+++ b/security/libsparkcrypto/Makefile
@@ -3,6 +3,7 @@
PORTNAME= libsparkcrypto
PORTVERSION= 0.1.1
+PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= http://senier.net/libsparkcrypto/
EXTRACT_SUFX= .tgz
@@ -12,28 +13,35 @@ COMMENT= Cryptographic library implemented in SPARK
LICENSE= BSD
-USES= ada
-USE_GMAKE= yes
+USES= ada gmake
USE_DOS2UNIX= Makefile build/libsparkcrypto.gpr
SPARKARCH:= ${ARCH:S/amd64/x86_64/:S/i386/i686/}
-
-# The APIDOC requires AdaBrowse which in turn requires ASIS which is
-# coupled with the compiler. There is a question whether Adacore's
-# GPL ASIS is even compatible with FSF GNAT, which is what gcc-aux is.
-# Until this question is answered, skip API document building.
+DESTINY= ${WRKDIR}/destino
MAKE_ENV+= SPARKARCH=${SPARKARCH} \
SPARK_DIR=${WRKSRC}/src/spark \
- DESTDIR=${LOCALBASE} \
+ DESTDIR=${DESTINY} \
MODE=release \
RUNTIME=native \
NO_TESTS=true \
- NO_PROOF=true \
- NO_APIDOC=true
+ NO_PROOF=true
+
+OPTIONS_DEFINE= DOCS
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MDOCS}
+BUILD_DEPENDS+= adabrowse:${PORTSDIR}/textproc/adabrowse
+.else
+MAKE_ENV+= NO_APIDOC=true
+.endif
post-patch:
# ports passed unwanted ARCH definition to Makefile
@${REINPLACE_CMD} -e 's|ARCH|SPARKARCH|g' \
${WRKSRC}/Makefile
+post-install:
+ ${CP} -pR ${DESTINY}${PREFIX}/ ${PREFIX}/
+
.include <bsd.port.mk>
diff --git a/security/libsparkcrypto/files/patch-Makefile b/security/libsparkcrypto/files/patch-Makefile
index 85ca219ac02b..46a53a5fb4c6 100644
--- a/security/libsparkcrypto/files/patch-Makefile
+++ b/security/libsparkcrypto/files/patch-Makefile
@@ -1,6 +1,47 @@
---- Makefile.orig 2013-06-26 21:03:13.000000000 +0000
+--- Makefile.orig 2013-07-20 13:54:32.000000000 +0000
+++ Makefile
-@@ -154,21 +154,22 @@ $(OUTPUT_DIR)/proof/libsparkcrypto.idx:
+@@ -5,7 +5,6 @@ UNAME_M := $(shell uname -m)
+ ARCH ?= $(UNAME_M)
+ RUNTIME ?= native
+ TESTS ?= test_aes test_hmac test_ripemd160 test_sha2 test_shadow benchmark
+-DESTDIR ?= /usr/local
+ TARGET_CFG ?= $(OUTPUT_DIR)/target.cfg
+
+ VERSION ?= 0.1.1
+@@ -33,7 +32,7 @@ SHARED_DIRS = src/shared/$(ENDIANESS) sr
+ ARCH_FILES = $(wildcard src/ada/$(ARCH)/*.ad?)
+ ADT_FILES = $(addprefix $(OUTPUT_DIR)/tree/,$(notdir $(patsubst %.ads,%.adt,$(wildcard src/shared/generic/*.ads))))
+
+-ALL_GOALS = install_local
++ALL_GOALS =
+ INSTALL_DEPS = install_files
+
+ # SPARK_DIR must be set
+@@ -78,6 +77,7 @@ endif
+ # Feature: NO_APIDOC
+ ifeq ($(NO_APIDOC),)
+ ALL_GOALS += apidoc
++INSTALL_DEPS += install_docs
+ endif
+
+ ###############################################################################
+@@ -119,9 +119,12 @@ proof: $(OUTPUT_DIR)/proof/libsparkcrypt
+ apidoc: $(ADT_FILES)
+ echo $^ | xargs -n1 > $(OUTPUT_DIR)/tree.lst
+ adabrowse -T $(OUTPUT_DIR)/tree -f @$(OUTPUT_DIR)/tree.lst -w1 -c doc/adabrowse.conf -o $(OUTPUT_DIR)/doc/
+- install -m 644 doc/libsparkcrypto.css $(OUTPUT_DIR)/doc/libsparkcrypto.css
+- install -m 644 doc/apidoc.css $(OUTPUT_DIR)/doc/apidoc.css
+- install -m 644 doc/lsc_logo.png $(OUTPUT_DIR)/doc/lsc_logo.png
++
++install_docs:
++ install -d -m 755 $(DESTDIR)$(PREFIX)/share/doc/libsparkcrypto
++ install -m 644 doc/libsparkcrypto.css doc/apidoc.css \
++ doc/lsc_logo.png $(DESTDIR)$(PREFIX)/share/doc/libsparkcrypto
++ install -m 644 $(OUTPUT_DIR)/doc/* $(DESTDIR)$(PREFIX)/share/doc/libsparkcrypto/
+
+ archive: $(OUTPUT_DIR)/doc/libsparkcrypto-$(VERSION).tgz
+
+@@ -154,21 +157,33 @@ $(OUTPUT_DIR)/proof/libsparkcrypto.idx:
install: $(INSTALL_DEPS)
install_files: build
@@ -11,26 +52,37 @@
- install -p -m 644 src/shared/generic/*.ad? $(DESTDIR)/sharedinclude/
- install -p -m 644 src/ada/generic/*.ad? $(DESTDIR)/adainclude/
- install -p -m 644 src/ada/$(IO)/*.ad? $(DESTDIR)/adainclude/
-+ install -d -m 755 $(DESTDIR)/lib/libsparkcrypto $(DESTDIR)/include/libsparkcrypto/adainclude
-+ install -d -m 755 $(DESTDIR)/lib/gnat $(DESTDIR)/include/libsparkcrypto/sharedinclude
-+ install -p -m 755 $(OUTPUT_DIR)/build/adalib/libsparkcrypto.a $(DESTDIR)/lib/libsparkcrypto/libsparkcrypto.a
-+ install -p -m 644 build/libsparkcrypto.gpr $(DESTDIR)/lib/gnat/libsparkcrypto.gpr
-+ install -p -m 644 src/shared/$(ENDIANESS)/*.ad? $(DESTDIR)/include/libsparkcrypto/sharedinclude/
-+ install -p -m 644 src/shared/generic/*.ad? $(DESTDIR)/include/libsparkcrypto/sharedinclude/
-+ install -p -m 644 src/ada/generic/*.ad? $(DESTDIR)/include/libsparkcrypto/adainclude/
-+ install -p -m 644 src/ada/$(IO)/*.ad? $(DESTDIR)/include/libsparkcrypto/adainclude/
++ install -d -m 755 $(DESTDIR)$(PREFIX)/lib/libsparkcrypto \
++ $(DESTDIR)$(PREFIX)/include/libsparkcrypto/adainclude \
++ $(DESTDIR)$(PREFIX)/lib/gnat \
++ $(DESTDIR)$(PREFIX)/include/libsparkcrypto/sharedinclude
++ install -p -m 755 $(OUTPUT_DIR)/build/adalib/libsparkcrypto.a \
++ $(DESTDIR)$(PREFIX)/lib/libsparkcrypto
++ install -p -m 644 build/libsparkcrypto.gpr \
++ $(DESTDIR)$(PREFIX)/lib/gnat
++ install -p -m 644 src/shared/$(ENDIANESS)/*.ad? \
++ $(DESTDIR)$(PREFIX)/include/libsparkcrypto/sharedinclude/
++ install -p -m 644 src/shared/generic/*.ad? \
++ $(DESTDIR)$(PREFIX)/include/libsparkcrypto/sharedinclude/
++ install -p -m 644 src/ada/generic/*.ad? \
++ $(DESTDIR)$(PREFIX)/include/libsparkcrypto/adainclude/
++ install -p -m 644 src/ada/$(IO)/*.ad? \
++ $(DESTDIR)$(PREFIX)/include/libsparkcrypto/adainclude/
ifneq ($(strip $(ARCH_FILES)),)
- install -p -m 644 $(ARCH_FILES) $(DESTDIR)/adainclude/
-+ install -p -m 644 $(ARCH_FILES) $(DESTDIR)/include/libsparkcrypto/adainclude/
++ install -p -m 644 $(ARCH_FILES) \
++ $(DESTDIR)$(PREFIX)/include/libsparkcrypto/adainclude/
endif
- install -p -m 444 $(OUTPUT_DIR)/build/adalib/*.ali $(DESTDIR)/adalib/
-+ install -p -m 444 $(OUTPUT_DIR)/build/adalib/*.ali $(DESTDIR)/lib/libsparkcrypto/
++ install -p -m 444 $(OUTPUT_DIR)/build/adalib/*.ali \
++ $(DESTDIR)$(PREFIX)/lib/libsparkcrypto/
install_proof: install_files proof
- install -D -p -m 444 $(OUTPUT_DIR)/proof/libsparkcrypto.sum $(DESTDIR)/libsparkcrypto.sum
- (cd $(OUTPUT_DIR)/empty && sparkmake -include=*\.ads -dir=$(DESTDIR)/sharedinclude -nometa -index=$(DESTDIR)/libsparkcrypto.idx)
-+ install -D -p -m 444 $(OUTPUT_DIR)/proof/libsparkcrypto.sum $(DESTDIR)/include/libsparkcrypto/libsparkcrypto.sum
-+ (cd $(OUTPUT_DIR)/empty && sparkmake -include=*\.ads -dir=$(DESTDIR)/include/libsparkcrypto/sharedinclude -nometa -index=$(DESTDIR)/include/libsparkcrypto/libsparkcrypto.idx)
++ install -D -p -m 444 $(OUTPUT_DIR)/proof/libsparkcrypto.sum \
++ $(DESTDIR)$(PREFIX)/include/libsparkcrypto
++ (cd $(OUTPUT_DIR)/empty && sparkmake -include=*\.ads -dir=$(DESTDIR)$(PREFIX)/include/libsparkcrypto/sharedinclude -nometa -index=$(DESTDIR)$(PREFIX)/include/libsparkcrypto/libsparkcrypto.idx)
install_local: DESTDIR = $(OUTPUT_DIR)/libsparkcrypto
install_local: install
diff --git a/security/libsparkcrypto/pkg-plist b/security/libsparkcrypto/pkg-plist
index dcf247b16788..aaaac1b74500 100644
--- a/security/libsparkcrypto/pkg-plist
+++ b/security/libsparkcrypto/pkg-plist
@@ -81,8 +81,40 @@ lib/libsparkcrypto/lsc-sha512.ali
lib/libsparkcrypto/lsc-test.ali
lib/libsparkcrypto/lsc-types.ali
lib/libsparkcrypto/lsc.ali
+%%PORTDOCS%%%%DOCSDIR%%/apidoc.css
+%%PORTDOCS%%%%DOCSDIR%%/libsparkcrypto.css
+%%PORTDOCS%%%%DOCSDIR%%/lsc-aes-cbc.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-aes-print.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-aes-tables.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-aes.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-byteorder32.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-byteorder64.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-byteswap32.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-byteswap64.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-debug.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-hmac_ripemd160.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-hmac_sha256.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-hmac_sha384.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-hmac_sha512.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-io.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-ops32.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-ops64.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-pad32.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-pad64.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-ripemd160-print.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-ripemd160.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-sha256-tables.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-sha256.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-sha512-tables.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-sha512.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-test.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc-types.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc.html
+%%PORTDOCS%%%%DOCSDIR%%/lsc_logo.png
+%%PORTDOCS%%%%DOCSDIR%%/subprograms.html
@dirrm include/libsparkcrypto/sharedinclude
@dirrm include/libsparkcrypto/adainclude
@dirrm include/libsparkcrypto
@dirrm lib/libsparkcrypto
+@dirrmtry %%DOCSDIR%%
@dirrmtry lib/gnat