bf21ac6eeedc6c74c64619f961e263994138199c
[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
7 Version:    0.1.29
8 Release:    0
9 Group:      Network & Connectivity/Service
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 Source1001:     %{name}.manifest
17 Source1002:     %{name}-devel.manifest
18 Source1003:     smartcard-service-common.manifest
19 Source1004:     smartcard-service-common-devel.manifest
20 Source1005:     smartcard-service-server.manifest
21 BuildRequires: pkgconfig(glib-2.0)
22 BuildRequires: pkgconfig(gio-unix-2.0)
23 BuildRequires: pkgconfig(security-server)
24 BuildRequires: pkgconfig(dlog)
25 BuildRequires: pkgconfig(aul)
26 BuildRequires: pkgconfig(libssl)
27 BuildRequires: pkgconfig(pkgmgr)
28 BuildRequires: pkgconfig(pkgmgr-info)
29 BuildRequires: python
30 BuildRequires: python-xml
31
32 Requires(post):   /sbin/ldconfig
33 Requires(postun): /sbin/ldconfig
34 Requires:         smartcard-service-common = %{version}-%{release}
35
36
37 %description
38 A library for Smartcard applications.
39
40
41 %prep
42 %setup -q
43 cp %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} %{SOURCE1004} %{SOURCE1005} .
44
45
46 %package    devel
47 Summary:    Smartcard service
48 Group:      Network & Connectivity/Development
49 Requires:   %{name} = %{version}-%{release}
50
51 %description devel
52 For developing Smartcard applications.
53
54
55 %package -n smartcard-service-common
56 Summary:    Common smartcard service
57 Group:      Network & Connectivity/Service
58
59 %description -n smartcard-service-common
60 Common smartcard service for developing internally
61
62
63 %package -n smartcard-service-common-devel
64 Summary:    Common smartcard service
65 Group:      Network & Connectivity/Development
66 Requires:   smartcard-service-common = %{version}-%{release}
67
68 %description -n smartcard-service-common-devel
69 For developing smartcard services internally.
70
71
72 %package -n smartcard-service-server
73 Summary:    Smartcard service server
74 Group:      Network & Connectivity/Service
75 Requires:   smartcard-service-common = %{version}-%{release}
76
77 %description -n smartcard-service-server
78 Server for smartcard service
79
80
81 %build
82 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
83 %cmake . %{?use_autostart} %{?test_client} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
84
85 %install
86 %make_install
87 %if 0%{!?use_autostart:1}
88         %__mkdir -p  %{buildroot}/etc/init.d/
89         %__mkdir -p  %{buildroot}/etc/rc.d/rc3.d/
90         %__mkdir -p  %{buildroot}/etc/rc.d/rc5.d/
91         %__cp -af %SOURCE1 %{buildroot}/etc/init.d/smartcard-service-server
92         chmod 755 %{buildroot}/etc/init.d/smartcard-service-server
93 %endif
94
95 %post
96 /sbin/ldconfig
97 %if 0%{!?use_autostart:1}
98         ln -sf /etc/init.d/smartcard-service-server /etc/rc.d/rc3.d/S79smartcard-service-server
99         ln -sf /etc/init.d/smartcard-service-server /etc/rc.d/rc5.d/S79smartcard-service-server
100 %endif
101
102 %postun
103 /sbin/ldconfig
104 %if 0%{!?use_autostart:1}
105         rm -f /etc/rc.d/rc3.d/S79smartcard-service-server
106         rm -f /etc/rc.d/rc5.d/S79smartcard-service-server
107 %endif
108
109 %post -n smartcard-service-common
110 /sbin/ldconfig
111
112 %postun -n smartcard-service-common
113 /sbin/ldconfig
114
115
116 %files
117 %manifest %{name}.manifest
118 %defattr(-,root,root,-)
119 %{_libdir}/libsmartcard-service.so.*
120 %license LICENSE.APLv2
121
122
123 %files  devel
124 %manifest smartcard-service-devel.manifest
125 %defattr(-,root,root,-)
126 %{_includedir}/%{name}/*
127 %{_libdir}/libsmartcard-service.so
128 %{_libdir}/pkgconfig/%{name}.pc
129
130
131 %files -n smartcard-service-common
132 %manifest smartcard-service-common.manifest
133 %defattr(-,root,root,-)
134 %{_libdir}/libsmartcard-service-common.so.*
135 %license LICENSE.APLv2
136
137
138 %files -n smartcard-service-common-devel
139 %manifest smartcard-service-common-devel.manifest
140 %defattr(-,root,root,-)
141 %{_includedir}/smartcard-service-common/*
142 %{_libdir}/libsmartcard-service-common.so
143 %{_libdir}/pkgconfig/smartcard-service-common.pc
144
145
146 %files -n smartcard-service-server
147 %manifest smartcard-service-server.manifest
148 %defattr(-,root,root,-)
149 %{_bindir}/smartcard-daemon
150 %{_datadir}/packages/smartcard-service-server.xml
151 %if 0%{?test_client:1}
152         %{_bindir}/smartcard-test-client
153 %endif
154 %if 0%{?use_autostart:1}
155         %{_datadir}/dbus-1/system-services/org.tizen.smartcard_service.service
156 %else
157         %{_sysconfdir}/init.d/smartcard-service-server
158 %endif
159 %license LICENSE.APLv2