Initial Code with Doxygen Comments and TCT
[platform/core/csapi/push.git] / packaging / csapi-push.spec
1 %define dllpath %{_libdir}/mono/tizen
2 %define dllname Tizen.Messaging.Push.dll
3
4 Name:       csapi-push
5 Summary:    Tizen Push API 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 BuildRequires: libpush
27 BuildRequires: libpush-devel
28
29 %description
30 Tizen API for C#
31
32 %package devel
33 Summary:    Development package for %{name}
34 Group:      Development/Libraries
35 Requires:   %{name} = %{version}-%{release}
36
37 %description devel
38 Development package for %{name}
39
40 %prep
41 %setup -q
42
43 cp %{SOURCE1} .
44
45 %build
46 # build dll
47 mcs -target:library -out:%{dllname} -keyfile:Tizen.Messaging/Tizen.Messaging.Push.snk -pkg:'csapi-tizen'\
48   Tizen.Messaging/Properties/AssemblyInfo.cs \
49   Tizen.Messaging/Interop/*.cs \
50   Tizen.Messaging/Push/*.cs
51
52 # check p/invoke
53 if [ -x %{dllname} ]; then
54   RET=`mono-shlib-cop %{dllname}`; \
55   CNT=`echo $RET | grep -E "^error:" | wc -l`; \
56   if [ $CNT -gt 0 ]; then exit 1; fi
57 fi
58
59 %install
60 # copy dll
61 mkdir -p %{buildroot}%{dllpath}
62 install -p -m 644 %{dllname} %{buildroot}%{dllpath}
63
64 # generate pkgconfig
65 mkdir -p %{buildroot}%{_libdir}/pkgconfig
66 sed -e "s#@version@#%{version}#g" \
67     -e "s#@dllpath@#%{dllpath}#g" \
68     -e "s#@dllname@#%{dllname}#g" \
69     %{SOURCE2} > %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
70
71 %post
72 gacutil -i %{dllpath}/%{dllname}
73
74 %files
75 %{dllpath}/%{dllname}
76
77 %files devel
78 %{_libdir}/pkgconfig/%{name}.pc