Bump to mdnsresponder 1310.80.1 47/270747/1 submit/tizen/20220216.033251
authorSeonah Moon <seonah1.moon@samsung.com>
Tue, 8 Feb 2022 06:43:42 +0000 (15:43 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Tue, 8 Feb 2022 06:54:31 +0000 (15:54 +0900)
Change-Id: Iebe5fe7bcbf5dbb561ad43c789015b7a37892815

1  2 
Clients/Makefile
Clients/dns-sd.c
mDNSCore/mDNS.c
mDNSPosix/Makefile
packaging/mdnsresponder.spec
pkgconfig/lib/dns_sd.pc.in
pkgconfig/lib64/dns_sd.pc.in

  
  # On OS X the dns_sd library functions are included in libSystem, which is implicitly linked with every executable
  # If /usr/lib/libSystem.dylib exists, then we're on OS X, so we don't need also to link the "dns_sd" shared library
+ ifeq "$(DEBUG)" "1"
+ DEBUGFLAGS = -g
+ BUILDDIR = build/debug
+ else
+ DEBUGFLAGS = -Os
+ BUILDDIR = build/prod
+ endif
  ifneq "$(wildcard /usr/lib/libSystem.dylib)" ""
  TARGETS = build/dns-sd build/dns-sd64
 -LIBS =
 +LIBS = -pie
  else
  TARGETS = build/dns-sd
- LIBS = -L../mDNSPosix/build/prod/ -ldns_sd -pie
 -LIBS = -L../mDNSPosix/$(BUILDDIR)/ -ldns_sd
++LIBS = -L../mDNSPosix/$(BUILDDIR)/ -ldns_sd -pie
  endif
  
  all: $(TARGETS)
@@@ -46,10 -54,10 +54,10 @@@ build
        mkdir build
  
  build/dns-sd: build dns-sd.c ClientCommon.c
-       $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -fPIE
 -      $(CC) $(SUPMAKE_CFLAGS) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@
++      $(CC) $(SUPMAKE_CFLAGS) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -fPIE
  
  build/dns-sd64: build dns-sd.c ClientCommon.c
-       $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64 -fPIE
 -      $(CC) $(SUPMAKE_CFLAGS) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64
++      $(CC) $(SUPMAKE_CFLAGS) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64 -fPIE
  
  # Note, we can make a 'fat' version of dns-sd using 'lipo', as shown below, but we
  # don't, because we don't want or need a 'fat' version of dns-sd, because it will
@@@ -61,6 -61,6 +61,7 @@@
  #include <stdio.h>          // For stdout, stderr
  #include <stdlib.h>         // For exit()
  #include <string.h>         // For strlen(), strcpy()
++#include <stdarg.h>
  #include <errno.h>          // For errno, EINTR
  #include <time.h>
  #include <sys/types.h>      // For u_char
@@@ -910,6 -910,20 +911,21 @@@ static void DNSSD_API reg_reply(DNSServ
      if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout);
  }
  
