Bug 185594

Summary: net-im/ejabberd: ejabberd does not build due to expat
Product: Ports & Packages Reporter: js
Component: Individual Port(s)Assignee: Ashish SHUKLA <ashish>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description js 2014-01-09 01:50:00 UTC
net-im/ejabberd is not building because configure phase fails:

[...]
checking for XML_ParserCreate in -lexpat... no
configure: error: Could not find development files of Expat library
===>  Script "configure" failed unexpectedly.
Please report the problem to ashish@FreeBSD.org [maintainer] and attach the
"/usr/ports/net-im/ejabberd/work/ejabberd-2.1.13/src/config.log" including
the output of the failure of your make command. Also, it might be a good idea
to provide an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).

Even though /usr/local/lib/libexpat.so is available, judging from config.log the test cannot link to libexpat for some reason:

configure:3876: checking for XML_ParserCreate in -lexpat
configure:3901: cc -o conftest -O2 -pipe -fno-strict-aliasing -Wall   -Wl,-rpath=/usr/lib:/usr/local/lib conftest.c -lexpat   >&5
/usr/bin/ld: cannot find -lexpat
cc: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3901: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "ejabberd"
| #define PACKAGE_TARNAME "ejabberd"
| #define PACKAGE_VERSION "2.1.12"
| #define PACKAGE_STRING "ejabberd 2.1.12"
| #define PACKAGE_BUGREPORT "ejabberd@process-one.net"
| #define PACKAGE_URL ""
| #define HAVE_ICONV 1
| #define ICONV_CONST const
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char XML_ParserCreate ();
| int
| main ()
| {
| return XML_ParserCreate ();
|   ;
|   return 0;
| }
configure:3910: result: no 
configure:3920: error: Could not find development files of Expat library

How-To-Repeat: portinstall ejabberd
Comment 1 Glen Barber freebsd_committer freebsd_triage 2014-01-09 02:16:38 UTC
Responsible Changed
From-To: freebsd-bugs->ashish

Fix synopsis and assign.
Comment 2 Ashish SHUKLA freebsd_committer freebsd_triage 2014-01-09 02:39:28 UTC
Hi Julian,

Could you please try the following diff ?

http://people.freebsd.org/~ashish/diffs/ejabberd-expat-2.1.13.diff
sha256: 6affe4a1784537d03e3df8d27aefff9613c4b5c58b96fc201be26487fb70b9ca

I'll plan to club this with the ejabberd update I'm working on. 

Let me know if you experience any issues with this diff.

Thanks
-- 
Ashish SHUKLA      | GPG: F682 CDCC 39DC 0FEA E116  20B6 C746 CFA9 E74F A4B0
Sent from my Emacs
Comment 3 js 2014-01-09 15:24:04 UTC
ashish@FreeBSD.org wrote:
>Hi Julian,
>
>Could you please try the following diff ?

With your patch it builds. Thanks!

Julian
-- 
Sent from Kaiten Mail. Please excuse my brevity.
Comment 4 dfilter service freebsd_committer freebsd_triage 2014-02-05 08:24:53 UTC
Author: ashish
Date: Wed Feb  5 08:24:45 2014
New Revision: 342652
URL: http://svnweb.freebsd.org/changeset/ports/342652
QAT: https://qat.redports.org/buildarchive/r342652/

Log:
  - Fix brokenness on 10-RELEASE due to expat library
  - Remove ABI version from LIB_DEPENDS
  - Add STAGE support
  - Add option for documentation
  - Use OptionsNG helpers
  
  PR:		ports/186274 ports/185594

Modified:
  head/net-im/ejabberd/Makefile
  head/net-im/ejabberd/files/patch-src-Makefile.in
  head/net-im/ejabberd/files/pkg-install.in
  head/net-im/ejabberd/pkg-plist

