#############################################################################
- LIBVERS = 878.70.2
-LIBVERS = 1
++LIBVERS = 1096.40.7
COREDIR = ../mDNSCore
SHAREDDIR ?= ../mDNSShared
endif
endif
- CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
- CFLAGS_DAEMON = $(CFLAGS) $(CFLAGS_ASLR)
+ MDNSCFLAGS = $(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUGGING) $(CFLAGS_OPEN_SOURCE)
-#############################################################################
++MDNSCFLAGS_DAEMON = $(MDNSCFLAGS)
+LINKOPTS_DAEMON = $(LINKOPTS) $(LINKOPTS_ASLR)
-all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder 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 Identify NetMonitor $(OPTIONALTARG)
- all: setup Daemon libdns_sd SAClient SAResponder SAProxyResponder Identify NetMonitor $(OPTIONALTARG)
++#all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder NetMonitor $(OPTIONALTARG)
++all: setup Daemon libdns_sd 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:
@echo "Responder daemon done"
$(BUILDDIR)/mdnsd: $(DAEMONOBJS)
- $(CC) -o $@ $+ $(LINKOPTS_DAEMON) -pie
- @$(STRIP) $@
- $(CC) -o $@ $+ $(LINKOPTS)
++ $(CC) -o $@ $+ $(LINKOPTS_DAEMON)
+ $(STRIP) $@
# libdns_sd target builds the client library
libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
@echo $+ " installed"
# Note: If daemon already installed, we make sure it's stopped before overwriting it
-$(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME)
- if test -x $@; then $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME) stop; fi
+#$(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'
+ # -m means 'merge into existing database', -R means 'rescan directories'
$(LDCONFIG) -mR
endif
# Implicit rules
$(OBJDIR)/%.c.o: %.c
- $(CC) $(CFLAGS_DAEMON) -c -o $@ $<
- $(CC) $(MDNSCFLAGS) -c -o $@ $<
++ $(CC) $(MDNSCFLAGS_DAEMON) -c -o $@ $<
$(OBJDIR)/%.c.o: $(COREDIR)/%.c
- $(CC) $(CFLAGS_DAEMON) -c -o $@ $<
- $(CC) $(MDNSCFLAGS) -c -o $@ $<
++ $(CC) $(MDNSCFLAGS_DAEMON) -c -o $@ $<
$(OBJDIR)/%.c.o: $(SHAREDDIR)/%.c
- $(CC) $(CFLAGS_DAEMON) -c -o $@ $<
- $(CC) $(MDNSCFLAGS) -c -o $@ $<
++ $(CC) $(MDNSCFLAGS_DAEMON) -c -o $@ $<
+
+ $(OBJDIR)/%.c.o: $(DSODIR)/%.c
- $(CC) $(MDNSCFLAGS) -c -o $@ $<
++ $(CC) $(MDNSCFLAGS_DAEMON) -c -o $@ $<
$(OBJDIR)/%.c.threadsafe.o: %.c
- $(CC) $(CFLAGS_DAEMON) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
- $(CC) $(MDNSCFLAGS) $(MDNSCFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
++ $(CC) $(MDNSCFLAGS_DAEMON) $(MDNSCFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
$(OBJDIR)/%.c.threadsafe.o: $(SHAREDDIR)/%.c
- $(CC) $(CFLAGS_DAEMON) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
- $(CC) $(MDNSCFLAGS) $(MDNSCFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
++ $(CC) $(MDNSCFLAGS_DAEMON) $(MDNSCFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
$(OBJDIR)/%.c.so.o: %.c
- $(CC) $(CFLAGS) -c -fPIC -o $@ $<
+ $(CC) $(MDNSCFLAGS) -c -fPIC -o $@ $<
$(OBJDIR)/%.c.so.o: $(SHAREDDIR)/%.c
- $(CC) $(CFLAGS) -c -fPIC -o $@ $<
+ $(CC) $(MDNSCFLAGS) -c -fPIC -o $@ $<
$(OBJDIR)/%.y.o: $(SHAREDDIR)/%.y
$(BISON) -o $(OBJDIR)/$*.c -d $<
- $(CC) $(CFLAGS_DAEMON) -c -o $@ $(OBJDIR)/$*.c
- $(CC) $(MDNSCFLAGS) -c -o $@ $(OBJDIR)/$*.c
++ $(CC) $(MDNSCFLAGS_DAEMON) -c -o $@ $(OBJDIR)/$*.c
$(OBJDIR)/%.l.o: $(SHAREDDIR)/%.l
$(FLEX) $(FLEXFLAGS_OS) -i -o$(OBJDIR)/$*.l.c $<
- $(CC) $(CFLAGS_DAEMON) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c
- $(CC) $(MDNSCFLAGS) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c
++ $(CC) $(MDNSCFLAGS_DAEMON) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c
--- /dev/null
- Version: 878.70.2
- Release: 2
+Name: mdnsresponder
+Summary: DNS Service Discovery service with dns-sd library
++Version: 1096.40.7
++Release: 1
+Group: System/Network
+License: Apache-2.0 or BSD-2.0
+Source0: %{name}-%{version}.tar.gz
+Source1001: mdnsresponder.manifest
+Source1002: libdns_sd.manifest
+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}
+
+%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 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}
+strip --strip-unneeded %{buildroot}%{_libdir}/libdns_sd.so.%{version}
+ln -sf %{_libdir}/libdns_sd.so.%{version} %{buildroot}%{_libdir}/libdns_sd.so.878
+ln -sf %{_libdir}/libdns_sd.so.%{version} %{buildroot}%{_libdir}/libdns_sd.so
+
+%post
+chmod 755 %{_bindir}/mdnsresponder-server.sh
+
+%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
+
+%files devel
+%{_includedir}/*.h
+%{_libdir}/pkgconfig/*.pc
+%{_libdir}/*.so
+
+%files -n libdns_sd
+%manifest libdns_sd.manifest
+%license LICENSE
+%{_libdir}/libdns_sd.so*