Tizen.Multimedia spec : Switch to xbuild
authorRavi Kiran K N <ravi.kiran@samsung.com>
Mon, 6 Jun 2016 11:45:55 +0000 (17:15 +0530)
committerRavi Kiran K N <ravi.kiran@samsung.com>
Mon, 6 Jun 2016 11:45:55 +0000 (17:15 +0530)
Change-Id: I89b42d3303d1835f9cd6c0750150636c983ec73a
Signed-off-by: Ravi Kiran K N <ravi.kiran@samsung.com>
packaging/csapi-multimedia.spec
src/Tizen.Multimedia/Tizen.Multimedia.csproj

index 8976668..eea93c6 100644 (file)
@@ -1,5 +1,5 @@
-%define dllpath %{_libdir}/mono/tizen
-%define dllname Tizen.Multimedia.dll
+%define BUILDCONF Debug
+
 Name:       csapi-multimedia
 Summary:    Tizen Multimedia API for C#
 Version:    1.0.0
@@ -10,64 +10,49 @@ 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
+
 BuildRequires: mono-compiler
 BuildRequires: mono-devel
-#BuildRequires: mcs
-#BuildRequires: mono-shlib-cop
-# TODO: replace mono-core to gacutil.
-#       mono-core should provide the symbol 'gacutil'
-Requires(post): mono-core
-Requires(postun): mono-core
-# P/Invoke Dependencies
+
 BuildRequires: pkgconfig(csapi-tizen)
 BuildRequires: pkgconfig(capi-media-player)
 BuildRequires: pkgconfig(capi-media-recorder)
 BuildRequires: pkgconfig(capi-media-sound-manager)
 
-# P/Invoke Runtime Dependencies
-# TODO: It should be removed after fix tizen-rpm-config
-#Requires: capi-multimedia-device
-# DLL Dependencies
-#BuildRequires: ...
 %description
 Tizen Multimedia 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
-mcs -target:library -out:%{dllname} -keyfile:Tizen.Multimedia/Tizen.Multimedia.snk -pkg:'csapi-tizen' \
-  Tizen.Multimedia/Properties/AssemblyInfo.cs \
-  Tizen.Multimedia/Player/*.cs \
-  Tizen.Multimedia/Recorder/*.cs \
-  Tizen.Multimedia/AudioManager/*.cs \
-  Tizen.Multimedia/Interop/*.cs
-# 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
+xbuild Tizen.Multimedia/Tizen.Multimedia.csproj /p:Configuration=%{BUILDCONF}
+
+
 %install
-# copy dll
-mkdir -p %{buildroot}%{dllpath}
-install -p -m 644 %{dllname} %{buildroot}%{dllpath}
+gacutil -i Tizen.Multimedia/bin/%{BUILDCONF}/*.dll -root "%{buildroot}%{_libdir}" -package tizen
+
 # generate pkgconfig
+%define pc_libs %{_libdir}/mono/tizen/Tizen.Multimedia.dll
 mkdir -p %{buildroot}%{_libdir}/pkgconfig
-sed -e "s#@version@#%{version}#g" \
-    -e "s#@dllpath@#%{dllpath}#g" \
-    -e "s#@dllname@#%{dllname}#g" \
+sed -e "s#@name@#%{name}#g" \
+    -e "s#@version@#%{version}#g" \
+    -e "s#@libs@#%{pc_libs}#g" \
     %{SOURCE2} > %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
-%post
-gacutil -i %{dllpath}/%{dllname}
+
 %files
-%{dllpath}/%{dllname}
+%manifest %{name}.manifest
+%{_libdir}/mono/
+
 %files devel
 %{_libdir}/pkgconfig/%{name}.pc
index a853910..b3300fc 100644 (file)
@@ -12,6 +12,8 @@
     <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
     <TargetFrameworkProfile />\r
+    <ProductVersion>8.0.30703</ProductVersion>\r
+    <SchemaVersion>2.0</SchemaVersion>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <Reference Include="Microsoft.CSharp" />\r
     <Reference Include="System.Data" />\r
     <Reference Include="System.Xml" />\r
+    <Reference Include="Tizen">\r
+      <HintPath>..\..\tizen\Tizen\bin\Debug\Tizen.dll</HintPath>\r
+    </Reference>\r
+    <Reference Include="Tizen.Internals">\r
+      <HintPath>..\..\tizen\Tizen.Internals\bin\Debug\Tizen.Internals.dll</HintPath>\r
+    </Reference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Compile Include="Interop\Interop.Player.cs" />\r
   <Target Name="AfterBuild">\r
   </Target>\r
   -->\r
-  <ItemGroup>\r
-    <ProjectReference Include="..\..\tizen\Tizen\Tizen.csproj">\r
-      <Project>{7659CA59-410D-41A1-9841-586E88BC78C9}</Project>\r
-      <Name>Tizen</Name>\r
-    </ProjectReference>\r
-    <ProjectReference Include="..\..\tizen\Tizen.Internals\Tizen.Internals.csproj">\r
-      <Project>{B9AA1CB2-F72D-4A30-A33B-A20C850A38A0}</Project>\r
-      <Name>Tizen.Internals</Name>\r
-    </ProjectReference>\r
-  </ItemGroup>\r
 </Project>
\ No newline at end of file