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