53ca61e748c56aace076f34511b4d8ca65741d12
[platform/core/connectivity/nfc-manager-neard.git] / packaging / nfc-manager-neard.spec
1 %bcond_with wayland     1
2 %bcond_with x
3
4 Name:       nfc-manager-neard
5 Summary:    NFC framework manager
6 Version:    0.1.6
7 Release:    0
8 Group:      Network & Connectivity/NFC
9 License:    Flora
10 Source0:    %{name}-%{version}.tar.gz
11 Source1:    %{name}.service
12 Source1001: %{name}.manifest
13 Requires:   neard
14 Requires:   neardal
15 BuildRequires:  cmake
16 BuildRequires:  pkgconfig(aul)
17 BuildRequires:  pkgconfig(glib-2.0)
18 BuildRequires:  pkgconfig(gobject-2.0)
19 BuildRequires:  pkgconfig(security-server)
20 BuildRequires:  pkgconfig(vconf)
21 BuildRequires:  pkgconfig(dlog)
22 BuildRequires:  pkgconfig(tapi)
23 BuildRequires:  pkgconfig(bluetooth-api)
24 BuildRequires:  pkgconfig(capi-network-wifi)
25 BuildRequires:  pkgconfig(mm-sound)
26 BuildRequires:  pkgconfig(appsvc)
27 BuildRequires:  pkgconfig(svi)
28 BuildRequires:  pkgconfig(capi-media-wav-player)
29 BuildRequires:  pkgconfig(libssl)
30 BuildRequires:  pkgconfig(libcurl)
31 BuildRequires:  pkgconfig(pkgmgr)
32 BuildRequires:  pkgconfig(pkgmgr-info)
33 %if %{with x}
34 BuildRequires: pkgconfig(ecore-x)
35 %endif
36 %if %{with wayland}
37 BuildRequires: pkgconfig(ecore-wayland)
38 %endif
39 BuildRequires:  pkgconfig(pmapi)
40 BuildRequires:  pkgconfig(libtzplatform-config)
41 BuildRequires:  pkgconfig(neardal)
42 BuildRequires:  python
43 BuildRequires:  python-xml
44 BuildRequires:  gettext-tools
45 %ifarch %arm
46 BuildRequires:  pkgconfig(wifi-direct)
47 %global ARM_DEF "-DARM_TARGET=Y"
48 %endif
49
50 Requires(post):   /sbin/ldconfig
51 Requires(post):   /usr/bin/vconftool
52 Requires(postun): /sbin/ldconfig
53 Requires:         nfc-client-lib-neard = %{version}
54
55
56 %description
57 Tizen NFC framework manager.
58
59
60 %prep
61 %setup -q
62 cp %{SOURCE1001} .
63
64
65 %package -n nfc-common-neard-devel
66 Summary:    NFC common library (devel)
67 Group:      Network & Connectivity/Development
68
69
70 %description -n nfc-common-neard-devel
71 NFC manager common header for internal development.
72
73
74 %package -n nfc-client-lib-neard
75 Summary:    NFC client library
76 Group:      Network & Connectivity/NFC
77
78
79 %description -n nfc-client-lib-neard
80 NFC manager Client library for NFC client applications.
81
82
83 %package -n nfc-client-lib-neard-devel
84 Summary:    NFC client library (devel)
85 Group:      Network & Connectivity/Development
86 Requires:   nfc-client-lib-neard = %{version}
87
88
89 %description -n nfc-client-lib-neard-devel
90 NFC manager Client library for developing NFC client applications.
91
92
93
94 #%%package -n nfc-client-test
95 #Summary:    NFC client test
96 #Group:      Network & Connectivity/NFC
97 #Requires:   %%{name} = %%{version}
98
99
100 #%%description -n nfc-client-test
101 #NFC client test (devel)
102
103
104 %build
105 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
106 %cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} %{?ARM_DEF} \
107 %if %{with wayland}
108 -DWAYLAND_SUPPORT=On \
109 %else
110 -DWAYLAND_SUPPORT=Off \
111 %endif
112 %if %{with x}
113 -DX11_SUPPORT=On
114 %else
115 -DX11_SUPPORT=Off
116 %endif
117
118
119 %install
120 %make_install
121
122 install -d %{buildroot}%{_unitdir}
123 install -d %{buildroot}%{_unitdir}/multi-user.target.wants/
124 install -m 644 %{S:1} %{buildroot}%{_unitdir}/%{name}.service
125 ln -s ../%{name}.service %{buildroot}%{_unitdir}/multi-user.target.wants/%{name}.service
126
127 %post
128 /sbin/ldconfig
129
130 systemctl daemon-reload
131 if [ $1 == 1 ]; then
132     systemctl restart %{name}.service
133 fi
134
135
136 %post -n nfc-client-lib-neard
137 /sbin/ldconfig
138 USER_GROUP_ID=$(getent group %{TZ_SYS_USER_GROUP} | cut -d: -f3)
139 vconftool set -t bool db/nfc/feature 0 -g $USER_GROUP_ID -f
140 vconftool set -t bool db/nfc/predefined_item_state 0 -g $USER_GROUP_ID -f
141 vconftool set -t string db/nfc/predefined_item "None" -g $USER_GROUP_ID -f
142 vconftool set -t bool db/nfc/enable 0 -g $USER_GROUP_ID -f
143 vconftool set -t int db/nfc/se_type 0 -g $USER_GROUP_ID -f
144
145 %postun
146 /sbin/ldconfig
147 if [ $1 == 0 ]; then
148     systemctl stop %{name}.service
149 fi
150 systemctl daemon-reload
151
152
153 %postun -n nfc-client-lib-neard -p /sbin/ldconfig
154
155
156 %files
157 %manifest %{name}.manifest
158 %defattr(-,root,root,-)
159 %{_bindir}/nfc-manager-daemon
160 #%%{_bindir}/ndef-tool
161 %{_unitdir}/%{name}.service
162 %{_unitdir}/multi-user.target.wants/%{name}.service
163 %{_datadir}/dbus-1/system-services/org.tizen.NetNfcService.service
164 %{_datadir}/packages/nfc-manager.xml
165 %{_datadir}/nfc-manager-daemon/sounds/*
166 %license LICENSE.Flora
167
168
169 %files -n nfc-client-lib-neard
170 %manifest %{name}.manifest
171 %defattr(-,root,root,-)
172 %{_libdir}/libnfc.so.*
173 %license LICENSE.Flora
174
175
176 %files -n nfc-client-lib-neard-devel
177 %defattr(-,root,root,-)
178 %{_libdir}/libnfc.so
179 %{_libdir}/pkgconfig/nfc.pc
180 %{_includedir}/nfc/*.h
181
182
183 %files -n nfc-common-neard-devel
184 %defattr(-,root,root,-)
185 %{_libdir}/pkgconfig/nfc-common.pc
186 %{_includedir}/nfc-common/*.h
187
188
189 #%%files -n nfc-client-test
190 #%%manifest nfc-client-test.manifest
191 #%%defattr(-,root,root,-)
192 #%%{_bindir}/nfc_client
193 #%%license LICENSE.Flora