Modified: head/net-im/ejabberd/Makefile
==============================================================================
--- head/net-im/ejabberd/Makefile	Wed Feb  5 08:22:02 2014	(r342651)
+++ head/net-im/ejabberd/Makefile	Wed Feb  5 08:24:45 2014	(r342652)
@@ -15,7 +15,7 @@ LICENSE_FILE=	${WRKDIR}/${PORTNAME}-${PO
 
 BUILD_DEPENDS=	erlc:${PORTSDIR}/lang/erlang
 RUN_DEPENDS=	erl:${PORTSDIR}/lang/erlang
-LIB_DEPENDS=	expat.6:${PORTSDIR}/textproc/expat2
+LIB_DEPENDS=	expat:${PORTSDIR}/textproc/expat2
 
 USERS=		ejabberd
 GROUPS=		${USERS}
@@ -25,57 +25,41 @@ USES=		iconv gmake pkgconfig
 USE_RC_SUBR=	${PORTNAME}
 NOPRECIOUSMAKEVARS=	yes
 
-OPTIONS_DEFINE=	ODBC PAM
+OPTIONS_DEFINE=	ODBC PAM DOCS
 
 MAKE_ENV=	PORTVERSION=${PORTVERSION}
-CONFIGURE_ARGS+=--localstatedir=/var --with-openssl=${OPENSSLBASE}
+CONFIGURE_ARGS+=--localstatedir=/var --with-openssl=${OPENSSLBASE} --with-expat=${LOCALBASE}
 PKGMESSAGE=	${WRKDIR}/pkg-message
 PKGINSTALL=	${WRKDIR}/pkg-install
 PLIST_SUB=	PORTNAME=${PORTNAME} PORTVERSION=${PORTVERSION}
 SUB_FILES=	pkg-message pkg-install
 SUB_LIST=	PORTNAME=${PORTNAME} PORTVERSION=${PORTVERSION} \
-		USERS=${USERS} GROUPS=${GROUPS}
+		USERS=${USERS} GROUPS=${GROUPS} SHAREMODE=${SHAREMODE} \
+		SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP}
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}/src
 
-NO_STAGE=	yes
-.include <bsd.port.pre.mk>
+OPTIONS_SUB=		PAM ODBC
+PAM_CONFIGURE_ENABLE=	pam
+ODBC_CONFIGURE_ENABLE=	odbc
+DOCS_MAKE_ARGS_OFF=	NOPORTDOCS=yes
 
 USE_OPENSSL=	yes
 
-.include "${PORTSDIR}/Mk/bsd.openssl.mk"
-
-.if ${PORT_OPTIONS:MODBC}
-CONFIGURE_ARGS+=--enable-odbc
-PLIST_SUB+=	ODBC=""
-.else
-PLIST_SUB+=	ODBC="@comment "
-.endif
+.include <bsd.port.pre.mk>
 
 .if ${PORT_OPTIONS:MPAM}
-CONFIGURE_ARGS+=--enable-pam
-PLIST_SUB+=	PAM=""
+SUB_LIST+=		PAM="1"
 .else
-PLIST_SUB+=	PAM="@comment "
-.endif
-
-.if ! ${PORT_OPTIONS:MDOCS}
-MAKE_ARGS+=	NOPORTDOCS=${NOPORTDOCS}
+SUB_LIST+=		PAM="0"
 .endif
 
 post-patch:
 	@${REINPLACE_CMD} -e 's,/usr/local,${LOCALBASE},g' ${WRKSRC}/configure
 
 post-install:
-	@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-	@${FIND} ${PREFIX}/lib/erlang/lib/${DISTNAME} -type f -print0 | ${XARGS} -0 ${CHMOD} ${SHAREMODE}
-	@${FIND} ${PREFIX}/lib/erlang/lib/${DISTNAME} -type f -print0 | ${XARGS} -0 ${CHOWN} ${SHAREOWN}:${SHAREGRP}
-
 .if ${PORT_OPTIONS:MPAM}
-	${CHMOD} 4750 ${PREFIX}/lib/erlang/lib/${DISTNAME}/priv/bin/epam
-	${CHOWN} root:ejabberd ${PREFIX}/lib/erlang/lib/${DISTNAME}/priv/bin/epam
-	${INSTALL} -m 444 ${FILESDIR}/pam_ejabberd ${PREFIX}/etc/pam.d/ejabberd
+	${INSTALL} -m 444 ${FILESDIR}/pam_ejabberd ${STAGEDIR}${PREFIX}/etc/pam.d/ejabberd
 .endif
-
 	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>

Modified: head/net-im/ejabberd/files/patch-src-Makefile.in
==============================================================================
--- head/net-im/ejabberd/files/patch-src-Makefile.in	Wed Feb  5 08:22:02 2014	(r342651)
+++ head/net-im/ejabberd/files/patch-src-Makefile.in	Wed Feb  5 08:24:45 2014	(r342652)
@@ -1,15 +1,18 @@
+
+$FreeBSD$
+
 --- Makefile.in.orig
 +++ Makefile.in
-@@ -89,7 +89,7 @@
+@@ -95,7 +95,7 @@
  SBINDIR = $(DESTDIR)@sbindir@
  
  # /lib/ejabberd/
 -EJABBERDDIR = $(DESTDIR)@libdir@/ejabberd
-+EJABBERDDIR = @libdir@/erlang/lib/ejabberd-$(PORTVERSION)
++EJABBERDDIR = $(DESTDIR)@libdir@/erlang/lib/ejabberd-$(PORTVERSION)
  
  # /share/doc/ejabberd
  PACKAGE_TARNAME = @PACKAGE_TARNAME@
-@@ -115,7 +115,7 @@
+@@ -121,7 +121,7 @@
  MSGSDIR = $(PRIVDIR)/msgs
  
  # /var/lib/ejabberd/
