Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Nov 2016 01:06:27 +0000 (UTC)
From:      "Sergey A. Osokin" <osa@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r426303 - in head/www: nginx nginx-devel nginx-devel/files nginx/files
Message-ID:  <201611180106.uAI16RJd007647@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: osa
Date: Fri Nov 18 01:06:26 2016
New Revision: 426303
URL: https://svnweb.freebsd.org/changeset/ports/426303

Log:
  Add third-party fastdfs module.
  
  PR:	213979

Added:
  head/www/nginx-devel/files/extra-patch-fastdfs-src-config   (contents, props changed)
  head/www/nginx/files/extra-patch-fastdfs-src-config   (contents, props changed)
Modified:
  head/www/nginx-devel/Makefile
  head/www/nginx-devel/distinfo
  head/www/nginx/Makefile
  head/www/nginx/distinfo

Modified: head/www/nginx-devel/Makefile
==============================================================================
--- head/www/nginx-devel/Makefile	Thu Nov 17 23:59:44 2016	(r426302)
+++ head/www/nginx-devel/Makefile	Fri Nov 18 01:06:26 2016	(r426303)
@@ -67,6 +67,7 @@ OPTIONS_DEFINE=	\
 	CLOJURE \
 	CT \
 	ECHO \
+	FASTDFS \
 	HEADERS_MORE \
 	HTTP_ACCEPT_LANGUAGE \
 	HTTP_ACCESSKEY \
@@ -176,6 +177,7 @@ CACHE_PURGE_DESC=		3rd party cache_purge
 CLOJURE_DESC=			3rd party clojure module
 CT_DESC=			3rd party cert_transparency module (SSL req.)
 ECHO_DESC=			3rd party echo module
+FASTDFS_DESC=			3rd party fastdfs module
 HEADERS_MORE_DESC=		3rd party headers_more module
 HTTP_ACCEPT_LANGUAGE_DESC=	3rd party accept_language module
 HTTP_ACCESSKEY_DESC=		3rd party http_accesskey module
