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