@@ -18,7 +21,7 @@
  
  # /var/lock/ejabberdctl
  CTLLOCKDIR = $(DESTDIR)@localstatedir@/lock/ejabberdctl
-@@ -178,25 +178,22 @@
+@@ -184,25 +184,22 @@
  	#
  	# Configuration files
  	install -d -m 750 $(G_USER) $(ETCDIR)
@@ -51,7 +54,7 @@
  	#
  	# Init script
  	sed -e "s*@ctlscriptpath@*$(SBINDIR)*" \
-@@ -253,6 +250,7 @@
+@@ -260,6 +257,7 @@
  	chmod -R 750 $(LOGDIR)
  	#
  	# Documentation
@@ -59,7 +62,7 @@
  	install -d $(DOCDIR)
  	install -m 644 ../doc/dev.html $(DOCDIR)
  	install -m 644 ../doc/guide.html $(DOCDIR)
-@@ -262,6 +260,7 @@
+@@ -269,6 +267,7 @@
  		&& install -m 644 ../doc/guide.pdf $(DOCDIR) \
  		|| echo "No ../doc/guide.pdf was built"
  	install -m 644 ../COPYING $(DOCDIR)

Modified: head/net-im/ejabberd/files/pkg-install.in
==============================================================================
--- head/net-im/ejabberd/files/pkg-install.in	Wed Feb  5 08:22:02 2014	(r342651)
+++ head/net-im/ejabberd/files/pkg-install.in	Wed Feb  5 08:24:45 2014	(r342652)
@@ -10,5 +10,13 @@ install -d -m 750 -o %%USERS%% -g %%GROU
 
 chown -R %%USERS%%:%%GROUPS%%  %%PREFIX%%/etc/%%PORTNAME%%
 chown -R %%USERS%%:%%GROUPS%%  %%PREFIX%%/lib/erlang/lib/%%PORTNAME%%-%%PORTVERSION%%
+	
+find %%PREFIX%%/lib/erlang/lib/%%PORTNAME%%-%%PORTVERSION%% -type f -print0 | xargs -0 chmod %%SHAREMODE%%
+find %%PREFIX%%/lib/erlang/lib/%%PORTNAME%%-%%PORTVERSION%% -type f -print0 | xargs -0 chown %%SHAREOWN%%:%%SHAREGRP%%
+
+if [ "%%PAM%%" = 1 ]; then
+	chmod 4750 %%PREFIX%%/lib/erlang/lib/%%PORTNAME%%-%%PORTVERSION%%/priv/bin/epam
+	chown root:%%GROUPS%% %%PREFIX%%/lib/erlang/lib/%%PORTNAME%%-%%PORTVERSION%%/priv/bin/epam
+fi
 
 exit 0

Modified: head/net-im/ejabberd/pkg-plist
==============================================================================
--- head/net-im/ejabberd/pkg-plist	Wed Feb  5 08:22:02 2014	(r342651)
+++ head/net-im/ejabberd/pkg-plist	Wed Feb  5 08:24:45 2014	(r342652)
@@ -2,8 +2,8 @@
 %%ETCDIR%%/%%PORTNAME%%ctl.cfg.example
 %%ETCDIR%%/inetrc.example
 @unexec if cmp -s %D/%%ETCDIR%%/%%PORTNAME%%.defaults.example %D/%%ETCDIR%%/%%PORTNAME%%.defaults; then rm -f %D/%%ETCDIR%%/%%PORTNAME%%.defaults; fi
-@unexec if cmp -s %D/%%ETCDIR%%/%%PORTNAME%%.inetrc.example %D/%%ETCDIR%%/%%PORTNAME%%.inetrc; then rm -f %D/%%ETCDIR%%/%%PORTNAME%%.inetrc; fi
-@exec [ ! -f %D/%%ETCDIR%%/%%PORTNAME%%.inetrc ] && cp %D/%%ETCDIR%%/%%PORTNAME%%.inetrc.example %D/%%ETCDIR%%/%%PORTNAME%%.inetrc
+@unexec if cmp -s %D/%%ETCDIR%%/inetrc.example %D/%%ETCDIR%%/inetrc; then rm -f %D/%%ETCDIR%%/inetrc; fi
+@exec [ ! -f %D/%%ETCDIR%%/inetrc ] && cp %D/%%ETCDIR%%/inetrc.example %D/%%ETCDIR%%/inetrc
 %%PAM%%etc/pam.d/%%PORTNAME%%
 lib/erlang/lib/%%PORTNAME%%-%%PORTVERSION%%/ebin/ELDAPv3.beam
 lib/erlang/lib/%%PORTNAME%%-%%PORTVERSION%%/ebin/XmppAddr.beam
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Ashish SHUKLA freebsd_committer freebsd_triage 2014-02-05 08:27:36 UTC
State Changed
From-To: open->closed

Committed. Thanks!