+++ /dev/null
-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)
-%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#
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}