47c9ab41b2c9b76737c54a60b168d35f090d0461
[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.44
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(pkgmgr)
25 BuildRequires: pkgconfig(pkgmgr-info)
26 BuildRequires: python
27 BuildRequires: python-xml
28 BuildRequires: hash-signer
29
30 Requires(post):   /sbin/ldconfig
31 Requires(postun): /sbin/ldconfig
32 Requires:         %{name}-common = %{version}-%{release}
33
34
35 %description
36 Smartcard Service FW.
37
38
39 %files
40 %manifest %{name}.manifest
41 %defattr(-,root,root,-)
42 %{_libdir}/lib%{name}.so.*
43 %{_datadir}/license/%{name}
44
45
46 %post
47 /sbin/ldconfig
48
49
50 %postun
51 /sbin/ldconfig
52
53
54 ################################################################################
55 # package : smartcard-service-devel                                            #
56 ################################################################################
57 %package    devel
58 Summary:    smartcard service devel
59 Group:      Development/Libraries
60 Requires:   %{name} = %{version}-%{release}
61
62
63 %description devel
64 smartcard service.
65
66
67 %files  devel
68 %manifest %{name}-devel.manifest
69 %defattr(-,root,root,-)
70 %{_includedir}/%{name}/*
71 %{_libdir}/lib%{name}.so
72 %{_libdir}/pkgconfig/%{name}.pc
73
74
75 ################################################################################
76 # package : smartcard-service-common                                           #
77 ################################################################################
78 %package    common
79 Summary:    common smartcard service
80 Group:      Development/Libraries
81
82
83 %description common
84 common smartcard service.
85
86
87 %files common
88 %manifest %{name}-common.manifest
89 %defattr(-,root,root,-)
90 %{_libdir}/lib%{name}-common.so.*
91 %{_datadir}/license/%{name}-common
92
93
94 ################################################################################
95 # package : smartcard-service-common-devel                                     #
96 ################################################################################
97 %package    common-devel
98 Summary:    common smartcard service
99 Group:      Development/Libraries
100 Requires:   %{name}-common = %{version}-%{release}
101
102
103 %description common-devel
104 common smartcard service.
105
106
107 %files common-devel
108 %manifest %{name}-common-devel.manifest
109 %defattr(-,root,root,-)
110 %{_includedir}/%{name}-common/*
111 %{_libdir}/lib%{name}-common.so
112 %{_libdir}/pkgconfig/%{name}-common.pc
113
114
115 ################################################################################
116 # package : smartcard-service-server                                           #
117 ################################################################################
118 %global bindir /usr/apps/%{name}-server
119
120 %package          server
121 Summary:          server smartcard service
122 Group:            Development/Libraries
123 Requires:         %{name}-common = %{version}-%{release}
124
125
126 %description server
127 smartcard service server
128
129
130 %post server
131 /usr/bin/signing-client/hash-signer-client.sh -a -d -p platform %{bindir}
132 %if 0%{!?use_autostart:1}
133         ln -sf /etc/init.d/%{name}-server /etc/rc.d/rc3.d/S79%{name}-server
134         ln -sf /etc/init.d/%{name}-server /etc/rc.d/rc5.d/S79%{name}-server
135 %endif
136 ln -sf /usr/apps/%{name}-server/bin/smartcard-daemon /usr/bin/smartcard-daemon
137 %if 0%{?test_client:1}
138         ln -sf /usr/apps/%{name}-server/bin/smartcard-test-client /usr/bin/smartcard-test-client
139 %endif
140
141
142 %postun server
143 %if 0%{!?use_autostart:1}
144         rm -f /etc/rc.d/rc3.d/S79%{name}-server
145         rm -f /etc/rc.d/rc5.d/S79%{name}-server
146 %endif
147 rm -f /usr/bin/smartcard-daemon
148
149
150 %files server
151 %manifest %{name}-server.manifest
152 %defattr(-,root,root,-)
153 %{bindir}/bin/smartcard-daemon
154 %if 0%{?test_client:1}
155         %{bindir}/bin/smartcard-test-client
156 %endif
157 %if 0%{?use_autostart:1}
158         %{_datadir}/dbus-1/system-services/org.tizen.SmartcardService.service
159 %else
160         %{_sysconfdir}/init.d/%{name}-server
161 %endif
162 %{bindir}/%{name}-server
163 %{bindir}/author-signature.xml
164 %{bindir}/signature1.xml
165
166
167 ################################################################################
168 # common...                                                                    #
169 ################################################################################
170 %prep
171 %setup -q
172
173
174 %build
175 %if 0%{?sec_build_binary_debug_enable}
176 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
177 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
178 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
179 %endif
180 export LDFLAGS+="-Wl,-Bsymbolic-functions"
181 mkdir obj-arm-limux-qnueabi
182 cd obj-arm-limux-qnueabi
183 %cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} %{?use_autostart} %{?use_gdbus} %{?test_client}
184 #make %{?jobs:-j%jobs}
185
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