Update to new version, correct new flaky menuconfig implementation, modernize

Tue, 28 Aug 2012 18:31:35 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:31:35 +0200
changeset 547
1c75a8bb0fec
parent 546
7894123eadbf
child 548
efb4f295e1cf

Update to new version, correct new flaky menuconfig implementation, modernize
packaging, and only conditionally implement strsep(3) on SVR4 missing it.

opensips/opensips.patch file | annotate | diff | comparison | revisions
opensips/opensips.patch.ctlrc file | annotate | diff | comparison | revisions
opensips/opensips.patch.reg file | annotate | diff | comparison | revisions
opensips/opensips.patch.rtpproxy file | annotate | diff | comparison | revisions
opensips/opensips.spec file | annotate | diff | comparison | revisions
     1.1 --- a/opensips/opensips.patch	Tue Aug 28 18:31:20 2012 +0200
     1.2 +++ b/opensips/opensips.patch	Tue Aug 28 18:31:35 2012 +0200
     1.3 @@ -2,7 +2,7 @@
     1.4  diff -Nau main.c.orig main.c
     1.5  --- main.c.orig	2012-03-21.orig 10:29:31.458420799 +0100
     1.6  +++ main.c	2012-03-21 10:30:52.034994020 +0100
     1.7 -@@ -1025,6 +1025,10 @@
     1.8 +@@ -1029,6 +1029,10 @@
     1.9   	ret=-1;
    1.10   	my_argc=argc; my_argv=argv;
    1.11   
    1.12 @@ -10,10 +10,10 @@
    1.13  +	/* ...so unconditionally log to syslog for now */
    1.14  +	openlog(argv[0], LOG_PID|LOG_CONS, log_facility);
    1.15  +
    1.16 - 	/*init pkg mallocs (before parsing cfg or cmd line !)*/
    1.17 - 	if (init_pkg_mallocs()==-1)
    1.18 - 		goto error00;
    1.19 -@@ -1357,6 +1361,11 @@
    1.20 + 	/* process pkg mem size from command line */
    1.21 + 	opterr=0;
    1.22 + 	options="f:cCm:M:b:l:n:N:rRvdDETSVhw:t:u:g:P:G:W:o:";
    1.23 +@@ -1387,6 +1391,11 @@
    1.24   
    1.25   	/* init_daemon? */
    1.26   	if (!dont_fork){
    1.27 @@ -38,7 +38,7 @@
    1.28   	LOCALBASE ?= $(SYSBASE)/local
    1.29   endif
    1.30   endif
    1.31 -@@ -1432,6 +1432,10 @@
    1.32 +@@ -1411,6 +1411,10 @@
    1.33   LIBS+= -lsctp
    1.34   endif
    1.35   
    1.36 @@ -74,7 +74,7 @@
    1.37   use IO::Socket;
    1.38   use Socket;
    1.39   #use Net::IP;
    1.40 -@@ -378,6 +377,12 @@
    1.41 +@@ -376,6 +375,12 @@
    1.42   			}		
    1.43   		}
    1.44   
    1.45 @@ -225,3 +225,32 @@
    1.46   		d = d->next;
    1.47   	}
    1.48   	return 0;
    1.49 +Index: menuconfig/Makefile
    1.50 +diff -Nau menuconfig/Makefile.orig menuconfig/Makefile
    1.51 +--- menuconfig/Makefile.orig	2012-03-26 12:11:03.000000000 +0200
    1.52 ++++ menuconfig/Makefile	2012-08-21 21:44:18.781092313 +0200
    1.53 +@@ -5,10 +5,10 @@
    1.54 + CFLAGS=-g -Wall -DMENUCONFIG_CFG_PATH=\"$(MENUCONFIG_CFG_PATH)\" \
    1.55 + 			-DMENUCONFIG_GEN_PATH=\"$(MENUCONFIG_GEN_PATH)\" \
    1.56 + 			-DMENUCONFIG_HAVE_SOURCES=$(MENUCONFIG_HAVE_SOURCES)
    1.57 +-MY_LDFLAGS=-lcurses
    1.58 ++MY_LDFLAGS=-lncurses
    1.59 + EXEC_NAME=configure
    1.60 + all: $(MENUCONFIG_FILES)
    1.61 +-	$(CC) -o $(EXEC_NAME) $(CFLAGS) $^ $(MY_LDFLAGS)
    1.62 ++	$(CC) -o $(EXEC_NAME) $(CFLAGS) $(CPPFLAGS) $^ $(LDFLAGS) $(LIBS)
    1.63 + 
    1.64 + proper:
    1.65 + 	rm -f $(EXEC_NAME)
    1.66 +Index: menuconfig/Makefile
    1.67 +diff -Nau menuconfig/Makefile.orig menuconfig/Makefile
    1.68 +--- menuconfig/curses.c.orig	2012-03-23 11:47:37.000000000 +0100
    1.69 ++++ menuconfig/curses.c	2012-08-21 21:49:29.506561887 +0200
    1.70 +@@ -28,6 +28,7 @@
    1.71 + #include<string.h>
    1.72 + 
    1.73 + #include<sys/ioctl.h> 
    1.74 ++#include<sys/termio.h>
    1.75 + #include<errno.h>
    1.76 + 
    1.77 + #include "curses.h"
     2.1 --- a/opensips/opensips.patch.ctlrc	Tue Aug 28 18:31:20 2012 +0200
     2.2 +++ b/opensips/opensips.patch.ctlrc	Tue Aug 28 18:31:35 2012 +0200
     2.3 @@ -3,7 +3,7 @@
     2.4  --- scripts/opensipsctlrc.orig	2011-08-24 10:12:07.000000000 +0200
     2.5  +++ scripts/opensipsctlrc	2012-03-22 19:04:38.092856433 +0100
     2.6  @@ -1,22 +1,16 @@
     2.7 --# $Id: opensipsctlrc 8290 2011-08-23 14:14:10Z razvancrainea $
     2.8 +-# $Id: opensipsctlrc 9049 2012-05-24 14:03:31Z osas $
     2.9  -#
    2.10  -# The OpenSIPS configuration file for the control tools.
    2.11  -#
     3.1 --- a/opensips/opensips.patch.reg	Tue Aug 28 18:31:20 2012 +0200
     3.2 +++ b/opensips/opensips.patch.reg	Tue Aug 28 18:31:35 2012 +0200
     3.3 @@ -2,7 +2,7 @@
     3.4  diff -Nau modules/registrar/save.c.orig modules/registrar/save.c
     3.5  --- modules/registrar/save.c.orig	2008-08-03 15:53:57.000000000 +0200
     3.6  +++ modules/registrar/save.c	2009-03-24 21:44:46.182865192 +0100
     3.7 -@@ -76,7 +76,7 @@
     3.8 +@@ -77,7 +77,7 @@
     3.9   struct save_ctx {
    3.10   	unsigned int flags;
    3.11   	str aor;
    3.12 @@ -11,7 +11,7 @@
    3.13   };
    3.14   
    3.15   
    3.16 -@@ -388,7 +388,7 @@
    3.17 +@@ -394,7 +394,7 @@
    3.18   		if (e == 0)
    3.19   			continue;
    3.20   
    3.21 @@ -20,7 +20,7 @@
    3.22   			if (_sctx->flags&REG_SAVE_FORCE_REG_FLAG) {
    3.23   				/* we are overflowing the number of maximum contacts,
    3.24   				   so remove the first (oldest) one to prevent this */
    3.25 -@@ -494,6 +494,7 @@
    3.26 +@@ -501,6 +501,7 @@
    3.27   										contact_t* _c, struct save_ctx *_sctx)
    3.28   {
    3.29   	ucontact_info_t *ci;
    3.30 @@ -28,7 +28,7 @@
    3.31   	ucontact_t* c;
    3.32   	int e;
    3.33   	unsigned int cflags;
    3.34 -@@ -554,7 +555,7 @@
    3.35 +@@ -561,7 +562,7 @@
    3.36   				continue;
    3.37   
    3.38   			/* we need to add a new contact -> too many ?? */
    3.39 @@ -37,7 +37,7 @@
    3.40   				if (_sctx->flags&REG_SAVE_FORCE_REG_FLAG) {
    3.41   					/* we are overflowing the number of maximum contacts,
    3.42   					   so remove the first (oldest) one to prevent this */
    3.43 -@@ -581,6 +582,23 @@
    3.44 +@@ -588,6 +589,23 @@
    3.45   				goto error;
    3.46   			}
    3.47   
     4.1 --- a/opensips/opensips.patch.rtpproxy	Tue Aug 28 18:31:20 2012 +0200
     4.2 +++ b/opensips/opensips.patch.rtpproxy	Tue Aug 28 18:31:35 2012 +0200
     4.3 @@ -22,7 +22,7 @@
     4.4   static void handle_query(struct cfg *, int, struct sockaddr_storage *,
     4.5     socklen_t, char *, struct rtpp_session *, int);
     4.6   
     4.7 -+#if defined(__sun__)
     4.8 ++#if defined(__sun) && defined(__SVR4) && !defined(GE_SOL11)
     4.9  +static char
    4.10  +*strsep(char **stringp, const char *delim)
    4.11  +{
     5.1 --- a/opensips/opensips.spec	Tue Aug 28 18:31:20 2012 +0200
     5.2 +++ b/opensips/opensips.spec	Tue Aug 28 18:31:35 2012 +0200
     5.3 @@ -34,8 +34,8 @@
     5.4  Class:        PLUS
     5.5  Group:        VoIP
     5.6  License:      GPL
     5.7 -Version:      1.7.2
     5.8 -Release:      20120208
     5.9 +Version:      1.8.1
    5.10 +Release:      20120800
    5.11  
    5.12  #   package options
    5.13  %option       with_cons    yes
    5.14 @@ -70,12 +70,10 @@
    5.15  Patch5:       opensips.patch.rtpproxy
    5.16  
    5.17  #   build information
    5.18 -Prefix:       %{l_prefix}
    5.19 -BuildRoot:    %{l_buildroot}
    5.20 -BuildPreReq:  OpenPKG, openpkg >= 20060823, make, gcc, flex, bison, sed
    5.21 -PreReq:       OpenPKG, openpkg >= 20060823, bash
    5.22 -BuildPreReq:  libxml, expat, curl, pkgconfig
    5.23 -PreReq:       libxml, expat, curl
    5.24 +BuildPreReq:  OpenPKG, openpkg >= 20100101, make, gcc, flex, bison, sed
    5.25 +PreReq:       OpenPKG, openpkg >= 20100101, bash
    5.26 +BuildPreReq:  libxml, expat, curl, ncurses, pkgconfig
    5.27 +PreReq:       libxml, expat, curl, ncurses
    5.28  %if "%{with_cons}" == "yes"
    5.29  PreReq:       perl-dbi, perl-term
    5.30  %endif
    5.31 @@ -135,8 +133,6 @@
    5.32  BuildPreReq:  geoip
    5.33  PreReq:       geoip
    5.34  %endif
    5.35 -AutoReq:      no
    5.36 -AutoReqProv:  no
    5.37  
    5.38  %description
    5.39      OpenSIPS is (beside Kamailio) a successor to OpenSER, which in
    5.40 @@ -206,8 +202,7 @@
    5.41          -e 's;\(-DF_MALLOC\);#\1;' \
    5.42          -e 's;#\(-DDBG_QM_MALLOC\);\1;' \
    5.43  %endif
    5.44 -        -e 's;\(#define PKG_MEM_POOL_SIZE\) \(1024\*1024\);\1 4*\2;' \
    5.45 -        Makefile.defs \
    5.46 +        -e 's;\(#define PKG_MEM_SIZE\) 2;\1 4;' \
    5.47          config.h
    5.48      %{l_shtool} subst \
    5.49  %if "%{with_fsl}" == "yes"
    5.50 @@ -236,6 +231,7 @@
    5.51          -e 's;\(s#/usr/local/sbin\)#;\1/*#;g' \
    5.52          -e 's;\(s#/usr/share/doc/$(NAME)/#$(doc-target)\)#;\1/#;g' \
    5.53          -e 's;\(\$(MAKE).*\) \(install_module_custom\);\1 makefile_defs=0 \2;' \
    5.54 +        -e 's#\(cd menuconfig;\)\$(MAKE) proper;#\1 CC="%{l_cc}" CPPFLAGS="%{l_cppflags ncurses}" LDFLAGS="%{l_ldflags}" LIBS="-lncurses" #' \
    5.55          Makefile
    5.56      %{l_shtool} subst \
    5.57          -e 's;^\(LIBS=\).*;\1-L`%{l_prefix}/bin/pkg-config --libs db`;' \
    5.58 @@ -258,7 +254,7 @@
    5.59          -e 's;\(my \$fifo_reply_path\) = "/tmp/";\1 = "%{l_prefix}/var/opensips/";' \
    5.60          -e 's;\(my \$HISTORY_FILE\) = "/tmp/osipsconsole_history";\1 = "%{l_prefix}/var/opensips/osipsconsole_history";' \
    5.61          scripts/opensipsctl \
    5.62 -        scripts/osipsconsole \
    5.63 +        scripts/osipsconsole
    5.64      %{l_shtool} subst \
    5.65          -e 's;/usr/local;;g' \
    5.66          -e 's;\(/etc/opensips/\)\.\(opensipsctlrc\);%{l_prefix}\1\2;g' \
    5.67 @@ -492,10 +488,21 @@
    5.68          prefix=%{l_prefix} \
    5.69          modules
    5.70  
    5.71 +    #   build menuconfig
    5.72 +    %{l_make} %{l_mflags} \
    5.73 +        prefix=%{l_prefix} \
    5.74 +        cfg-prefix=$RPM_BUILD_ROOT%{l_prefix}/etc \
    5.75 +        data-prefix=$RPM_BUILD_ROOT%{l_prefix}/share \
    5.76 +        opensipsmc
    5.77 +
    5.78      #   build rtpproxy extension
    5.79      ( cd rtpproxy-%{V_rtpproxy}
    5.80        export CC="%{l_cc}"
    5.81        export CFLAGS="%{l_cflags -O}"
    5.82 +      export CPPFLAGS=""
    5.83 +      case "%{l_platform -t}" in
    5.84 +          *-sunos5.11 ) CPPFLAGS="$CPPFLAGS -DGE_SOL11" ;;
    5.85 +      esac
    5.86        export LIBS=""
    5.87        case "%{l_platform -t}" in
    5.88            *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;;
    5.89 @@ -506,9 +513,6 @@
    5.90      ) || exit $?
    5.91  
    5.92  %install
    5.93 -    #   clean build cruft
    5.94 -    rm -rf $RPM_BUILD_ROOT
    5.95 -
    5.96      #   select modules
    5.97      modslist='b2b_entities b2b_logic cpl-c db_http identity jabber perl perlvdb presence presence_dialoginfo presence_mwi presence_xml pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp regex rls tlsops xcap_client xmpp'
    5.98  %if "%{with_croute}" == "yes"
    5.99 @@ -612,7 +616,6 @@
   5.100  %files -f files
   5.101  
   5.102  %clean
   5.103 -    rm -rf $RPM_BUILD_ROOT
   5.104  
   5.105  %post
   5.106      #   on install, setup database (osipsconsole db create /pfx/var/opensips/db)

mercurial