#############################################################################
- LIBVERS = 576.30.4
-LIBVERS = 1
++LIBVERS = 765.50.9
COREDIR = ../mDNSCore
SHAREDDIR ?= ../mDNSShared
LDSUFFIX = dylib
JDK = /System/Library/Frameworks/JavaVM.framework/Home
JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
+ OPTIONALTARG = dnsextd
else
- CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -DTIZEN_EXT -DCONFIG_DISABLE_REUSEPORT -fno-strict-aliasing $(shell pkg-config --cflags --libs glib-2.0)
+ifeq ($(os),tizen)
++CFLAGS_OS = -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -DTIZEN_EXT -DCONFIG_DISABLE_REUSEPORT -fno-strict-aliasing
+LD = $(CC) -shared
+FLEXFLAGS_OS = -l
+INSTBASE = $(DESTDIR)/usr
+else
+
$(error ERROR: Must specify target OS on command-line, e.g. "make os=x [target]".\
-Supported operating systems include: x, linux, linux-uclibc, netbsd, freebsd, openbsd, solaris)
+Supported operating systems include: x, linux, linux-uclibc, netbsd, freebsd, openbsd, solaris, tizen)
+endif
endif
endif
endif
CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
#############################################################################
- #all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder Identify NetMonitor dnsextd $(OPTIONALTARG)
- all: setup Daemon libdns_sd SAClient SAResponder SAProxyResponder Identify NetMonitor dnsextd $(OPTIONALTARG)
+#In Tizen Clients needs to be build after installation of library libdns_sd.so
++#all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder Identify NetMonitor $(OPTIONALTARG)
++all: setup Daemon libdns_sd SAClient SAResponder SAProxyResponder Identify NetMonitor $(OPTIONALTARG)
- #install: setup InstalledDaemon InstalledStartup InstalledLib InstalledManPages InstalledClients $(OPTINSTALL)
-all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder Identify 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:
@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
$(CP) $< $@
- @$(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'
$(LDCONFIG) -mR
$(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
+
- # We make this target dependent on $(INSTBASE)/sbin/mdnsd because we need to ensure
- # that the daemon is installed *before* we try to execute the command to start it.
- $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME): mdnsd.sh $(STARTUPSCRIPTDIR) $(INSTBASE)/sbin/mdnsd
+ $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME): mdnsd.sh $(STARTUPSCRIPTDIR)
$(CP) $< $@
chmod ugo+x $@
- $@ start
ifdef RUNLEVELSCRIPTSDIR
ifeq ($(wildcard $(RUNLEVELSCRIPTSDIR)/runlevels/default), $(RUNLEVELSCRIPTSDIR)/runlevels/default)
$(LN) $@ $(RUNLEVELSCRIPTSDIR)/runlevels/default/mdns
--- /dev/null
- Version: 576.30.4
+%define source_name mDNSResponder
+
+Name: mdnsresponder
+Summary: DNS Service Discovery service with dns-sd library
- BuildRequires: pkgconfig(glib-2.0)
++Version: 765.50.9
+Release: 1
+Group: System/Network
+License: Apache-2.0 or BSD-2.0
+Source0: %{source_name}-%{version}.tar.gz
+Source1001: mdnsresponder.manifest
+Source1002: libdns_sd.manifest
- ln -sf %{_libdir}/libdns_sd.so.%{version} %{buildroot}%{_libdir}/libdns_sd.so.576
+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
+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/
+
+#mkdir -p %{buildroot}%{_libdir}/systemd/system/
+#cp mdnsd.service %{buildroot}%{_libdir}/systemd/system/mdnsd.service
+#mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
+#ln -s mdnsd.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/mdnsd.service
+
+cp mdnsresponder-server.sh.in %{buildroot}%{_bindir}/mdnsresponder-server.sh
+
+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}
++ln -sf %{_libdir}/libdns_sd.so.%{version} %{buildroot}%{_libdir}/libdns_sd.so.765
+ln -sf %{_libdir}/libdns_sd.so.%{version} %{buildroot}%{_libdir}/libdns_sd.so
+
+%post
+chmod 755 %{_bindir}/mdnsresponder-server.sh
+#systemctl daemon-reload
+
+#if [ $1 = 1 ]; then
+# systemctl enable mdnsd.service
+#fi
+
+#systemctl restart mdnsd.service
+
+#%preun
+#if [ $1 = 0 ]; then
+# # unistall
+# systemctl stop mdnsd.service
+#fi
+
+%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}/mdnsresponder-server.sh
+#%attr(-,root,root) %{_libdir}/systemd/system/mdnsd.service
+#%attr(-,root,root) %{_libdir}/systemd/system/multi-user.target.wants/mdnsd.service
+
+%files devel
+%{_includedir}/*.h
+%{_libdir}/pkgconfig/*.pc
+%{_libdir}/*.so
+
+%files -n libdns_sd
+%manifest libdns_sd.manifest
+%license LICENSE
+%{_libdir}/libdns_sd.so*