Fix build error : remove make command
[platform/core/connectivity/smartcard-service.git] / packaging / smartcard-service.spec
1 # FOR COMMENTING DEFINITION, MUST USE %% instead of %
2 %global use_autostart "-DUSE_AUTOSTART=1"
3 #%%global test_client "-DTEST_CLIENT=1"
4
5 ################################################################################
6 # package : smartcard-service                                                  #
7 ################################################################################
8 Name:       smartcard-service
9 Summary:    Smartcard Service FW
10 Version:    0.1.43
11 Release:    0
12 Group:      libs
13 License:    Apache-2.0
14 Source0:    %{name}-%{version}.tar.gz
15 %if 0%{!?use_autostart:1}
16 Source1:    %{name}-server.init
17 %endif
18 BuildRequires: cmake
19 BuildRequires: pkgconfig(glib-2.0)
20 BuildRequires: pkgconfig(gio-unix-2.0)
21 BuildRequires: pkgconfig(dlog)
22 BuildRequires: pkgconfig(aul)
23 BuildRequires: pkgconfig(libssl)
24 BuildRequires: pkgconfig(libcrypto)
25 BuildRequires: pkgconfig(pkgmgr)
26 BuildRequires: pkgconfig(pkgmgr-info)
27 BuildRequires: python
28 BuildRequires: python-xml
29 BuildRequires: hash-signer
30
31 Requires(post):   /sbin/ldconfig
32 Requires(postun): /sbin/ldconfig
33 Requires:         %{name}-common = %{version}-%{release}
34
35
36 %description
37 Smartcard Service FW.
38
39
40 %files
41 %manifest %{name}.manifest
42 %defattr(-,root,root,-)
43 %{_libdir}/lib%{name}.so.*
44 %{_datadir}/license/%{name}
45
46
47 %post
48 /sbin/ldconfig
49
50
51 %postun
52 /sbin/ldconfig
53
54
55 ################################################################################
56 # package : smartcard-service-devel                                            #
57 ################################################################################
58 %package    devel
59 Summary:    smartcard service devel
60 Group:      Development/Libraries
61 Requires:   %{name} = %{version}-%{release}
62
63
64 %description devel
65 smartcard service.
66
67
68 %files  devel
69 %manifest %{name}-devel.manifest
70 %defattr(-,root,root,-)
71 %{_includedir}/%{name}/*
72 %{_libdir}/lib%{name}.so
73 %{_libdir}/pkgconfig/%{name}.pc
74
75
76 ################################################################################
77 # package : smartcard-service-common                                           #
78 ################################################################################
79 %package    common
80 Summary:    common smartcard service
81 Group:      Development/Libraries
82
83
84 %description common
85 common smartcard service.
86
87
88 %files common
89 %manifest %{name}-common.manifest
90 %defattr(-,root,root,-)
91 %{_libdir}/lib%{name}-common.so.*
92 %{_datadir}/license/%{name}-common
93
94
95 ################################################################################
96 # package : smartcard-service-common-devel                                     #
97 ################################################################################
98 %package    common-devel
99 Summary:    common smartcard service
100 Group:      Development/Libraries
101 Requires:   %{name}-common = %{version}-%{release}
102
103
104 %description common-devel
105 common smartcard service.
106
107
108 %files common-devel
109 %manifest %{name}-common-devel.manifest
110 %defattr(-,root,root,-)
111 %{_includedir}/%{name}-common/*
112 %{_libdir}/lib%{name}-common.so
113 %{_libdir}/pkgconfig/%{name}-common.pc
114
115
116 ################################################################################
117 # package : smartcard-service-server                                           #
118 ################################################################################
119 %global bindir /usr/apps/%{name}-server
120
121 %package          server
122 Summary:          server smartcard service
123 Group:            Development/Libraries
124 Requires:         %{name}-common = %{version}-%{release}
125
126
127 %description server
128 smartcard service server
129
130
131 %post server
132 /usr/bin/signing-client/hash-signer-client.sh -a -d -p platform %{bindir}
133 %if 0%{!?use_autostart:1}
134         ln -sf /etc/init.d/%{name}-server /etc/rc.d/rc3.d/S79%{name}-server
135         ln -sf /etc/init.d/%{name}-server /etc/rc.d/rc5.d/S79%{name}-server
136 %endif
137 ln -sf /usr/apps/%{name}-server/bin/smartcard-daemon /usr/bin/smartcard-daemon
138 %if 0%{?test_client:1}
139         ln -sf /usr/apps/%{name}-server/bin/smartcard-test-client /usr/bin/smartcard-test-client
140 %endif
141
142
143 %postun server
144 %if 0%{!?use_autostart:1}
145         rm -f /etc/rc.d/rc3.d/S79%{name}-server
146         rm -f /etc/rc.d/rc5.d/S79%{name}-server
147 %endif
148 rm -f /usr/bin/smartcard-daemon
149
150
151 %files server
152 %manifest %{name}-server.manifest
153 %defattr(-,root,root,-)
154 %{bindir}/bin/smartcard-daemon
155 %{_datadir}/packages/%{name}-server.xml
156 %if 0%{?test_client:1}
157         %{bindir}/bin/smartcard-test-client
158 %endif
159 %if 0%{?use_autostart:1}
160         %{_datadir}/dbus-1/system-services/org.tizen.SmartcardService.service
161 %else
162         %{_sysconfdir}/init.d/%{name}-server
163 %endif
164 %{bindir}/%{name}-server
165 %{bindir}/author-signature.xml
166 %{bindir}/signature1.xml
167
168
169 ################################################################################
170 # common...                                                                    #
171 ################################################################################
172 %prep
173 %setup -q
174
175
176 %build
177 %if 0%{?sec_build_binary_debug_enable}
178 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
179 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
180 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
181 %endif
182 export LDFLAGS+="-Wl,-Bsymbolic-functions"
183 mkdir obj-arm-limux-qnueabi
184 cd obj-arm-limux-qnueabi
185 %cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} %{?use_autostart} %{?use_gdbus} %{?test_client}
186
187 %install
188 cd obj-arm-limux-qnueabi
189 %make_install
190 %if 0%{!?use_autostart:1}
191         %__mkdir -p  %{buildroot}/etc/init.d/
192         %__mkdir -p  %{buildroot}/etc/rc.d/rc3.d/
193         %__mkdir -p  %{buildroot}/etc/rc.d/rc5.d/
194         %__cp -af %SOURCE1 %{buildroot}/etc/init.d/%{name}-server
195         chmod 755 %{buildroot}/etc/init.d/%{name}-server
196 %endif
197 mkdir -p %{buildroot}/usr/share/license
198 cp -af %{_builddir}/%{name}-%{version}/packaging/%{name} %{buildroot}/usr/share/license/
199 cp -af %{_builddir}/%{name}-%{version}/packaging/%{name}-common %{buildroot}/usr/share/license/
200 cp -af %{_builddir}/%{name}-%{version}/packaging/%{name}-server %{buildroot}%{bindir}
201
202 %define tizen_sign 1
203 %define tizen_sign_base %{bindir}
204 %define tizen_sign_level platform
205 %define tizen_author_sign 1
206 %define tizen_dist_sign 1