9588fcd04050bdf675574f279c697626eb157401
[platform/framework/web/wrt-security.git] / packaging / wrt-security.spec
1 #sbs-git:slp/pkgs/s/security-server security-server 0.0.37
2 Name:       wrt-security
3 Summary:    Wrt security daemon
4 Version:    0.0.67
5 Release:    0
6 Group:      Security/Access Control
7 License:    Apache-2.0
8 URL:        N/A
9 Source0:    %{name}-%{version}.tar.gz
10 Source1001: %{name}.manifest
11 BuildRequires: cmake
12 BuildRequires: zip
13 BuildRequires: pkgconfig(dlog)
14 BuildRequires: pkgconfig(openssl)
15 BuildRequires: libattr-devel
16 BuildRequires: pkgconfig(libsmack)
17 BuildRequires: pkgconfig(dbus-1)
18 BuildRequires: pkgconfig(dpl-efl)
19 BuildRequires: pkgconfig(dpl-utils-efl)
20 BuildRequires: pkgconfig(dpl-dbus-efl)
21 BuildRequires: pkgconfig(libpcrecpp)
22 BuildRequires: pkgconfig(icu-i18n)
23 BuildRequires: pkgconfig(libsoup-2.4)
24 BuildRequires: pkgconfig(xmlsec1)
25 BuildRequires: pkgconfig(capi-appfw-app-manager)
26 BuildRequires: pkgconfig(capi-appfw-package-manager)
27 BuildRequires: pkgconfig(privacy-manager-client)
28 BuildRequires: pkgconfig(privacy-manager-server)
29 BuildRequires: pkgconfig(capi-security-privacy-manager)
30 BuildRequires: pkgconfig(dpl-wrt-dao-ro)
31 BuildRequires: pkgconfig(libsystemd-daemon)
32 BuildRequires:  pkgconfig(libtzplatform-config)
33 Requires: libtzplatform-config
34 %{?systemd_requires}
35
36 %description
37 Wrt security daemon and utilities.
38
39 %package -n wrt-security-devel
40 Summary:    Header files for client libraries
41 Group:      Development/Libraries
42 Requires:   wrt-security = %{version}-%{release}
43
44 %description -n wrt-security-devel
45 Developer files for client libraries.
46
47 %package -n security-server-certs
48 Summary:    Certificates for web applications
49 Group:      Development/Libraries
50 Requires:   security-server
51
52 %description -n security-server-certs
53 Certificates for wrt.
54
55 %prep
56 %setup -q
57 cp %{SOURCE1001} .
58
59 %build
60 export LDFLAGS+="-Wl,--rpath=%{_libdir}"
61
62 %cmake . -DDPL_LOG="ON" \
63         -DVERSION=%{version} \
64         -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}
65 make %{?jobs:-j%jobs}
66
67
68 %install
69 rm -rf %{buildroot}
70 mkdir -p %{buildroot}/usr/share/license
71 cp LICENSE %{buildroot}/usr/share/license/%{name}
72
73 %make_install
74 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
75 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
76 ln -sf %{_unitdir}/wrt-security-daemon.service %{buildroot}%{_unitdir}/multi-user.target.wants/wrt-security-daemon.service
77 ln -sf %{_unitdir}/wrt-security-daemon.socket  %{buildroot}%{_unitdir}/sockets.target.wants/wrt-security-daemon.socket
78
79 %clean
80 rm -rf %{buildroot}
81
82 %post
83 if [ ! -e %TZ_SYS_DB"/.ace.db" ]; then
84     echo "This is new install of wrt-security"
85     echo "Calling /usr/bin/wrt_security_create_clean_db.sh"
86     %{_bindir}/wrt_security_create_clean_db.sh
87 else
88     # Find out old and new version of databases
89     ACE_OLD_DB_VERSION=`sqlite3 %TZ_SYS_DB/.ace.db ".tables" | grep "DB_VERSION_"`
90     ACE_NEW_DB_VERSION=`cat %TZ_SYS_RO_WRT_ENGINE/ace_db.sql | tr '[:blank:]' '\n' | grep DB_VERSION_`
91     echo "OLD ace database version ${ACE_OLD_DB_VERSION}"
92     echo "NEW ace database version ${ACE_NEW_DB_VERSION}"
93
94     if [ ${ACE_OLD_DB_VERSION} -a ${ACE_NEW_DB_VERSION} ]
95     then
96         if [ ${ACE_NEW_DB_VERSION} = ${ACE_OLD_DB_VERSION} ]
97         then
98             echo "Equal database detected so db installation ignored"
99         else
100             echo "Calling /usr/bin/wrt_security_create_clean_db.sh"
101             %{_bindir}/wrt_security_create_clean_db.sh
102         fi
103     else
104         echo "Calling /usr/bin/wrt_security_create_clean_db.sh"
105         %{_bindir}/wrt_security_create_clean_db.sh
106     fi
107 fi
108
109 /sbin/ldconfig
110 echo "[WRT] wrt-security postinst done ..."
111
112 %postun
113 /sbin/ldconfig
114
115 %files -n wrt-security
116 %manifest %{name}.manifest
117 %defattr(-,root,root,-)
118 %attr(755,root,root) %{_bindir}/wrt-security-daemon
119 %{_libdir}/libace*.so
120 %{_libdir}/libace*.so.*
121 %{_libdir}/libwrt-ocsp.so
122 %{_libdir}/libwrt-ocsp.so.*
123 /usr/share/wrt-engine/*
124 %attr(755,root,root) %{_bindir}/wrt_security_create_clean_db.sh
125 %attr(755,root,root) %{_bindir}/wrt_security_change_policy.sh
126 %attr(664,root,root) %{_datadir}/dbus-1/system-services/*
127 %attr(664,root,root) %TZ_SYS_ACE_CONF/bondixml*
128 %attr(664,root,root) %TZ_SYS_ACE_CONF/UnrestrictedPolicy.xml
129 %attr(664,root,root) %TZ_SYS_ACE_CONF/WAC2.0Policy.xml
130 %attr(664,root,root) %TZ_SYS_ACE_CONF/TizenPolicy.xml
131 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/wac/wac.publisherid.pem
132 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen.root.preproduction.cert.pem
133 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/wac/wac.root.production.pem
134 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/wac/wac.root.preproduction.pem
135 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-developer-root-ca.pem
136 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-distributor-root-ca-partner.pem
137 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-distributor-root-ca-public.pem
138 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-distributor-root-ca-partner-manufacturer.pem
139 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-distributor-root-ca-partner-operator.pem
140 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-developers-root.pem
141 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-partner-class-developer-root.pem
142 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-partner-class-root-authority.pem
143 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-platform-class-developer-root.pem
144 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-platform-class-root-authority.pem
145 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-public-class-developer-root.pem
146 %attr(664,root,root) %TZ_SYS_SHARE/cert-svc/certs/code-signing/tizen/tizen-public-class-root-authority.pem
147 %{_datadir}/license/%{name}
148 %{_unitdir}/*
149
150 %files -n wrt-security-devel
151 %manifest %{name}.manifest
152 %defattr(-,root,root,-)
153 %{_includedir}/wrt-security/*
154 %{_includedir}/ace/*
155 %{_includedir}/ace-client/*
156 %{_includedir}/ace-settings/*
157 %{_includedir}/ace-install/*
158 %{_includedir}/ace-common/*
159 %{_includedir}/ace-popup-validation/*
160 %{_includedir}/wrt-ocsp/*
161 %{_libdir}/pkgconfig/security-client.pc
162 %{_libdir}/pkgconfig/security-communication-client.pc
163 %{_libdir}/pkgconfig/security-core.pc
164 %{_libdir}/pkgconfig/security-dao-ro.pc
165 %{_libdir}/pkgconfig/security-dao-rw.pc
166 %{_libdir}/pkgconfig/security-install.pc
167 %{_libdir}/pkgconfig/security-popup-validation.pc
168 %{_libdir}/pkgconfig/security-settings.pc
169 %{_libdir}/pkgconfig/security-wrt-ocsp.pc
170 %{_libdir}/pkgconfig/security.pc
171