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