Location Manager Implementation
[platform/core/csapi/tizenfx.git] / packaging / csapi-location.spec
1 %define dllpath %{_libdir}/mono/tizen
2 %define dllname Tizen.Location.dll
3
4 Name:       csapi-location
5 Summary:    Tizen Location API's for C#
6 Version:    1.0.0
7 Release:    1
8 Group:      Development/Libraries
9 License:    Apache-2.0
10 URL:        https://www.tizen.org
11 Source0:    %{name}-%{version}.tar.gz
12 Source1:    %{name}.manifest
13 Source2:    %{name}.pc.in
14
15 # TODO: replace mono-compiler, mono-devel to mcs, mono-shlib-cop
16 BuildRequires: mono-compiler
17 BuildRequires: mono-devel
18 # TODO: replace mono-core to gacutil.
19 #       mono-core should provide the symbol 'gacutil'
20 Requires(post): mono-core
21 Requires(postun): mono-core
22
23 # P/Invoke Dependencies
24 BuildRequires: pkgconfig(glib-2.0)
25 BuildRequires: pkgconfig(csapi-tizen)
26
27 # P/Invoke Runtime Dependencies
28 # TODO: It should be removed after fix tizen-rpm-config
29 Requires: glib-2.0
30 BuildRequires: pkgconfig(capi-location-manager)
31 # DLL Dependencies
32 #BuildRequires: ...
33
34 %description
35 Tizen API for C#
36
37 %package devel
38 Summary:    Development package for %{name}
39 Group:      Development/Libraries
40 Requires:   %{name} = %{version}-%{release}
41
42 %description devel
43 Development package for %{name}
44
45 %prep
46 %setup -q
47
48 cp %{SOURCE1} .
49
50 %build
51 # build dll
52 mcs -target:library -out:%{dllname} -keyfile:Tizen.Location/Tizen.Location.snk -pkg:'csapi-tizen'\
53   Tizen.Location/Properties/AssemblyInfo.cs \
54   Tizen.Location/Interop/*.cs \
55   Tizen.Location/Tizen.Location/*.cs
56
57 # check p/invoke
58 if [ -x %{dllname} ]; then
59   RET=`mono-shlib-cop %{dllname}`; \
60   CNT=`echo $RET | grep -E "^error:" | wc -l`; \
61   if [ $CNT -gt 0 ]; then exit 1; fi
62 fi
63
64 %install
65 # copy dll
66 mkdir -p %{buildroot}%{dllpath}
67 install -p -m 644 %{dllname} %{buildroot}%{dllpath}
68
69 # generate pkgconfig
70 mkdir -p %{buildroot}%{_libdir}/pkgconfig
71 sed -e "s#@version@#%{version}#g" \
72     -e "s#@dllpath@#%{dllpath}#g" \
73     -e "s#@dllname@#%{dllname}#g" \
74     %{SOURCE2} > %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
75
76 %post
77 gacutil -i %{dllpath}/%{dllname}
78
79 %files
80 %{dllpath}/%{dllname}
81
82 %files devel
83 %{_libdir}/pkgconfig/%{name}.pc