pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

freeswitch-core: Some improvements. - Improve conditionals for compiler selection; - Include options framework to seprate and improve modules building features (deleting previously patch-modules.conf); - WIP on CONF_FILES usage. - PLIST variables depending on modules selected.



Module Name:	pkgsrc-wip
Committed By:	Angel M. Adames <angelmadames%gmail.com@localhost>
Pushed By:	angelmadames
Date:		Tue Jan 9 15:49:25 2018 +0000
Changeset:	fb185ef8b88722be05321d25fa839d461542f540

Modified Files:
	freeswitch-core/Makefile
	freeswitch-core/PLIST
	freeswitch-core/TODO
Added Files:
	freeswitch-core/options.mk
Removed Files:
	freeswitch-core/patches/patch-modules.conf

Log Message:
freeswitch-core: Some improvements.
	- Improve conditionals for compiler selection;
	- Include options framework to seprate and improve modules building features (deleting previously patch-modules.conf);
	- WIP on CONF_FILES usage.
	- PLIST variables depending on modules selected.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=fb185ef8b88722be05321d25fa839d461542f540

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 freeswitch-core/Makefile                   | 46 +++++++++-------
 freeswitch-core/PLIST                      | 10 ++--
 freeswitch-core/TODO                       |  4 ++
 freeswitch-core/options.mk                 | 85 ++++++++++++++++++++++++++++++
 freeswitch-core/patches/patch-modules.conf | 34 ------------
 5 files changed, 122 insertions(+), 57 deletions(-)

diffs:
diff --git a/freeswitch-core/Makefile b/freeswitch-core/Makefile
index c3738303f7..d907bf34fb 100644
--- a/freeswitch-core/Makefile
+++ b/freeswitch-core/Makefile
@@ -17,6 +17,8 @@ USE_TOOLS+=		aclocal automake autoconf gmake perl pkg-config bash
 
 BUILD_DEFS+=		VARBASE
 
+.include "../../wip/freeswitch-core/options.mk"
+
 CONFIGURE_ARGS+=	--prefix=${PREFIX}
 CONFIGURE_ARGS+=	--exec-prefix=${PREFIX}/bin
 CONFIGURE_ARGS+=	--bindir=${PREFIX}/bin
@@ -39,7 +41,6 @@ CONFIGURE_ARGS+=	--with-dbdir=${VARBASE}/db/freeswitch
 CONFIGURE_ARGS+=	--with-imagesdir=${PREFIX}/share/freeswitch/images
 CONFIGURE_ARGS+=	--with-recordingsdir=${PREFIX}/freeswitch/recordings
 CONFIGURE_ARGS+=	--with-modinstdir=${PREFIX}/freeswitch/modules
-CONFIGURE_ARGS+=	--enable-core-pgsql-support
 CONFIGURE_ARGS+=	--disable-libvpx
 CONFIGURE_ARGS+=	--enable-64
 
@@ -141,12 +142,10 @@ DEPENDS+=        	libyaml-[0-9]*:../../textproc/libyaml
 
 .include "../../mk/bsd.prefs.mk"
 
