5 Source0: file://%{name}-%{version}.tar.gz
6 Summary: Trust Anchor API
7 Group: Security/Certificate Management
10 BuildRequires: coreutils
11 BuildRequires: pkgconfig(klay)
12 BuildRequires: pkgconfig(openssl)
13 BuildRequires: pkgconfig(libtzplatform-config)
14 BuildRequires: ca-certificates
15 BuildRequires: ca-certificates-devel
16 Requires(post): /sbin/ldconfig
17 Requires(postun): /sbin/ldconfig
19 %global lib_name tanchor
20 %global user_name security_fw
21 %global group_name security_fw
22 %global smack_label System
23 %global pkg_smack_label System::Shared
25 %global tanchor_base %{TZ_SYS_DATA}/%{lib_name}
26 %global tanchor_pkg %{tanchor_base}/pkg
27 %global tanchor_bundle %{tanchor_base}/ca-bundle.pem
28 %global tanchor_sysca %{tanchor_base}/.sysca
29 %global tanchor_pkgcerts %{tanchor_base}/.pkgcerts
30 %global tanchor_test %{tanchor_base}/test
31 %global tanchor_example %{tanchor_base}/example
34 The package provides trust-anchor which the application can assign
35 SSL root certificates for its HTTPS communication.
38 %manifest %{name}.manifest
40 %{_libdir}/lib%{lib_name}.so.2
41 %{_libdir}/lib%{lib_name}.so.%{version}
42 %dir %attr(-, %{user_name}, %{group_name}) %{tanchor_base}
43 %dir %attr(-, %{user_name}, %{group_name}) %{tanchor_pkg}
44 %attr(-, %{user_name}, %{group_name}) %{tanchor_bundle}
45 %attr(-, %{user_name}, %{group_name}) %{tanchor_pkgcerts}
46 %attr(444 %{user_name}, %{group_name}) %{tanchor_sysca}
52 %{!?build_type:%define build_type "RELEASE"}
54 %if %{build_type} == "DEBUG" || %{build_type} == "PROFILING" || %{build_type} == "CCOV"
55 CFLAGS="$CFLAGS -Wp,-U_FORTIFY_SOURCE"
56 CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE"
59 %cmake . -DCMAKE_BUILD_TYPE=%{build_type} \
60 -DLIB_NAME=%{lib_name} \
61 -DLIB_VERSION=%{version} \
62 -DUSER_NAME=%{user_name} \
63 -DGROUP_NAME=%{group_name} \
64 -DSMACK_LABEL=%{smack_label} \
65 -DPKG_SMACK_LABEL=%{pkg_smack_label} \
66 -DTANCHOR_BASE=%{tanchor_base} \
67 -DTANCHOR_PKG=%{tanchor_pkg} \
68 -DTANCHOR_BUNDLE=%{tanchor_bundle} \
69 -DTANCHOR_SYSCA=%{tanchor_sysca} \
70 -DTANCHOR_PKG_CERTS=%{tanchor_pkgcerts} \
71 -DTANCHOR_TEST=%{tanchor_test} \
72 -DTANCHOR_EXAMPLE=%{tanchor_example} \
73 -DTZ_SYS_CA_CERTS=%{TZ_SYS_CA_CERTS} \
74 -DTZ_SYS_CA_BUNDLE=%{TZ_SYS_CA_BUNDLE} \
75 -DTZ_SYS_RO_CA_CERTS=%{TZ_SYS_RO_CA_CERTS} \
76 -DTZ_SYS_RO_CA_BUNDLE=%{TZ_SYS_RO_CA_BUNDLE}
83 mkdir -p %{buildroot}%{tanchor_pkg}
85 touch %{buildroot}%{tanchor_bundle}
86 touch %{buildroot}%{tanchor_sysca}
87 touch %{buildroot}%{tanchor_pkgcerts}
89 %post -p /sbin/ldconfig
91 %postun -p /sbin/ldconfig
93 ## Devel Package ###############################################################
95 Summary: Trust Anchor API (development files)
96 Group: Security/Development
97 Requires: %{name} = %{version}-%{release}
100 The package provides Trust Anchor API development files.
103 %{_includedir}/%{lib_name}/error.h
104 %{_includedir}/%{lib_name}/trust-anchor.h
105 %{_includedir}/%{lib_name}/trust-anchor.hxx
106 %{_libdir}/lib%{lib_name}.so
107 %{_libdir}/pkgconfig/%{lib_name}.pc
109 ## Test Package ##############################################################
110 %package -n trust-anchor-test
111 Summary: Trust Anchor API test
112 Group: Security/Development
113 BuildRequires: pkgconfig(libcurl)
115 %description -n trust-anchor-test
116 Testcases for trust anchor library
118 %files -n trust-anchor-test
119 %{_bindir}/%{lib_name}-test-installer
120 %{_bindir}/%{lib_name}-test-launcher
121 %{_bindir}/%{lib_name}-test-clauncher
122 %{_bindir}/%{lib_name}-test-internal
123 %{_bindir}/%{lib_name}-test-ssl
124 %{_bindir}/%{lib_name}-test-init.sh
125 %attr(-, %{user_name}, %{group_name}) %{tanchor_test}
126 %attr(-, %{user_name}, %{group_name}) %{tanchor_test}/certs
128 ## Example Package ############################################################
129 %package -n trust-anchor-example
130 Summary: Trust Anchor API example
131 Group: Security/Other
133 %description -n trust-anchor-example
134 Examples for trust anchor library
136 %files -n trust-anchor-example
137 %{tanchor_example}/installer.c
138 %{tanchor_example}/launcher.c