61fe46dd18a47fb35d96cf4a0c58cbb33ed9f33a
[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 %global bindir /usr/apps/%{name}
5
6 ################################################################################
7 # package : smartcard-service                                                  #
8 ################################################################################
9 Name:       smartcard-service
10 Summary:    Smartcard Service FW
11 Version:    0.1.56
12 Release:    0
13 Group:      Network & Connectivity
14 Requires:   %{name}-common = %{version}-%{release}
15 License:    Apache-2.0
16 Source0:    %{name}-%{version}.tar.gz
17 %if 0%{!?use_autostart:1}
18 Source1:    %{name}.init
19 %endif
20 BuildRequires: cmake
21 BuildRequires: pkgconfig(glib-2.0)
22 BuildRequires: pkgconfig(gio-unix-2.0)
23 BuildRequires: pkgconfig(dlog)
24 BuildRequires: pkgconfig(aul)
25 BuildRequires: pkgconfig(libssl)
26 BuildRequires: pkgconfig(libcrypto)
27 BuildRequires: pkgconfig(pkgmgr)
28 BuildRequires: pkgconfig(pkgmgr-info)
29 BuildRequires: pkgconfig(cynara-client)
30 BuildRequires: pkgconfig(cynara-creds-gdbus)
31 BuildRequires: pkgconfig(cynara-session)
32 BuildRequires: pkgconfig(capi-system-info)
33
34 BuildRequires: python
35 BuildRequires: python-xml
36 BuildRequires: hash-signer
37
38 Requires(post):   /sbin/ldconfig
39 Requires(postun): /sbin/ldconfig
40 Requires:         %{name}-common = %{version}-%{release}
41 Requires: security-config
42
43 %if 0%{?gtests:1}
44 BuildRequires:  pkgconfig(gmock)
45 %endif
46
47 %description
48 Smartcard Service FW.
49
50
51 %files
52 %manifest %{name}.manifest
53 %license LICENSE.APLv2
54 %defattr(-,root,root,-)
55 %{bindir}/bin/smartcard-daemon
56 %if 0%{?test_client:1}
57         %{bindir}/bin/smartcard-test-client
58 %endif
59 %if 0%{?use_autostart:1}
60         %{_datadir}/dbus-1/system-services/org.tizen.SmartcardService.service
61 %else
62         %{_sysconfdir}/init.d/%{name}
63 %endif
64 %{bindir}/%{name}
65 %{bindir}/author-signature.xml
66 %{bindir}/signature1.xml
67 /etc/dbus-1/system.d/org.tizen.SmartcardService.conf
68 %if 0%{?gtests:1}
69 %{_bindir}/gtest*
70 %endif
71
72 %post
73 /usr/bin/signing-client/hash-signer-client.sh -a -d -p platform %{bindir}
74 %if 0%{!?use_autostart:1}
75         ln -sf /etc/init.d/%{name} /etc/rc.d/rc3.d/S79%{name}
76         ln -sf /etc/init.d/%{name} /etc/rc.d/rc5.d/S79%{name}
77 %endif
78 ln -sf /usr/apps/%{name}/bin/smartcard-daemon /usr/bin/smartcard-daemon
79 %if 0%{?test_client:1}
80         ln -sf /usr/apps/%{name}/bin/smartcard-test-client /usr/bin/smartcard-test-client
81 %endif
82
83 %postun
84 %if 0%{!?use_autostart:1}
85         rm -f /etc/rc.d/rc3.d/S79%{name}
86         rm -f /etc/rc.d/rc5.d/S79%{name}
87 %endif
88 rm -f /usr/bin/smartcard-daemon
89
90
91 ################################################################################
92 # package : smartcard-service-common                                           #
93 ################################################################################
94 %package    common
95 Summary:    common smartcard service
96 Group:      Development/Libraries
97
98
99 %description common
100 common smartcard service.
101
102
103 %files common
104 %manifest %{name}-common.manifest
105 %license LICENSE.APLv2
106 %defattr(-,root,root,-)
107 %{_libdir}/lib%{name}-common.so.*
108
109
110 ################################################################################
111 # package : smartcard-service-common-devel                                     #
112 ################################################################################
113 %package    common-devel
114 Summary:    common smartcard service
115 Group:      Development/Libraries
116 Requires:   %{name}-common = %{version}-%{release}
117
118
119 %description common-devel
120 common smartcard service.
121
122
123 %files common-devel
124 %manifest %{name}-common-devel.manifest
125 %defattr(-,root,root,-)
126 %{_includedir}/%{name}-common/*
127 %{_libdir}/lib%{name}-common.so
128 %{_libdir}/pkgconfig/%{name}-common.pc
129
130 ###
131
132 ################################################################################
133 # common...                                                                    #
134 ################################################################################
135 %prep
136 %setup -q
137
138
139 %build
140 %if 0%{?gcov:1}
141 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
142 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
143 export LDFLAGS+=" -lgcov "
144 %endif
145
146 %if 0%{?sec_build_binary_debug_enable}
147 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
148 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
149 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
150 %endif
151 export LDFLAGS+="-Wl,-Bsymbolic-functions"
152
153
154 mkdir obj-arm-limux-qnueabi
155 cd obj-arm-limux-qnueabi
156 %cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} %{?use_autostart} %{?use_gdbus} %{?test_client} \
157                                         -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
158                                         -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
159
160 %install
161 cd obj-arm-limux-qnueabi
162 %make_install
163 %if 0%{!?use_autostart:1}
164         %__mkdir -p  %{buildroot}/etc/init.d/
165         %__mkdir -p  %{buildroot}/etc/rc.d/rc3.d/
166         %__mkdir -p  %{buildroot}/etc/rc.d/rc5.d/
167         %__cp -af %SOURCE1 %{buildroot}/etc/init.d/%{name}
168         chmod 755 %{buildroot}/etc/init.d/%{name}
169 %endif
170
171 mkdir -p %{buildroot}/etc/dbus-1/system.d/
172 cp -af %{_builddir}/%{name}-%{version}/packaging/%{name} %{buildroot}%{bindir}
173 cp -af %{_builddir}/%{name}-%{version}/packaging/org.tizen.SmartcardService.conf %{buildroot}/etc/dbus-1/system.d/
174
175 %define tizen_sign 1
176 %define tizen_sign_base %{bindir}
177 %define tizen_sign_level platform
178 %define tizen_author_sign 1
179 %define tizen_dist_sign 1