-.if (${PKGSRC_COMPILER} && ${CC} == "clang" && ${CXX} == "clang++")
+.if !empty(PKGSRC_COMPILER:Mclang)
 USE_LIBTOOL=		yes
 LIBTOOL_OVERRIDE=	libtool */libtool */*/libtool */*/*/libtool
 
-CONFIGURE_ARGS+=	--enable-zrtp
-
 BUILDLINK_TRANSFORM+=	rm:-Werror
 CFLAGS+=        	-Wno-c11-extensions -Wno-deprecated-declarations \
 			-Wno-zero-length-array -Wno-incompatible-pointer-types
@@ -179,28 +178,42 @@ PKG_SYSCONFDIR_PERMS=	${FS_USER} ${FS_GROUP} 0755
 # WIP: Use of CONF_FILES according to pkgsrc best practices #
 #############################################################
 
-#EGDIR=			${PREFIX}/share/examples/freeswitch
-#CONF_FILES+=            ${EGDIR}/extensions.conf ${PKG_SYSCONFDIR}/extensions.conf
-#CONF_FILES+=            ${EGDIR}/freetdm.conf ${PKG_SYSCONFDIR}/freetdm.conf
-#.for a in alsa blacklist callcenter cdr_mongodb cdr_pg_csv cdr_sqlite \
-#	cepstral cidlookup conference.conf console db dialplan_directory \
+#EGDIR=		${PREFIX}/share/examples/freeswitch
+
+#CONF_FILES+=	${EGDIR}/extensions.conf ${PKG_SYSCONFDIR}/extensions.conf
+#CONF_FILES+=	${EGDIR}/freetdm.conf ${PKG_SYSCONFDIR}/freetdm.conf
+#CONF_FILES+=	${EGDIR}/magic ${PKG_SYSCONFDIR}/magic
+#CONF_FILES+=	${EGDIR}/freeswitch.xml ${PKG_SYSCONFDIR}/freeswitch.xml
+#CONF_FILES+=	${EGDIR}/vars.xml ${PKG_SYSCONFDIR}/vars.xml
+
+#CONF_FILES+=	${EGDIR}/chatplan/default.xml ${PKG_SYSCONFDIR}/chatplan/default.xml
+#CONF_FILES+=	${EGDIR}/dialplan/empty.xml ${PKG_SYSCONFDIR}/dialplan/empty.xml
+#CONF_FILES+=	${EGDIR}/directory/empty.xml ${PKG_SYSCONFDIR}/directory/empty.xml
+
+#.for a in alsa blacklist cdr_mongodb cdr_pg_csv cdr_sqlite \
+#	cepstral conference.conf console db dialplan_directory \
 #	dingaling directory distributor easyroute enum erlang_event \
 #	event_multicast event_socket fax fifo freetdm hash httapi http_cache \
-#	ivr java json_cdr lcr local_stream logfile lua memcache modules mongo \
+#	ivr java json_cdr lcr local_stream logfile lua modules mongo \
 #	nibblebill opal osp perl pocketsphinx portaudio post_load_modules \
 #	presence_map python redis rss rtmp sangoma_codec shout skinny sofia \
 #	spandsp spidermonkey switch syslog timezones translate tts_commandline \
 #	unicall unimrcp verto voicemail voicemail_ivr xml_cdr xml_curl \
 #	xml_rpc zeroconf
-#CONF_FILES+=            ${EGDIR}/autoload_configs/${a}.conf.xml \
-#			${PKG_SYSCONFDIR}/autoload_configs/${a}.conf.xml
+#CONF_FILES+=	${EGDIR}/autoload_configs/${a}.conf.xml \
+	${PKG_SYSCONFDIR}/autoload_configs/${a}.conf.xml
+#.endfor
+
+#.for b in default 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 \
+	1011 1012 1013 1014 1015 1016 1017 1018 1019 example.com brian \
+	skinny-example
+#CONF_FILES+=	${EGDIR}/directory/default/${b}.xml \
+	${PKG_SYSCONFDIR}/directory/default/${b}.xml
 #.endfor
-#CONF_FILES+=            ${EGDIR}/magic ${PKG_SYSCONFDIR}/magic
-#CONF_FILES+=            ${EGDIR}/mime.types ${PKG_SYSCONFDIR}/mime.types
 
 #############################################################
 
-.if (${PKGSRC_COMPILER} == "gcc")
+.if !empty(PKGSRC_COMPILER:Mgcc)
 pre-configure:
 	cd ${WRKSRC} && ${SH} rebootstrap.sh -j
 .endif
@@ -212,7 +225,6 @@ post-install:
 	${LIBTOOL} --mode=install ${INSTALL_LIB} ${WRKSRC}/libs/tiff-4.0.2/libtiff/libtiffxx.la ${DESTDIR}${PREFIX}/lib
 	${LIBTOOL} --finish ${PREFIX}/lib
 
-.include "../../mk/pgsql.buildlink3.mk"
 .include "../../mk/jpeg.buildlink3.mk"
 .include "../../devel/pcre/buildlink3.mk"
 .include "../../devel/libmemcached/buildlink3.mk"
@@ -221,7 +233,6 @@ post-install:
 .include "../../graphics/freetype2/buildlink3.mk"
 .include "../../audio/libsndfile/buildlink3.mk"
 .include "../../net/ldns/buildlink3.mk"
-.include "../../www/curl/buildlink3.mk"
 .include "../../audio/speexdsp/buildlink3.mk"
 .include "../../audio/mpg123/buildlink3.mk"
 .include "../../audio/libopus/buildlink3.mk"
@@ -230,7 +241,6 @@ post-install:
 .include "../../databases/sqlite3/buildlink3.mk"
 .include "../../devel/libltdl/buildlink3.mk"
 .include "../../devel/libuuid/buildlink3.mk"
-#.include "../../wip/libzrtp/buildlink3.mk"
 .include "../../mk/pthread.buildlink3.mk"
 .include "../../mk/dlopen.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/freeswitch-core/PLIST b/freeswitch-core/PLIST
index dd22e8f60e..2038fda4e6 100644
--- a/freeswitch-core/PLIST
+++ b/freeswitch-core/PLIST
@@ -216,16 +216,16 @@ etc/freeswitch/vars.xml
 etc/freeswitch/voicemail.tpl
 etc/freeswitch/web-vm.tpl
 freeswitch/modules/mod_amr.la
-freeswitch/modules/mod_avmd.la
+${PLIST.avmd}freeswitch/modules/mod_avmd.la
 freeswitch/modules/mod_b64.la
-freeswitch/modules/mod_callcenter.la
+${PLIST.callcenter}freeswitch/modules/mod_callcenter.la
 freeswitch/modules/mod_cdr_csv.la
 freeswitch/modules/mod_cdr_sqlite.la
-freeswitch/modules/mod_cidlookup.la
+${PLIST.cidlookup}freeswitch/modules/mod_cidlookup.la
 freeswitch/modules/mod_commands.la
 freeswitch/modules/mod_conference.la
 freeswitch/modules/mod_console.la
-freeswitch/modules/mod_curl.la
+${PLIST.curl}freeswitch/modules/mod_curl.la
 freeswitch/modules/mod_db.la
 freeswitch/modules/mod_dialplan_asterisk.la
 freeswitch/modules/mod_dialplan_xml.la
@@ -245,7 +245,7 @@ freeswitch/modules/mod_local_stream.la
 freeswitch/modules/mod_logfile.la
 freeswitch/modules/mod_loopback.la
 freeswitch/modules/mod_lua.la
-freeswitch/modules/mod_memcache.la
+${PLIST.memcache}freeswitch/modules/mod_memcache.la
 freeswitch/modules/mod_native_file.la
 freeswitch/modules/mod_opus.la
 freeswitch/modules/mod_png.la
diff --git a/freeswitch-core/TODO b/freeswitch-core/TODO
index 642720fc27..d57bd4d232 100644
--- a/freeswitch-core/TODO
+++ b/freeswitch-core/TODO
@@ -17,3 +17,7 @@
   the core package should be the default from upstream.  Ideally, it
   would be possible to build modules separately so they can be in
   their own package.
+	UPDATE: Modules were included in the options.mk framework.
+	This will replace previous patch-modules.conf used (which was not ideal).
+	Since modules are bundled it is not possible to build them separately.
+	Not all modules were included. Work in progress.
diff --git a/freeswitch-core/options.mk b/freeswitch-core/options.mk
new file mode 100644
index 0000000000..fdf7ea88c1
--- /dev/null
+++ b/freeswitch-core/options.mk
@@ -0,0 +1,85 @@
+# $NetBSD$
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.freeswitch
+PKG_SUPPORTED_OPTIONS=	zrtp xmlrpc pgsql avmd callcenter cidlookup \
+			curl memcache
+PKG_SUGGESTED_OPTIONS=	pgsql cidlookup memcache curl
+
+PLIST_VARS+=		callcenter cidlookup avmd curl memcache
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mzrtp)
+CONFIGURE_ARGS+=	--enable-zrtp
+.endif
+
+.if !empty(PKG_OPTIONS:Mpgsql)
+CONFIGURE_ARGS+=	--enable-core-pgsql-support
+.include "../../mk/pgsql.buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mxmlrpc)
+CONFIGURE_ARGS+=	--enable-xmlrpc-c
+.endif
+
+.if !empty(PKG_OPTIONS:Mcallcenter)
+SUBST_CLASSES+=			callcenter
+SUBST_STAGE.callcenter=		post-extract
+SUBST_MESSAGE.callcenter=	Enabling module Call Center.
+SUBST_FILES.callcenter=		modules.conf
+SUBST_SED.callcenter=		-e 's:\#applications/mod_callcenter:applications/mod_callcenter:g'
+
+PLIST.callcenter=		yes
+
+#CONF_FILES+=            ${EGDIR}/autoload_configs/callcenter.conf.xml \
+#			${PKG_SYSCONFDIR}/autoload_configs/callcenter.conf.xml
+.endif
+
+.if !empty(PKG_OPTIONS:Mcidlookup)
+SUBST_CLASSES+=			cidlookup
+SUBST_STAGE.cidlookup=		post-extract
+SUBST_MESSAGE.cidlookup=	Enabling module CID Lookup.
+SUBST_FILES.cidlookup=		modules.conf
+SUBST_SED.cidlookup=		-e 's:\#applications/mod_cidlookup:applications/mod_cidlookup:g'
+
+PLIST.cidlookup=		yes
+
+#CONF_FILES+=            ${EGDIR}/autoload_configs/cidlookup.conf.xml \
+#			${PKG_SYSCONFDIR}/autoload_configs/cidlookup.conf.xml
+.endif
+
+.if !empty(PKG_OPTIONS:Mavmd)
+SUBST_CLASSES+=		avmd
+SUBST_STAGE.avmd=	post-extract
+SUBST_MESSAGE.avmd=	Enabling module AVMD (Advanced voicemail beep detection).
+SUBST_FILES.avmd=	modules.conf
+SUBST_SED.avmd=		-e 's:\#applications/mod_avmd:applications/mod_avmd:g'
+PLIST.avmd=		yes
+.endif
+
+.if !empty(PKG_OPTIONS:Mcurl)
+SUBST_CLASSES+=		curl
+SUBST_STAGE.curl=	post-extract
+SUBST_MESSAGE.curl=	Enabling module CURL.
+SUBST_FILES.curl=	modules.conf
+SUBST_SED.curl=		-e 's:\#applications/mod_curl:applications/mod_curl:g'
+
+PLIST.curl=		yes
+
+.include "../../www/curl/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mmemcache)
+SUBST_CLASSES+=		memcache
+SUBST_STAGE.memcache=	post-extract
+SUBST_MESSAGE.memcache=	Enabling module memcached API.
+SUBST_FILES.memcache=	modules.conf
+SUBST_SED.memcache=	-e 's:\#applications/mod_memcache:applications/mod_memcache:g'
+
+PLIST.memcache=		yes
+
+#CONF_FILES+=            ${EGDIR}/autoload_configs/memcache.conf.xml \
+#			${PKG_SYSCONFDIR}/autoload_configs/memcache.conf.xml
+.endif
+
+# TODO: Include all remaining modules in options.mk to provide a more customizable package.
diff --git a/freeswitch-core/patches/patch-modules.conf b/freeswitch-core/patches/patch-modules.conf
deleted file mode 100644
index 3a17a0f041..0000000000
--- a/freeswitch-core/patches/patch-modules.conf
+++ /dev/null
@@ -1,34 +0,0 @@
-$NetBSD$
-
-Fix portability issues.
-
---- modules.conf.orig	2017-05-05 17:08:45.600465000 +0000
-+++ modules.conf
-@@ -1,14 +1,14 @@
- #applications/mod_abstraction
- #applications/mod_av
--#applications/mod_avmd
-+applications/mod_avmd
- #applications/mod_bert
- #applications/mod_blacklist
--#applications/mod_callcenter
--#applications/mod_cidlookup
-+applications/mod_callcenter
-+applications/mod_cidlookup
- #applications/mod_cluechoo
- applications/mod_commands
- applications/mod_conference
--#applications/mod_curl
-+applications/mod_curl
- #applications/mod_cv
- applications/mod_db
- #applications/mod_directory
-@@ -28,7 +28,7 @@ applications/mod_httapi
- #applications/mod_http_cache
- #applications/mod_ladspa
- #applications/mod_lcr
--#applications/mod_memcache
-+applications/mod_memcache
- #applications/mod_mongo
- #applications/mod_mp4
- #applications/mod_mp4v2


Home | Main Index | Thread Index | Old Index