4f58804b8bc208e038b1ac34a83b6e5a6147feb3
[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 = %{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 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
123 cp -af %{SOURCE1} %{buildroot}%{_libdir}/systemd/system/
124 ln -s ../%{name}.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/%{name}.service
125
126 %post
127 /sbin/ldconfig
128
129 systemctl daemon-reload
130 if [ $1 == 1 ]; then
131     systemctl restart %{name}.service
132 fi
133
134
135 %post -n nfc-client-lib-neard
136 /sbin/ldconfig
137 USER_GROUP_ID=$(getent group %{TZ_SYS_USER_GROUP} | cut -d: -f3)
138 vconftool set -t bool db/nfc/feature 0 -g $USER_GROUP_ID -f
139 vconftool set -t bool db/nfc/predefined_item_state 0 -g $USER_GROUP_ID -f
140 vconftool set -t string db/nfc/predefined_item "None" -g $USER_GROUP_ID -f
141 vconftool set -t bool db/nfc/enable 0 -g $USER_GROUP_ID -f
142 vconftool set -t int db/nfc/se_type 0 -g $USER_GROUP_ID -f
143
144 %postun
145 /sbin/ldconfig
146 if [ $1 == 0 ]; then
147     systemctl stop %{name}.service
148 fi
149 systemctl daemon-reload
150
151
152 %postun -n nfc-client-lib-neard -p /sbin/ldconfig
153
154
155 %files
156 %manifest %{name}.manifest
157 %defattr(-,root,root,-)
158 %{_bindir}/nfc-manager-daemon
159 #%%{_bindir}/ndef-tool
160 %{_libdir}/systemd/system/%{name}.service
161 %{_libdir}/systemd/system/multi-user.target.wants/%{name}.service
162 %{_datadir}/dbus-1/system-services/org.tizen.NetNfcService.service
163 %{_datadir}/packages/nfc-manager.xml
164 %{_datadir}/nfc-manager-daemon/sounds/*
165 %license LICENSE.Flora
166
167
168 %files -n nfc-client-lib-neard
169 %manifest %{name}.manifest
170 %defattr(-,root,root,-)
171 %{_libdir}/libnfc.so.*
172 %license LICENSE.Flora
173
174
175 %files -n nfc-client-lib-neard-devel
176 %defattr(-,root,root,-)
177 %{_libdir}/libnfc.so
178 %{_libdir}/pkgconfig/nfc.pc
179 %{_includedir}/nfc/*.h
180
181
182 %files -n nfc-common-neard-devel
183 %defattr(-,root,root,-)
184 %{_libdir}/pkgconfig/nfc-common.pc
185 %{_includedir}/nfc-common/*.h
186
187
188 #%%files -n nfc-client-test
189 #%%manifest nfc-client-test.manifest
190 #%%defattr(-,root,root,-)
191 #%%{_bindir}/nfc_client
192 #%%license LICENSE.Flora