svn commit: r316038 - in head/math/libtommath: . files

Pietro Cerutti gahr at FreeBSD.org
Thu Apr 18 12:26:59 UTC 2013


Author: gahr
Date: Thu Apr 18 12:26:58 2013
New Revision: 316038
URL: http://svnweb.freebsd.org/changeset/ports/316038

Log:
  - Take maintainership
  - Add an OPTION to build the shared library in addition to the static one
  - Add DOCS to OPTIONs
  
  Feature safe:	yes

Modified:
  head/math/libtommath/Makefile
  head/math/libtommath/files/patch-makefile   (contents, props changed)

Modified: head/math/libtommath/Makefile
==============================================================================
--- head/math/libtommath/Makefile	Thu Apr 18 12:06:10 2013	(r316037)
+++ head/math/libtommath/Makefile	Thu Apr 18 12:26:58 2013	(r316038)
@@ -6,17 +6,45 @@ CATEGORIES=	math
 MASTER_SITES=	http://libtom.org/files/
 DISTNAME=	ltm-${PORTVERSION}
 
-MAINTAINER=	ports at FreeBSD.org
+MAINTAINER=	gahr at FreeBSD.org
 COMMENT=	Comprehensive, modular, and portable mathematical routines
 
+OPTIONS_DEFINE=	DOCS SHARED
+SHARED_DESC=	Build shared library
+
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
-MAKEFILE=	makefile
 USE_BZIP2=	yes
 USE_GMAKE=	yes
 ALL_TARGET=	default
+CFLAGS+=	-fPIC
+PORTDOCS=	*
 MAKE_JOBS_SAFE=	yes
 
 PLIST_FILES=	include/tommath.h include/tommath_class.h \
 		include/tommath_superclass.h lib/libtommath.a
 
+.include <bsd.port.options.mk>
+
+post-patch:
+	${REINPLACE_CMD} -e 's|gcc|${CC}|g' ${WRKSRC}/makefile.shared
+
+.if ${PORT_OPTIONS:MSHARED}
+BUILD_DEPENDS=	libtool:${PORTSDIR}/devel/libtool
+USE_LDCONFIG=	yes
+PLIST_FILES+=	lib/libtommath.la lib/libtommath.so.0 lib/libtommath.so
+MAKEFILE=	makefile.shared
+PLIST_SUB+=	SHARED=""
+.else
+MAKEFILE=	makefile
+PLIST_SUB+=	SHARED="@comment "
+.endif
+
+.if ${PORT_OPTIONS:MDOCS}
+post-install:
+	${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/bn.pdf ${DOCSDIR}/
+	${INSTALL_DATA} ${WRKSRC}/poster.pdf ${DOCSDIR}/
+	${INSTALL_DATA} ${WRKSRC}/tommath.pdf ${DOCSDIR}/
+.endif
+
 .include <bsd.port.mk>

Modified: head/math/libtommath/files/patch-makefile
==============================================================================
--- head/math/libtommath/files/patch-makefile	Thu Apr 18 12:06:10 2013	(r316037)
+++ head/math/libtommath/files/patch-makefile	Thu Apr 18 12:26:58 2013	(r316038)
@@ -18,7 +18,31 @@
 -DATAPATH=/usr/share/doc/libtommath/pdf
 +LIBPATH=${PREFIX}/lib
 +INCPATH=${PREFIX}/include
-+DATAPATH=${PREFIX}/share/doc/libtommath/pdf
++DATAPATH=${DOCSDIR}/pdf
+ 
+ OBJECTS=bncore.o bn_mp_init.o bn_mp_clear.o bn_mp_exch.o bn_mp_grow.o bn_mp_shrink.o \
+ bn_mp_clamp.o bn_mp_zero.o  bn_mp_set.o bn_mp_set_int.o bn_mp_init_size.o bn_mp_copy.o \
+--- makefile.shared.bak	2010-07-30 12:05:21.219322050 +0200
++++ makefile.shared	2010-07-30 12:07:19.588144344 +0200
+@@ -14,7 +14,7 @@
+ ifndef IGNORE_SPEED
+ 
+ #for speed 
+-CFLAGS += -O3 -funroll-loops
++CFLAGS += -funroll-loops
+ 
+ #for size 
+ #CFLAGS += -Os
+@@ -53,9 +53,9 @@
+ #INCPATH-The directory to install the header files for libtommath.
+ #DATAPATH-The directory to install the pdf docs.
+ DESTDIR=
+-LIBPATH=/usr/lib
+-INCPATH=/usr/include
+-DATAPATH=/usr/share/doc/libtommath/pdf
++LIBPATH=${PREFIX}/lib
++INCPATH=${PREFIX}/include
++DATAPATH=${DOCSDIR}/pdf
  
  OBJECTS=bncore.o bn_mp_init.o bn_mp_clear.o bn_mp_exch.o bn_mp_grow.o bn_mp_shrink.o \
  bn_mp_clamp.o bn_mp_zero.o  bn_mp_set.o bn_mp_set_int.o bn_mp_init_size.o bn_mp_copy.o \


More information about the svn-ports-all mailing list