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