++#define MIN(A, B) ((A) < (B) ? (A) : (B))
+ static int snprintf_safe(char *str, size_t size, const char *format, ...)
+ {
+     int length = 0;
+     va_list ptr;
+     va_start(ptr, format);
+     int result = vsnprintf(str, size, format, ptr);
+     va_end(ptr);
+     if (result > 0 && size > 0)
+     {
+         length = MIN((size_t)result, size-1);
+     }
+     return length;
+ }
  // Output the wire-format domainname pointed to by rd
  static int snprintd(char *p, int max, const unsigned char **rd)
  {
diff --cc mDNSCore/mDNS.c
index e92639a,c32c915..4476fe6
mode 100755,100644..100644
@@@ -48,7 -48,7 +48,8 @@@
  
  #############################################################################
  
- LIBVERS = 878.70.2
 -LIBVERS = 1
++#LIBVERS = 1
++LIBVERS = 1310.80.1
  
  COREDIR = ../mDNSCore
  SHAREDDIR ?= ../mDNSShared
@@@ -224,18 -238,13 +250,15 @@@ endi
  endif
  endif
  
- CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
- CFLAGS_DAEMON = $(CFLAGS) $(CFLAGS_ASLR)
- LINKOPTS_DAEMON = $(LINKOPTS) $(LINKOPTS_ASLR)
+ MDNSCFLAGS = $(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUGGING) $(CFLAGS_OPEN_SOURCE)
  
  #############################################################################
- #all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder Identify NetMonitor $(OPTIONALTARG)
- all: setup Daemon libdns_sd SAClient SAResponder SAProxyResponder Identify NetMonitor $(OPTIONALTARG)
 +#In Tizen Clients needs to be build after installation of library libdns_sd.so
++#all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder NetMonitor $(OPTIONALTARG)
++all: setup Daemon libdns_sd SAClient SAResponder SAProxyResponder NetMonitor $(OPTIONALTARG)
  
 -all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder NetMonitor $(OPTIONALTARG)
 -
 -install: setup InstalledStartup InstalledDaemon InstalledLib InstalledManPages InstalledClients $(OPTINSTALL)
 +#install: setup InstalledStartup InstalledDaemon InstalledLib InstalledManPages InstalledClients $(OPTINSTALL)
 +install: setup InstalledDaemon InstalledLib $(OPTINSTALL)
  
  # 'setup' sets up the build directory structure the way we want
  setup:
@@@ -314,33 -324,22 +338,32 @@@ InstalledNSS: $(NSSINSTPATH)/$(NSSLINKN
        @echo $+ " installed"
  
  # Note: If daemon already installed, we make sure it's stopped before overwriting it
 -$(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME)
 +#$(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME)
 +$(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd
-       @if test -x $@; then $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME) stop; fi
+       if test -x $@; then $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME) stop; fi
        $(CP) $< $@
-       #@$(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME) start
 -      $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME) start
++#     $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME) start
  
 -$(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS): $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
 +$(INSTBASE)$(LIBDIR)/libdns_sd.$(LDSUFFIX).$(LIBVERS): $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
        $(CP) $< $@
 -      $(LN) $@ $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX)
 +      $(LN) $@ $(INSTBASE)$(LIBDIR)/libdns_sd.$(LDSUFFIX)
  ifdef LDCONFIG
-     # -m means 'merge into existing database', -R means 'rescan directories'
+       # -m means 'merge into existing database', -R means 'rescan directories'
        $(LDCONFIG) -mR
  endif
  
  $(INSTBASE)/include/dns_sd.h: $(SHAREDDIR)/dns_sd.h
        $(CP) $< $@
 +ifdef CONFIG_TIZEN_64BIT
 +$(warning 64bit build)
 +$(INSTBASE)$(LIBDIR)/pkgconfig/dns_sd.pc: ../pkgconfig/lib64/dns_sd.pc.in
 +      $(CP) $< $@
 +else
 +$(warning 32bit build)
 +$(INSTBASE)$(LIBDIR)/pkgconfig/dns_sd.pc: ../pkgconfig/lib/dns_sd.pc.in
 +      $(CP) $< $@
 +endif
  
  $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME): mdnsd.sh $(STARTUPSCRIPTDIR)
        $(CP) $< $@
        chmod ugo+x $@
index 83ae1e1,0000000..61d5151
mode 100755,000000..100755
--- /dev/null
@@@ -1,112 -1,0 +1,112 @@@
- Version:    878.70.2
- Release:    2
 +Name:       mdnsresponder
 +Summary:    DNS Service Discovery service with dns-sd library