@@ -457,6 +459,21 @@ CONFIGURE_ARGS+=--add-module=${WRKSRC_ec
 .endif
 .endif
 
+.if ${PORT_OPTIONS:MFASTDFS}
+NGINX_FASTDFS_VERSION=     5a8110f
+GH_ACCOUNT+=    happyfish100:fastdfs
+GH_PROJECT+=    fastdfs-nginx-module:fastdfs
+GH_TAGNAME+=    ${NGINX_FASTDFS_VERSION}:fastdfs
+EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-fastdfs-src-config
+BUILD_DEPENDS+=	${LOCALBASE}/include/fastcommon/logger.h:devel/libfastcommon \
+		${LOCALBASE}/include/fastdfs/fdfs_client.h:ftp/fastdfs
+LIB_DEPENDS+=	libfastcommon.so:devel/libfastcommon \
+		libfdfsclient.so:ftp/fastdfs
+CONFIGURE_ARGS+=--add-module=${WRKSRC_fastdfs}/src \
+		--with-cc-opt="-I ${LOCALBASE}/include/fastdfs \
+		-I ${LOCALBASE}/include/fastcommon"
+.endif
+
 .if ${PORT_OPTIONS:MHEADERS_MORE}
 NGINX_HEADERS_MORE_VERSION=	84241e4
 GH_ACCOUNT+=	openresty:headers_more
@@ -1194,6 +1211,12 @@ post-patch:
 		's!%%PREFIX%%!${LOCALBASE}!g' \
 		${WRKSRC_drizzle}/config
 .endif
+.if ${PORT_OPTIONS:MFASTDFS}
+	@${REINPLACE_CMD} \
+		's!%%PREFIX%%!${PREFIX}!g; \
+		s!%%LOCALBASE%%!${LOCALBASE}!g' \
+		${WRKSRC_fastdfs}/src/config
+.endif
 # Respect CFLAGS by remove needless --std=c99 flag
 .if ${PORT_OPTIONS:MGRIDFS}
 	@${REINPLACE_CMD} \
@@ -1296,6 +1319,11 @@ do-install:
 		${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/
 .endif
 
+.if ${PORT_OPTIONS:MFASTDFS}
+	${MKDIR} ${STAGEDIR}${PREFIX}/etc/fdfs
+	${INSTALL_DATA} ${WRKSRC_fastdfs}/src/mod_fastdfs.conf ${STAGEDIR}${PREFIX}/etc/fdfs/mod_fastdfs.conf.sample
+.endif
+
 # Install dynamic modules
 .if !empty(PORT_OPTIONS:MDSO)
 	(cd ${WRKSRC}/objs/ && ${FIND} . -name '*.so' -maxdepth 1 -type f \
@@ -1319,6 +1347,10 @@ post-install:
 	${ECHO_CMD} etc/nginx/naxsi_core.rules >> ${TMPPLIST}
 .endif
 
+.if ${PORT_OPTIONS:MFASTDFS}
+	${ECHO_CMD} @sample etc/fdfs/mod_fastdfs.conf.sample >> ${TMPPLIST}
+.endif
+
 # Add dynamic modules to the plist
 .if !empty(PORT_OPTIONS:MDSO)
 	(cd ${STAGEDIR}${PREFIX} && ${FIND} ${MODULESDIR:S|${PREFIX}/||} \

Modified: head/www/nginx-devel/distinfo
==============================================================================
--- head/www/nginx-devel/distinfo	Thu Nov 17 23:59:44 2016	(r426302)
+++ head/www/nginx-devel/distinfo	Fri Nov 18 01:06:26 2016	(r426303)
@@ -1,4 +1,4 @@
-TIMESTAMP = 1478786895
+TIMESTAMP = 1478788377
 SHA256 (nginx-1.11.5.tar.gz) = 223f8a2345a75f891098cf26ccdf208b293350388f51ce69083674c9432db6f6
 SIZE (nginx-1.11.5.tar.gz) = 956517
 SHA256 (nginx-accesskey-2.0.3.tar.gz) = d9e94321e78a02de16c57f3e048fd31059fd8116ed03d6de7180f435c52502b1
@@ -45,6 +45,8 @@ SHA256 (grahamedgecombe-nginx-ct-f3cad5e
 SIZE (grahamedgecombe-nginx-ct-f3cad5e_GH0.tar.gz) = 5521
 SHA256 (openresty-echo-nginx-module-46334b3_GH0.tar.gz) = 00d42a5f562a0be5570110d9b70c8f2cace93b292421a6f994cf4ec76a8979f0
 SIZE (openresty-echo-nginx-module-46334b3_GH0.tar.gz) = 52766
+SHA256 (happyfish100-fastdfs-nginx-module-5a8110f_GH0.tar.gz) = 58daa08a5ab9b9de5459817fc088230f4092fb818b87a2cb61b217952a5af54d
+SIZE (happyfish100-fastdfs-nginx-module-5a8110f_GH0.tar.gz) = 17980
 SHA256 (openresty-headers-more-nginx-module-84241e4_GH0.tar.gz) = d3442be9058682ed0ad1d294ab27effcb245c0a320fcf418c452dc923f714531
 SIZE (openresty-headers-more-nginx-module-84241e4_GH0.tar.gz) = 27951
 SHA256 (arut-nginx-dav-ext-module-v0.0.3_GH0.tar.gz) = d428a0236c933779cb40ac8c91afb19d5c25a376dc3caab825bfd543e1ee530d

Added: head/www/nginx-devel/files/extra-patch-fastdfs-src-config
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/nginx-devel/files/extra-patch-fastdfs-src-config	Fri Nov 18 01:06:26 2016	(r426303)
@@ -0,0 +1,23 @@
+--- ../fastdfs-nginx-module-5a8110f57ec55ff580260cf1fc6aa152a5a4c574/src/config.orig	2016-10-12 16:09:34.075804000 +0200
++++ ../fastdfs-nginx-module-5a8110f57ec55ff580260cf1fc6aa152a5a4c574/src/config	2016-10-12 16:10:43.916280000 +0200
+@@ -3,16 +3,16 @@
+ if test -n "${ngx_module_link}"; then
+     ngx_module_type=HTTP
+     ngx_module_name=$ngx_addon_name
+-    ngx_module_incs="/usr/include/fastdfs /usr/include/fastcommon/"
++    ngx_module_incs="%%LOCALBASE%%/include/fastdfs %%LOCALBASE%%/include/fastcommon/"
+     ngx_module_libs="-lfastcommon -lfdfsclient"
+     ngx_module_srcs="$ngx_addon_dir/ngx_http_fastdfs_module.c"
+     ngx_module_deps=
+-    CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"/etc/fdfs/mod_fastdfs.conf\"'"
++    CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"%%PREFIX%%/etc/fdfs/mod_fastdfs.conf\"'"
+     . auto/module
+ else
+     HTTP_MODULES="$HTTP_MODULES ngx_http_fastdfs_module"
+     NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_fastdfs_module.c"
+-    CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"
++    CORE_INCS="$CORE_INCS %%LOCALBASE%%/include/fastdfs %%LOCALBASE%%/include/fastcommon/"
+     CORE_LIBS="$CORE_LIBS -lfastcommon -lfdfsclient"
+-    CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"/etc/fdfs/mod_fastdfs.conf\"'"
++    CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"%%PREFIX%%/etc/fdfs/mod_fastdfs.conf\"'"
+ fi

Modified: head/www/nginx/Makefile
==============================================================================
--- head/www/nginx/Makefile	Thu Nov 17 23:59:44 2016	(r426302)
+++ head/www/nginx/Makefile	Fri Nov 18 01:06:26 2016	(r426303)
@@ -67,6 +67,7 @@ OPTIONS_DEFINE=	\
 	CLOJURE \
 	CT \
 	ECHO \
+	FASTDFS \
 	HEADERS_MORE \
 	HTTP_ACCEPT_LANGUAGE \
 	HTTP_ACCESSKEY \
@@ -176,6 +177,7 @@ CACHE_PURGE_DESC=		3rd party cache_purge
 CLOJURE_DESC=			3rd party clojure module
 CT_DESC=			3rd party cert_transparency module (SSL req.)
 ECHO_DESC=			3rd party echo module
+FASTDFS_DESC=			3rd party fastdfs module
 HEADERS_MORE_DESC=		3rd party headers_more module
 HTTP_ACCEPT_LANGUAGE_DESC=	3rd party accept_language module
 HTTP_ACCESSKEY_DESC=		3rd party http_accesskey module
@@ -455,6 +457,21 @@ CONFIGURE_ARGS+=--add-module=${WRKSRC_ec
 .endif
 .endif
 
+.if ${PORT_OPTIONS:MFASTDFS}
+NGINX_FASTDFS_VERSION=     5a8110f
+GH_ACCOUNT+=    happyfish100:fastdfs
+GH_PROJECT+=    fastdfs-nginx-module:fastdfs
+GH_TAGNAME+=    ${NGINX_FASTDFS_VERSION}:fastdfs
+EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-fastdfs-src-config
+BUILD_DEPENDS+=	${LOCALBASE}/include/fastcommon/logger.h:devel/libfastcommon \
+		${LOCALBASE}/include/fastdfs/fdfs_client.h:ftp/fastdfs
+LIB_DEPENDS+=	libfastcommon.so:devel/libfastcommon \
+		libfdfsclient.so:ftp/fastdfs
+CONFIGURE_ARGS+=--add-module=${WRKSRC_fastdfs}/src \
+		--with-cc-opt="-I ${LOCALBASE}/include/fastdfs \
+		-I ${LOCALBASE}/include/fastcommon"
+.endif
+
 .if ${PORT_OPTIONS:MHEADERS_MORE}
 NGINX_HEADERS_MORE_VERSION=	84241e4
 GH_ACCOUNT+=	openresty:headers_more
@@ -1189,6 +1206,12 @@ post-patch:
 		's!%%PREFIX%%!${LOCALBASE}!g' \
 		${WRKSRC_drizzle}/config
 .endif
+.if ${PORT_OPTIONS:MFASTDFS}
+	@${REINPLACE_CMD} \
+		's!%%PREFIX%%!${PREFIX}!g; \
+		s!%%LOCALBASE%%!${LOCALBASE}!g' \
+		${WRKSRC_fastdfs}/src/config
+.endif
 # Respect CFLAGS by remove needless --std=c99 flag
 .if ${PORT_OPTIONS:MGRIDFS}
 	@${REINPLACE_CMD} \
@@ -1291,6 +1314,11 @@ do-install:
 		${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/
 .endif
 
+.if ${PORT_OPTIONS:MFASTDFS}
+	${MKDIR} ${STAGEDIR}${PREFIX}/etc/fdfs
+	${INSTALL_DATA} ${WRKSRC_fastdfs}/src/mod_fastdfs.conf ${STAGEDIR}${PREFIX}/etc/fdfs/mod_fastdfs.conf.sample
+.endif
+
 # Install dynamic modules
 .if !empty(PORT_OPTIONS:MDSO)
 	(cd ${WRKSRC}/objs/ && ${FIND} . -name '*.so' -maxdepth 1 -type f \
@@ -1314,6 +1342,10 @@ post-install:
 	${ECHO_CMD} etc/nginx/naxsi_core.rules >> ${TMPPLIST}
 .endif
 
+.if ${PORT_OPTIONS:MFASTDFS}
+	${ECHO_CMD} @sample etc/fdfs/mod_fastdfs.conf.sample >> ${TMPPLIST}
+.endif
+
 # Add dynamic modules to the plist
 .if !empty(PORT_OPTIONS:MDSO)
 	(cd ${STAGEDIR}${PREFIX} && ${FIND} ${MODULESDIR:S|${PREFIX}/||} \

Modified: head/www/nginx/distinfo
==============================================================================
--- head/www/nginx/distinfo	Thu Nov 17 23:59:44 2016	(r426302)
+++ head/www/nginx/distinfo	Fri Nov 18 01:06:26 2016	(r426303)
@@ -1,4 +1,4 @@
-TIMESTAMP = 1478786895
+TIMESTAMP = 1478788377
 SHA256 (nginx-1.10.2.tar.gz) = 1045ac4987a396e2fa5d0011daf8987b612dd2f05181b67507da68cbe7d765c2
 SIZE (nginx-1.10.2.tar.gz) = 910812
 SHA256 (nginx-accesskey-2.0.3.tar.gz) = d9e94321e78a02de16c57f3e048fd31059fd8116ed03d6de7180f435c52502b1
@@ -45,6 +45,8 @@ SHA256 (grahamedgecombe-nginx-ct-f3cad5e
 SIZE (grahamedgecombe-nginx-ct-f3cad5e_GH0.tar.gz) = 5521
 SHA256 (openresty-echo-nginx-module-46334b3_GH0.tar.gz) = 00d42a5f562a0be5570110d9b70c8f2cace93b292421a6f994cf4ec76a8979f0
 SIZE (openresty-echo-nginx-module-46334b3_GH0.tar.gz) = 52766
+SHA256 (happyfish100-fastdfs-nginx-module-5a8110f_GH0.tar.gz) = 58daa08a5ab9b9de5459817fc088230f4092fb818b87a2cb61b217952a5af54d
+SIZE (happyfish100-fastdfs-nginx-module-5a8110f_GH0.tar.gz) = 17980
 SHA256 (openresty-headers-more-nginx-module-84241e4_GH0.tar.gz) = d3442be9058682ed0ad1d294ab27effcb245c0a320fcf418c452dc923f714531
 SIZE (openresty-headers-more-nginx-module-84241e4_GH0.tar.gz) = 27951
 SHA256 (arut-nginx-dav-ext-module-v0.0.3_GH0.tar.gz) = d428a0236c933779cb40ac8c91afb19d5c25a376dc3caab825bfd543e1ee530d

Added: head/www/nginx/files/extra-patch-fastdfs-src-config
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/nginx/files/extra-patch-fastdfs-src-config	Fri Nov 18 01:06:26 2016	(r426303)
@@ -0,0 +1,23 @@
+--- ../fastdfs-nginx-module-5a8110f/src/config.orig	2016-10-12 16:09:34.075804000 +0200
++++ ../fastdfs-nginx-module-5a8110f/src/config	2016-10-12 16:10:43.916280000 +0200
+@@ -3,16 +3,16 @@
+ if test -n "${ngx_module_link}"; then
+     ngx_module_type=HTTP
+     ngx_module_name=$ngx_addon_name
+-    ngx_module_incs="/usr/include/fastdfs /usr/include/fastcommon/"
++    ngx_module_incs="%%LOCALBASE%%/include/fastdfs %%LOCALBASE%%/include/fastcommon/"
+     ngx_module_libs="-lfastcommon -lfdfsclient"
+     ngx_module_srcs="$ngx_addon_dir/ngx_http_fastdfs_module.c"
+     ngx_module_deps=
+-    CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"/etc/fdfs/mod_fastdfs.conf\"'"
++    CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"%%PREFIX%%/etc/fdfs/mod_fastdfs.conf\"'"
+     . auto/module
+ else
+     HTTP_MODULES="$HTTP_MODULES ngx_http_fastdfs_module"
+     NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_fastdfs_module.c"
+-    CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"
++    CORE_INCS="$CORE_INCS %%LOCALBASE%%/include/fastdfs %%LOCALBASE%%/include/fastcommon/"
+     CORE_LIBS="$CORE_LIBS -lfastcommon -lfdfsclient"
+-    CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"/etc/fdfs/mod_fastdfs.conf\"'"
++    CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"%%PREFIX%%/etc/fdfs/mod_fastdfs.conf\"'"
+ fi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611180106.uAI16RJd007647>