e90992e20df7d3e6dbdc6184aba7bfa4445cc4a0
[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 use_gdbus "-DUSE_GDBUS=1"
4 %global test_client "-DTEST_CLIENT=1"
5
6 Name:       smartcard-service
7 Summary:    Smartcard Service FW
8 Version:    0.1.20
9 Release:    0
10 Group:      libs
11 License:    Apache-2.0
12 Source0:    %{name}-%{version}.tar.gz
13 %if 0%{!?use_autostart:1}
14 Source1:    smartcard-service-server.init
15 %endif
16 BuildRequires: cmake
17 BuildRequires: pkgconfig(glib-2.0)
18 BuildRequires: pkgconfig(gio-unix-2.0)
19 BuildRequires: pkgconfig(security-server)
20 BuildRequires: pkgconfig(dlog)
21 BuildRequires: pkgconfig(vconf)
22 BuildRequires: pkgconfig(aul)
23 BuildRequires: pkgconfig(libssl)
24 BuildRequires: pkgconfig(pkgmgr)
25 BuildRequires: pkgconfig(pkgmgr-info)
26 %if 0%{!?use_gdbus:1}
27 BuildRequires: pkgconfig(dbus-glib-1)
28 %endif
29 # for gdbus
30 BuildRequires: python
31 BuildRequires: python-xml
32
33 Requires(post):   /sbin/ldconfig
34 Requires(postun): /sbin/ldconfig
35 Requires:         smartcard-service-common = %{version}-%{release}
36
37
38 %description
39 Smartcard Service FW.
40
41
42 %prep
43 %setup -q
44
45
46 %package    devel
47 Summary:    smartcard service
48 Group:      Development/Libraries
49 Requires:   %{name} = %{version}-%{release}
50
51
52 %description devel
53 smartcard service.
54
55
56 %package -n smartcard-service-common
57 Summary:    common smartcard service
58 Group:      Development/Libraries
59
60
61 %description -n smartcard-service-common
62 common smartcard service.
63
64
65 %package -n smartcard-service-common-devel
66 Summary:    common smartcard service
67 Group:      Development/Libraries
68 Requires:   smartcard-service-common = %{version}-%{release}
69
70
71 %description -n smartcard-service-common-devel
72 common smartcard service.
73
74
75 %package -n smartcard-service-server
76 Summary:    server smartcard service
77 Group:      Development/Libraries
78 Requires:   smartcard-service-common = %{version}-%{release}
79
80
81 %description -n smartcard-service-server
82 smartcard service.
83
84
85 %build
86 mkdir obj-arm-limux-qnueabi
87 cd obj-arm-limux-qnueabi
88 %cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} %{?use_autostart} %{?use_gdbus} %{?test_client}
89 #make %{?jobs:-j%jobs}
90
91
92 %install
93 cd obj-arm-limux-qnueabi
94 %make_install
95 %if 0%{!?use_autostart:1}
96         %__mkdir -p  %{buildroot}/etc/init.d/
97         %__mkdir -p  %{buildroot}/etc/rc.d/rc3.d/
98         %__mkdir -p  %{buildroot}/etc/rc.d/rc5.d/
99         %__cp -af %SOURCE1 %{buildroot}/etc/init.d/smartcard-service-server
100         chmod 755 %{buildroot}/etc/init.d/smartcard-service-server
101 %endif
102 mkdir -p %{buildroot}/usr/share/license
103 cp -af %{_builddir}/%{name}-%{version}/packaging/%{name} %{buildroot}/usr/share/license/
104 cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-common %{buildroot}/usr/share/license/
105 cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-server %{buildroot}/usr/share/license/
106
107
108 %post
109 /sbin/ldconfig
110 %if 0%{!?use_autostart:1}
111         ln -sf /etc/init.d/smartcard-service-server /etc/rc.d/rc3.d/S79smartcard-service-server
112         ln -sf /etc/init.d/smartcard-service-server /etc/rc.d/rc5.d/S79smartcard-service-server
113 %endif
114
115
116 %postun
117 /sbin/ldconfig
118 %if 0%{!?use_autostart:1}
119         rm -f /etc/rc.d/rc3.d/S79smartcard-service-server
120         rm -f /etc/rc.d/rc5.d/S79smartcard-service-server
121 %endif
122
123
124 %files
125 %manifest %{name}.manifest
126 %defattr(-,root,root,-)
127 %{_libdir}/libsmartcard-service.so.*
128 %{_datadir}/license/%{name}
129
130
131 %files  devel
132 %manifest smartcard-service-devel.manifest
133 %defattr(-,root,root,-)
134 %{_includedir}/%{name}/*
135 %{_libdir}/libsmartcard-service.so
136 %{_libdir}/pkgconfig/%{name}.pc
137
138
139 %files -n smartcard-service-common
140 %manifest smartcard-service-common.manifest
141 %defattr(-,root,root,-)
142 %{_libdir}/libsmartcard-service-common.so.*
143 %{_datadir}/license/smartcard-service-common
144
145
146 %files -n smartcard-service-common-devel
147 %manifest smartcard-service-common-devel.manifest
148 %defattr(-,root,root,-)
149 %{_includedir}/smartcard-service-common/*
150 %{_libdir}/libsmartcard-service-common.so
151 %{_libdir}/pkgconfig/smartcard-service-common.pc
152
153
154 %files -n smartcard-service-server
155 %manifest smartcard-service-server.manifest
156 %defattr(-,root,root,-)
157 %{_bindir}/smartcard-daemon
158 %{_datadir}/packages/smartcard-service-server.xml
159 %if 0%{?test_client:1}
160         %{_bindir}/smartcard-test-client
161 %endif
162 %if 0%{?use_autostart:1}
163         %{_datadir}/dbus-1/services/org.tizen.smartcard_service.service
164 %else
165         %{_sysconfdir}/init.d/smartcard-service-server
166 %endif
167 %{_datadir}/license/smartcard-service-server