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