Change assembly installation path
authorWonYoung Choi <wy80.choi@samsung.com>
Wed, 6 Jul 2016 07:13:48 +0000 (16:13 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Wed, 6 Jul 2016 08:28:04 +0000 (17:28 +0900)
The assembly installation path is changed to /usr/share/assembly/ as default.
This path can be overrided by the macro %dotnet_assembly_path also.

Change-Id: I650063f7697db2054b65f62b8e1b2940810f54a1

Makefile [deleted file]
Tizen.System.Sensor/Tizen.System.Sensor.csproj
Tizen.System.Sensor/Tizen.System.Sensor.pidb [deleted file]
packaging/csapi-system.sensor.pc.in [deleted file]
packaging/csapi-system.sensor.spec

diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index f6f9a65..0000000
--- a/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-ASM_DIRS := Tizen.System.Sensor
-ASM_DLLS := $(addsuffix .dll,$(ASM_DIRS))
-
-FLAGS := 
-
-ALL: $(ASM_DLLS)
-
-define make-dll
-$(eval ASM = $(strip $1))
-$(eval SRC = $(shell find $(ASM) -path $(ASM)/obj -prune -o -name '*.cs' -print))
-$(eval PKG = $(shell echo $2 | tr ' ' ','))
-$(ASM).dll: $(SRC)
-       @echo "[BUILD] $$@"
-       @mcs /nologo /out:$$@ /t:library /keyfile:$(ASM)/$(ASM).snk $(addprefix /pkg:,$(PKG)) $(FLAGS) $(SRC)
-       @echo "[CHECK] $$@"
-       @RET=`mono-shlib-cop $$@`; \
-  CNT=`echo $$$$RET | grep -e '^error:' | wc -l`; \
-  if [ $$$$CNT -gt 0 ]; then echo $$$$RET; rm -f $$@ exit 1; fi
-endef
-
-$(eval $(call make-dll, Tizen.System.Sensor, csapi-tizen))
-
-clean:
-       @rm -f $(ASM_DLLS)
index cd3eb31..befab9c 100644 (file)
@@ -8,7 +8,7 @@
     <ProjectGuid>{CB655C6A-F73B-448E-913C-CA4DCBC5E401}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
     <RootNamespace>Tizen.System.Sensor</RootNamespace>\r
-    <AssemblyName>Tizen.System</AssemblyName>\r
+    <AssemblyName>Tizen.System.Sensor</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <TargetFrameworkProfile />\r
   </PropertyGroup>\r
diff --git a/Tizen.System.Sensor/Tizen.System.Sensor.pidb b/Tizen.System.Sensor/Tizen.System.Sensor.pidb
deleted file mode 100644 (file)
index 78ae299..0000000
Binary files a/Tizen.System.Sensor/Tizen.System.Sensor.pidb and /dev/null differ
diff --git a/packaging/csapi-system.sensor.pc.in b/packaging/csapi-system.sensor.pc.in
deleted file mode 100755 (executable)
index 72354d8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-Name: csapi-system-sensor
-Description: Tizen Sensor API for C#
-Version: @version@
-Libs: -r:@dllpath@/@dllname@
-Requires:
index 0bf68ac..46889ee 100644 (file)
@@ -1,7 +1,10 @@
-%define BUILDCONF Debug
+%{!?dotnet_assembly_path: %define dotnet_assembly_path %{_datadir}/assembly}
 
-%define dllpath %{_libdir}/mono/tizen
-%define dllname Tizen.System.dll
+%if 0%{?tizen_build_devel_mode}
+%define BUILDCONF Debug
+%else
+%define BUILDCONF Release
+%endif
 
 Name:       csapi-system.sensor
 Summary:    Tizen Sensor API for C#
@@ -12,72 +15,46 @@ License:    Apache-2.0
 URL:        https://www.tizen.org
 Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}.manifest
-Source2:    %{name}.pc.in
 
-# TODO: replace mono-compiler, mono-devel to mcs, mono-shlib-cop
+# Mono
 BuildRequires: mono-compiler
 BuildRequires: mono-devel
-#BuildRequires: mcs
-#BuildRequires: mono-shlib-cop
-BuildRequires: pkgconfig(csapi-tizen)
-BuildRequires: pkgconfig(glib-2.0)
 
-# TODO: replace mono-core to gacutil.
-#       mono-core should provide the symbol 'gacutil'
-Requires(post): mono-core
-Requires(postun): mono-core
-
-# P/Invoke Dependencies
+# P/Invoke Build Requires
+BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(capi-system-sensor)
 
-# P/Invoke Runtime Dependencies
-# TODO: It should be removed after fix tizen-rpm-config
-Requires: capi-system-sensor
-# DLL Dependencies
-#BuildRequires: ...
+# C# API Requires
+BuildRequires: csapi-tizen
 
 %description
 Tizen Sensor API for C#
 
-%package devel
-Summary:    Development package for %{name}
-Group:      Development/Libraries
-Requires:   %{name} = %{version}-%{release}
-
-%description devel
-Development package for %{name}
-
 %prep
 %setup -q
-
 cp %{SOURCE1} .
 
-%build
-# build dll
-xbuild Tizen.System.Sensor/Tizen.System.Sensor.csproj /p:Configuration=%{BUILDCONF}
+%define Assemblies Tizen.System.Sensor
 
-# check p/invoke
-if [ -x %{dllname} ]; then
-  RET=`mono-shlib-cop %{dllname}`; \
-  CNT=`echo $RET | grep -E "^error:" | wc -l`; \
-  if [ $CNT -gt 0 ]; then exit 1; fi
-fi
+%build
+for ASM in %{Assemblies}; do
+xbuild $ASM/$ASM.csproj \
+        /p:Configuration=%{BUILDCONF} \
+        /p:ReferencePath=%{dotnet_assembly_path}
+done
 
 %install
-# copy dll
-gacutil -i Tizen.System.Sensor/bin/%{BUILDCONF}/*.dll -root "%{buildroot}%{_libdir}" -package tizen
+# Assemblies
+mkdir -p %{buildroot}%{dotnet_assembly_path}
+for ASM in %{Assemblies}; do
+install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
+done
 
-# generate pkgconfig
-%define pc_libs %{_libdir}/mono/tizen/Tizen.System.Sensor.dll
-mkdir -p %{buildroot}%{_libdir}/pkgconfig
-sed -e "s#@name@#%{name}#g" \
-    -e "s#@version@#%{version}#g" \
-    -e "s#@libs@#%{pc_libs}#g" \
-    %{SOURCE2} > %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
+# License
+mkdir -p %{buildroot}%{_datadir}/license
+cp LICENSE %{buildroot}%{_datadir}/license/%{name}
 
 %files
 %manifest %{name}.manifest
-%{_libdir}/mono/
-
-%files devel
-%{_libdir}/pkgconfig/%{name}.pc
+%attr(644,root,root) %{dotnet_assembly_path}/*.dll
+%attr(644,root,root) %{_datadir}/license/%{name}