c3313e4b7b7ed6d5413bc0c32381b45edfd7f4bf
[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: pkgconfig(glib-2.0)
17 BuildRequires: pkgconfig(gio-unix-2.0)
18 BuildRequires: pkgconfig(security-server)
19 BuildRequires: pkgconfig(dlog)
20 BuildRequires: pkgconfig(vconf)
21 BuildRequires: pkgconfig(aul)
22 BuildRequires: pkgconfig(libssl)
23 BuildRequires: pkgconfig(dbus-glib-1)
24 BuildRequires: pkgconfig(pkgmgr)
25 BuildRequires: pkgconfig(pkgmgr-info)
26 BuildRequires: cmake
27 BuildRequires: python
28 BuildRequires: python-xml
29 BuildRequires: gettext-tools
30
31 Requires(post):   /sbin/ldconfig
32 Requires(post):   /usr/bin/vconftool
33 requires(postun): /sbin/ldconfig
34
35 %description
36 Smartcard Service FW.
37
38 %prep
39 %setup -q
40
41 %package    devel
42 Summary:    smartcard service
43 Group:      Development/Libraries
44 Requires:   %{name} = %{version}-%{release}
45
46 %description devel
47 smartcard service.
48
49 %package -n smartcard-service-common
50 Summary:    common smartcard service
51 Group:      Development/Libraries
52 Requires:   %{name} = %{version}-%{release}
53
54 %description -n smartcard-service-common
55 common smartcard service.
56
57 %package -n smartcard-service-common-devel
58 Summary:    common smartcard service
59 Group:      Development/Libraries
60 Requires:   %{name} = %{version}-%{release}
61 Requires:   smartcard-service-common = %{version}-%{release}
62
63 %description -n smartcard-service-common-devel
64 common smartcard service.
65
66 %package -n smartcard-service-server
67 Summary:    server smartcard service
68 Group:      Development/Libraries
69 Requires:   %{name} = %{version}-%{release}
70
71 %description -n smartcard-service-server
72 smartcard service.
73
74 %build
75 mkdir obj-arm-limux-qnueabi
76 cd obj-arm-limux-qnueabi
77 %cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} %{?use_autostart} %{?use_gdbus} %{?test_client}
78 #make %{?jobs:-j%jobs}
79
80 %install
81 cd obj-arm-limux-qnueabi
82 %make_install
83 %if 0%{!?use_autostart:1}
84         %__mkdir -p  %{buildroot}/etc/init.d/
85         %__mkdir -p  %{buildroot}/etc/rc.d/rc3.d/
86         %__mkdir -p  %{buildroot}/etc/rc.d/rc5.d/
87         %__cp -af %SOURCE1 %{buildroot}/etc/init.d/smartcard-service-server
88         chmod 755 %{buildroot}/etc/init.d/smartcard-service-server
89 %endif
90 mkdir -p %{buildroot}/usr/share/license
91 cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service %{buildroot}/usr/share/license/
92 cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-common %{buildroot}/usr/share/license/
93 cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-server %{buildroot}/usr/share/license/
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 %files
110 %manifest smartcard-service.manifest
111 %defattr(-,root,root,-)
112 %{_libdir}/libsmartcard-service.so.*
113 /usr/share/license/smartcard-service
114
115 %files  devel
116 %manifest smartcard-service-devel.manifest
117 %defattr(-,root,root,-)
118 %{_includedir}/smartcard-service/*
119 %{_libdir}/libsmartcard-service.so
120 %{_libdir}/pkgconfig/smartcard-service.pc
121
122 %files -n smartcard-service-common
123 %manifest smartcard-service-common.manifest
124 %defattr(-,root,root,-)
125 %{_libdir}/libsmartcard-service-common.so.*
126 /usr/share/license/smartcard-service-common
127
128 %files -n smartcard-service-common-devel
129 %manifest smartcard-service-common-devel.manifest
130 %defattr(-,root,root,-)
131 %{_includedir}/smartcard-service-common/*
132 %{_libdir}/libsmartcard-service-common.so
133 %{_libdir}/pkgconfig/smartcard-service-common.pc
134
135 %files -n smartcard-service-server
136 %manifest smartcard-service-server.manifest
137 %defattr(-,root,root,-)
138 %{_bindir}/smartcard-daemon
139 %if 0%{?test_client:1}
140         /usr/bin/smartcard-test-client
141 %endif
142 %if 0%{?use_autostart:1}
143         /usr/share/dbus-1/services/org.tizen.smartcard_service.service
144 %else
145         /etc/init.d/smartcard-service-server
146 %endif
147 /usr/share/license/smartcard-service-server