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