- ln -sf %{_libdir}/libdns_sd.so.%{version} %{buildroot}%{_libdir}/libdns_sd.so.878
++Version:    1310.80.1
++Release:    0
 +Group:      System/Network
 +License:    Apache-2.0 or BSD-2.0
 +Source0:    %{name}-%{version}.tar.gz
 +Source1001:    mdnsresponder.manifest
 +Source1002:    libdns_sd.manifest
 +BuildRequires: pkgconfig(dlog)
 +BuildRequires: pkgconfig(libsystemd)
 +BuildRequires: bison
 +BuildRequires: flex
 +
 +Requires(post):       /sbin/ldconfig
 +Requires(postun):     /sbin/ldconfig
 +
 +%description
 +The DNS Service Discovery is part of Bonjour, Apple's implementation of
 +zero-configuration networking(ZEROCONF).
 +
 +%package -n libdns_sd
 +Summary:    DNS-SD - client libraries
 +%if "%{?_lib}" == "lib64"
 +Provides: libdns_sd.so()(64bit)
 +%else
 +Provides: libdns_sd.so
 +%endif
 +Requires:   mdnsresponder = %{version}-%{release}
 +
 +%description -n libdns_sd
 +Client libraries for DNS-SD: synchronous and asynchronous
 +
 +%package devel
 +Summary:  DNS Service Discovery (Development)
 +Requires:   libdns_sd = %{version}-%{release}
 +Requires: pkgconfig
 +
 +%description devel
 +DNS-SD development files
 +
 +%prep
 +%setup -q
 +cp -a %{SOURCE1001} .
 +cp -a %{SOURCE1002} .
 +
 +%build
 +%if "%{?_lib}" == "lib64"
 +CONFIG_TIZEN_64BIT=y; export CONFIG_TIZEN_64BIT
 +%endif
 +
 +cd mDNSPosix
 +#You should check below before change make flags or Makefile
 +mkdir -p objects/prod
 +mkdir -p build/prod
 +make os=tizen %{?_smp_mflags}
 +
 +cd ../Clients
 +make os=tizen %{?_smp_mflags}
 +
 +%install
 +MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 +
 +rm -rf %{buildroot}
 +mkdir -p %{buildroot}%{_sbindir}/
 +mkdir -p %{buildroot}%{_bindir}/
 +mkdir -p %{buildroot}%{_libdir}/
 +mkdir -p %{buildroot}%{_libdir}/pkgconfig/
 +
 +cp Clients/build/dns-sd %{buildroot}%{_bindir}/dns-sd
 +
 +mkdir -p %{buildroot}%{_includedir}/
 +%if "%{?_lib}" == "lib64"
 +CONFIG_TIZEN_64BIT=y; export CONFIG_TIZEN_64BIT
 +%endif
 +cd mDNSPosix
 +make install os=tizen DESTDIR=%{buildroot} LIBDIR=/%{?_lib}
 +strip --strip-unneeded %{buildroot}%{_libdir}/libdns_sd.so.%{version}
++ln -sf %{_libdir}/libdns_sd.so.%{version} %{buildroot}%{_libdir}/libdns_sd.so.1310
 +ln -sf %{_libdir}/libdns_sd.so.%{version} %{buildroot}%{_libdir}/libdns_sd.so
 +
 +cd ..
 +mkdir -p %{buildroot}%{_unitdir}
 +cp mdnsd.service %{buildroot}%{_unitdir}
 +mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
 +ln -s ../mdnsd.socket %{buildroot}%{_unitdir}/sockets.target.wants/
 +cp mdnsd.socket %{buildroot}%{_unitdir}
 +
 +%post
 +
 +%post -n libdns_sd -p /sbin/ldconfig
 +
 +%postun -n libdns_sd -p /sbin/ldconfig
 +
 +%files
 +%manifest mdnsresponder.manifest
 +%license LICENSE
 +%attr(755,root,root) %{_sbindir}/mdnsd
 +%attr(-,root,root) %{_bindir}/dns-sd
 +%{_unitdir}/mdnsd.service
 +%{_unitdir}/mdnsd.socket
 +%{_unitdir}/sockets.target.wants/mdnsd.socket
 +
 +%files devel
 +%{_includedir}/*.h
 +%{_libdir}/pkgconfig/*.pc
 +%{_libdir}/*.so
 +
 +%files -n libdns_sd
 +%manifest libdns_sd.manifest
 +%license LICENSE
 +%{_libdir}/libdns_sd.so*
index cca7b7d,0000000..276fb8a
mode 100755,000000..100755
--- /dev/null
@@@ -1,12 -1,0 +1,12 @@@
- Version: 878.70.2
 +prefix=/usr
 +exec_prefix=/usr
 +libdir=/usr/lib
 +includedir=/usr/include/
 +
 +Name: dns_sd
 +Description: @PACKAGE_DESCRIPTION@
++Version: 1310.80.1
 +Requires: glib-2.0
 +Libs: -L${libdir} -ldns_sd
 +Cflags: -I${includedir}
 +
index cf723ea,0000000..34e329e
mode 100755,000000..100755
--- /dev/null
@@@ -1,15 -1,0 +1,15 @@@
- Version: 878.70.2
 +
 +# Package Information for pkg-config
 +
 +prefix=/usr
 +exec_prefix=/usr
 +libdir=/usr/lib64
 +includedir=/usr/include/
 +
 +Name: dns_sd
 +Description: @PACKAGE_DESCRIPTION@
++Version: 1310.80.1
 +Requires: glib-2.0
 +Libs: -L${libdir} -ldns_sd
 +Cflags: -I${includedir}
 +