From a80cc6c37976f7fb4e475374a980b6cfd809bb0f Mon Sep 17 00:00:00 2001 From: "John L. Whiteman" Date: Thu, 7 Aug 2014 17:11:48 -0700 Subject: [PATCH] Initial commit of Content Security Framework (CSF) Change-Id: If7f39ba3000887f243bd78b34d2c8661b6b4f74f Signed-off-by: John L. Whiteman --- framework/Makefile | 26 ++++++++-------- framework/Makefile_TPCSSerDaemon | 20 ++++++------- framework/Makefile_TWPSerDaemon | 19 +++++++----- framework/Makefile_channel_client | 24 +++++++-------- framework/Makefile_channel_server | 23 ++++++++------- packaging/csf-framework.changes | 3 ++ packaging/csf-framework.manifest | 5 ++++ packaging/csf-framework.spec | 62 +++++++++++++++++++++++++++++++++++++++ 8 files changed, 129 insertions(+), 53 deletions(-) mode change 100755 => 100644 framework/Makefile_TPCSSerDaemon create mode 100644 packaging/csf-framework.changes create mode 100644 packaging/csf-framework.manifest create mode 100644 packaging/csf-framework.spec diff --git a/framework/Makefile b/framework/Makefile index a7a50f8..8bd9576 100644 --- a/framework/Makefile +++ b/framework/Makefile @@ -33,7 +33,7 @@ OUTDIR = lib TARGET = $(OUTDIR)/libsecfw.so SRCDIR = . INCLUDE = -I. $(TCS_INC) -I../plugin -LD_FLAGS := $(LD_FLAGS) -ldl +LD_FLAGS := $(LD_FLAGS) -ldl -lpthread -ltzplatform-config-1.0 ifeq ($(TCS_CC), ) CC = gcc @@ -68,29 +68,31 @@ SOURCES = $(SRCDIR)/TCSImpl.c $(SRCDIR)/TWPImpl.c OBJECTS = $(OUTDIR)/TCSImpl.o $(OUTDIR)/TWPImpl.o -MKDEP = mkdep -f .depend - +#MKDEP = mkdep -f .depend $(OUTDIR)/%.o: $(SRCDIR)/%.c $(CC) $(CFLAGS) -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c -all: $(OUTDIR) .depend $(TARGET) +#all: $(OUTDIR) .depend $(TARGET) +all: $(OUTDIR) $(TARGET) -.depend: $(SOURCES) - $(MKDEP) $(CFLAGS) $(SOURCES) +#.depend: $(SOURCES) +# $(MKDEP) $(CFLAGS) $(SOURCES) -$(TARGET): $(OBJECTS) - $(LD) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) +#$(TARGET): $(OBJECTS) +# $(LD) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) +$(TARGET): $(OBJECTS) +# $(LD) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) + $(CC) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) # $(AR) -cr $(TARGET) $(OBJECTS) - - $(STRIP) $(TARGET) +# $(STRIP) $(TARGET) $(OUTDIR): @mkdir $(OUTDIR) distclean: clean - @rm -f .depend +# @rm -f .depend @rm -rf $(OUTDIR) clean: @@ -98,5 +100,5 @@ clean: @rm -f $(OBJECTS) *~ @rm -f *.bb *.bbg *.da *.gcov --include .depend +#-include .depend diff --git a/framework/Makefile_TPCSSerDaemon b/framework/Makefile_TPCSSerDaemon old mode 100755 new mode 100644 index 3c473dd..92963f4 --- a/framework/Makefile_TPCSSerDaemon +++ b/framework/Makefile_TPCSSerDaemon @@ -32,7 +32,7 @@ OUTDIR = bin TARGET = $(OUTDIR)/TPCSSerDaemon SRCDIR = . -LD_FLAGS := $(LD_FLAGS) -ldl +LD_FLAGS := $(LD_FLAGS) -ldl -ltzplatform-config-1.0 ifeq ($(TCS_CC), ) CC = gcc @@ -79,21 +79,21 @@ SOURCES = $(SRCDIR)/TPCSSerDaemon.c \ OBJECTS = $(OUTDIR)/TPCSSerDaemon.o \ $(OUTDIR)/IpcForkDaemon.o -MKDEP = mkdep -f .depend +#MKDEP = mkdep -f .depend $(OUTDIR)/%.o: $(SRCDIR)/%.c $(CC) $(CFLAGS) -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c -all: $(OUTDIR) .depend $(TARGET) +#all: $(OUTDIR) .depend $(TARGET) +all: $(OUTDIR) $(TARGET) -.depend: $(SOURCES) - $(MKDEP) $(CFLAGS) $(SOURCES) +#.depend: $(SOURCES) +# $(MKDEP) $(CFLAGS) $(SOURCES) $(TARGET): $(OBJECTS) - $(LD) -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) - +# $(LD) -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) + $(CC) -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) # $(AR) -cr $(TARGET) $(OBJECTS) - # $(STRIP) $(TARGET) $(OUTDIR): @@ -104,7 +104,7 @@ install: all cp ${TARGET} ${DESTDIR}/bin/ distclean: clean - @rm -f .depend +# @rm -f .depend @rm -rf $(OUTDIR) clean: @@ -112,5 +112,5 @@ clean: @rm -f $(OBJECTS) *~ @rm -f *.bb *.bbg *.da *.gcov --include .depend +#-include .depend diff --git a/framework/Makefile_TWPSerDaemon b/framework/Makefile_TWPSerDaemon index e659faf..3156c05 100644 --- a/framework/Makefile_TWPSerDaemon +++ b/framework/Makefile_TWPSerDaemon @@ -33,7 +33,7 @@ OUTDIR = bin TARGET = $(OUTDIR)/TWPSerDaemon SRCDIR = . INCLUDE = -I. $(TCS_INC) -I../plugin -LD_FLAGS := $(LD_FLAGS) -ldl -lpthread -lsecfw -lscserver -lpthread -lm -Llib +LD_FLAGS := $(LD_FLAGS) -ldl -lpthread -lsecfw -lscserver -lm -Llib -ltzplatform-config-1.0 ifeq ($(TCS_CC), ) CC = gcc @@ -70,7 +70,7 @@ SOURCES = $(SRCDIR)/TWPSerDaemon.c \ OBJECTS = $(OUTDIR)/TWPSerDaemon.o \ $(OUTDIR)/IpcForkDaemon.o -MKDEP = mkdep -f .depend +#MKDEP = mkdep -f .depend # Define a list of pkg-config packages we want to use pkg_packages = dbus-glib-1 dlog @@ -87,20 +87,22 @@ PKGCFLAGS += -Wall -I$(SRCDIR) $(PKCL_CFLAGS) $(GBS_CFLAGS) $(PKG_CFLAGS) $(OUTDIR)/%.o: $(SRCDIR)/%.c $(CC) $(CFLAGS) $(PKGCFLAGS) -I. -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c -all: $(OUTDIR) .depend $(TARGET) +#all: $(OUTDIR) .depend $(TARGET) +all: $(OUTDIR) $(TARGET) -.depend: $(SOURCES) - $(MKDEP) $(CFLAGS) $(SOURCES) +#.depend: $(SOURCES) +# $(MKDEP) $(CFLAGS) $(SOURCES) $(TARGET): $(OBJECTS) - $(LD) -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) $(PKGLD_FLAGS) +# $(LD) -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) $(PKGLD_FLAGS) + $(CC) -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) $(PKGLD_FLAGS) # $(STRIP) $(TARGET) $(OUTDIR): @mkdir $(OUTDIR) distclean: clean - @rm -f .depend +# @rm -f .depend @rm -rf $(OUTDIR) clean: @@ -108,4 +110,5 @@ clean: @rm -f $(OBJECTS) *~ @rm -f *.bb *.bbg *.da *.gcov --include .depend \ No newline at end of file +#-include .depend + diff --git a/framework/Makefile_channel_client b/framework/Makefile_channel_client index 82b1c86..22da3a7 100644 --- a/framework/Makefile_channel_client +++ b/framework/Makefile_channel_client @@ -32,7 +32,7 @@ OUTDIR = lib TARGET = $(OUTDIR)/libscclient.so SRCDIR = . -LD_FLAGS := $(LD_FLAGS) -ldl +LD_FLAGS := $(LD_FLAGS) -ldl -lpthread -ltzplatform-config-1.0 ifeq ($(TCS_CC), ) CC = gcc @@ -79,22 +79,22 @@ SOURCES = $(SRCDIR)/IpcClient.c \ OBJECTS = $(OUTDIR)/IpcClient.o \ $(OUTDIR)/IpcStructs.o -MKDEP = mkdep -f .depend +#MKDEP = mkdep -f .depend $(OUTDIR)/%.o: $(SRCDIR)/%.c $(CC) $(CFLAGS) -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c -all: $(OUTDIR) .depend $(TARGET) +#all: $(OUTDIR) .depend $(TARGET) +all: $(OUTDIR) $(TARGET) -.depend: $(SOURCES) - $(MKDEP) $(CFLAGS) $(SOURCES) +#.depend: $(SOURCES) +# $(MKDEP) $(CFLAGS) $(SOURCES) $(TARGET): $(OBJECTS) - $(LD) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) - +# $(LD) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) + $(CC) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) # $(AR) -cr $(TARGET) $(OBJECTS) - - $(STRIP) $(TARGET) +# $(STRIP) $(TARGET) $(OUTDIR): @mkdir $(OUTDIR) @@ -104,13 +104,13 @@ install: all cp ${TARGET} ${DESTDIR}/bin/ distclean: clean - @rm -f .depend -# @rm -rf $(OUTDIR) +# @rm -f .depend + @rm -rf $(OUTDIR) clean: @rm -f $(TARGET) @rm -f $(OBJECTS) *~ @rm -f *.bb *.bbg *.da *.gcov --include .depend +#-include .depend diff --git a/framework/Makefile_channel_server b/framework/Makefile_channel_server index d9cc671..34bf480 100644 --- a/framework/Makefile_channel_server +++ b/framework/Makefile_channel_server @@ -32,7 +32,7 @@ OUTDIR = lib TARGET = $(OUTDIR)/libscserver.so SRCDIR = . -LD_FLAGS := $(LD_FLAGS) -ldl +LD_FLAGS := $(LD_FLAGS) -ldl -lpthread -ltzplatform-config-1.0 ifeq ($(TCS_CC), ) CC = gcc @@ -81,21 +81,21 @@ OBJECTS = $(OUTDIR)/IpcServer.o \ $(OUTDIR)/IpcServerError.o \ $(OUTDIR)/IpcThrdPool.o -MKDEP = mkdep -f .depend +#MKDEP = mkdep -f .depend $(OUTDIR)/%.o: $(SRCDIR)/%.c $(CC) $(CFLAGS) -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c -all: $(OUTDIR) .depend $(TARGET) +#all: $(OUTDIR) .depend $(TARGET) +all: $(OUTDIR) $(TARGET) -.depend: $(SOURCES) - $(MKDEP) $(CFLAGS) $(SOURCES) +#.depend: $(SOURCES) +# $(MKDEP) $(CFLAGS) $(SOURCES) $(TARGET): $(OBJECTS) - $(LD) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) - + #$(LD) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) + $(CC) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) # $(AR) -cr $(TARGET) $(OBJECTS) - # $(STRIP) $(TARGET) $(OUTDIR): @@ -106,12 +106,13 @@ install: all cp ${TARGET} ${DESTDIR}/bin/ distclean: clean - @rm -f .depend -# @rm -rf $(OUTDIR) +# @rm -f .depend + @rm -rf $(OUTDIR) clean: @rm -f $(TARGET) @rm -f $(OBJECTS) *~ @rm -f *.bb *.bbg *.da *.gcov --include .depend +#-include .depend + diff --git a/packaging/csf-framework.changes b/packaging/csf-framework.changes new file mode 100644 index 0000000..56389d3 --- /dev/null +++ b/packaging/csf-framework.changes @@ -0,0 +1,3 @@ +* Thu Aug 07 2014 John L. Whiteman upstream/2.0.1-1-g2af60fc +- Initial commit of Content Security Framework (CSF) + diff --git a/packaging/csf-framework.manifest b/packaging/csf-framework.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/csf-framework.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/csf-framework.spec b/packaging/csf-framework.spec new file mode 100644 index 0000000..5b64ba0 --- /dev/null +++ b/packaging/csf-framework.spec @@ -0,0 +1,62 @@ +Summary: Content Security Framework +Name: csf-framework +Version: 2.0.1 +Release: 0 +License: BSD-3-Clause +Group: Security/Libraries +URL: http://tizen.org +Source: %{name}-%{version}.tar.gz +Source1001: csf-framework.manifest +BuildRequires: pkgconfig(libtzplatform-config) +BuildRequires: pkgconfig(dbus-glib-1) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(libxml-2.0) + +%description +A general purpose content screening and reputation solution. + +%prep +%setup -q +cp %{SOURCE1001} . + +%build +cd framework + +# Build Framework Library +make -f Makefile all + +# Build IPC Client Library +make -f Makefile_channel_client all + +# Build IPC Server Library +make -f Makefile_channel_server all + +# Build Plugin Control Service +make -f Makefile_TPCSSerDaemon all + +# Build Web Protection Control Service +make -f Makefile_TWPSerDaemon all + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_libdir}/ +mkdir -p %{buildroot}%{_bindir}/ +install -D framework/lib/libsecfw.so %{buildroot}%{_libdir}/ +install -D framework/lib/libscclient.so %{buildroot}%{_libdir}/ +install -D framework/lib/libscserver.so %{buildroot}%{_libdir}/ +install -D framework/bin/TPCSSerDaemon %{buildroot}%{_bindir}/ +install -D framework/bin/TWPSerDaemon %{buildroot}%{_bindir}/ + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%manifest %{name}.manifest +%defattr(-,root,root,-) +%{_libdir}/libsecfw.so +%{_libdir}/libscclient.so +%{_libdir}/libscserver.so +%attr(755,root,root) %{_bindir}/TPCSSerDaemon +%attr(755,root,root) %{_bindir}/TWPSerDaemon + -- 2.7.4