2023-11-06 10:00:37 +08:00
|
|
|
# Copyright (c) 2023 Huawei Technologies Co., Ltd. All rights reserved.
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
%global debug_package %{nil}
|
2023-12-12 10:22:28 +08:00
|
|
|
%define with_eventhandler_lib 0
|
|
|
|
|
%define with_ko 1
|
2023-11-06 10:00:37 +08:00
|
|
|
|
|
|
|
|
Name: ft_utils
|
|
|
|
|
Version: 1.0.0
|
2023-12-15 16:19:44 +08:00
|
|
|
Release: 3%{?dist}
|
2023-11-07 11:00:23 +08:00
|
|
|
Summary: common library
|
2023-11-06 10:00:37 +08:00
|
|
|
|
|
|
|
|
License: Apache-2.0
|
|
|
|
|
URL: https://gitee.com/openeuler/ft_utils
|
|
|
|
|
Source0: https://gitee.com/openeuler/ft_utils/repository/archive/ft_utils-1.0.0.tar.gz
|
2023-12-12 10:22:28 +08:00
|
|
|
Source1: https://gitee.com/openeuler/ft_utils/repository/archive/kernel_binder.tar.gz
|
2023-12-15 10:08:54 +08:00
|
|
|
Patch0: 0001-update-kernel-dir-in-makefile.patch
|
2023-11-06 10:00:37 +08:00
|
|
|
|
2023-11-06 10:12:12 +08:00
|
|
|
BuildRequires: clang python3 python3-pip python-toml tar cmake ninja-build compiler-rt
|
2023-11-06 10:00:37 +08:00
|
|
|
BuildRequires: llvm-devel
|
2023-12-15 10:08:54 +08:00
|
|
|
BuildRequires: kernel-devel uname-build-checks
|
2023-12-14 08:06:30 +00:00
|
|
|
BuildRequires: distributed-build distributed-beget distributedhardware_device_manager
|
2023-12-14 07:05:13 +00:00
|
|
|
BuildRequires: commonlibrary_c_utils
|
|
|
|
|
BuildRequires: notification_eventhandler
|
|
|
|
|
BuildRequires: communication_ipc communication_dsoftbus
|
|
|
|
|
BuildRequires: security_device_auth security_huks security_device_security_level security_dataclassification
|
|
|
|
|
BuildRequires: systemabilitymgr_safwk systemabilitymgr_samgr
|
2023-12-15 16:19:44 +08:00
|
|
|
BuildRequires: git
|
2023-12-14 07:05:13 +00:00
|
|
|
|
2023-11-06 02:16:08 +00:00
|
|
|
Requires: compiler-rt llvm-devel python3
|
2023-12-14 08:06:30 +00:00
|
|
|
Requires: distributed-beget distributedhardware_device_manager
|
2023-12-14 07:05:13 +00:00
|
|
|
Requires: commonlibrary_c_utils
|
|
|
|
|
Requires: notification_eventhandler
|
|
|
|
|
Requires: communication_ipc communication_dsoftbus
|
|
|
|
|
Requires: security_device_auth security_huks security_device_security_level security_dataclassification
|
|
|
|
|
Requires: systemabilitymgr_safwk systemabilitymgr_samgr
|
2023-11-06 10:00:37 +08:00
|
|
|
|
|
|
|
|
%description
|
2023-11-07 02:48:35 +00:00
|
|
|
ft_utils module is a base commom library for ft_engine.
|
2023-11-06 10:00:37 +08:00
|
|
|
|
|
|
|
|
%prep
|
2023-12-12 10:22:28 +08:00
|
|
|
%setup -q -D -T -a 0 -c -n %{_builddir}
|
|
|
|
|
%setup -q -D -T -a 1 -c -n %{_builddir}
|
|
|
|
|
|
2023-12-15 10:08:54 +08:00
|
|
|
%patch -P0 -p1 -d %{_builddir}/kernel_binder
|
2023-11-06 10:00:37 +08:00
|
|
|
|
|
|
|
|
%build
|
2023-12-12 10:22:28 +08:00
|
|
|
%if 0%{?with_eventhandler_lib}
|
2023-11-06 10:00:37 +08:00
|
|
|
cd %{_builddir}/%{name}-%{version}
|
|
|
|
|
./build.sh
|
2023-12-12 10:22:28 +08:00
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if 0%{?with_ko}
|
|
|
|
|
cd %{_builddir}/kernel_binder
|
|
|
|
|
./project.sh makeall
|
|
|
|
|
%endif
|
2023-11-06 10:00:37 +08:00
|
|
|
|
|
|
|
|
%install
|
2023-12-12 10:22:28 +08:00
|
|
|
%if 0%{?with_eventhandler_lib}
|
2023-11-06 10:00:37 +08:00
|
|
|
mkdir -p %{buildroot}%{_libdir}
|
|
|
|
|
%ifarch x86_64
|
|
|
|
|
cp -pdf %{_builddir}/%{name}-%{version}/out/Debug/x64/common/common/lib*.so %{buildroot}%{_libdir}
|
|
|
|
|
%endif
|
|
|
|
|
%ifarch aarch64
|
|
|
|
|
cp -pdf %{_builddir}/%{name}-%{version}/out/Debug/aarch64/common/common/lib*.so %{buildroot}%{_libdir}
|
|
|
|
|
%endif
|
2023-12-12 10:22:28 +08:00
|
|
|
%endif
|
|
|
|
|
mkdir -p %{buildroot}/usr/include/ft/event_loop
|
|
|
|
|
cp -pdf %{_builddir}/%{name}-%{version}/event_loop/includes/*.h %{buildroot}/usr/include/ft/event_loop
|
|
|
|
|
|
|
|
|
|
%if 0%{?with_ko}
|
|
|
|
|
mkdir -p %{buildroot}/usr/share/sa
|
|
|
|
|
|
|
|
|
|
cp -pdf %{_builddir}/kernel_binder/binder/src/binder_linux.ko %{buildroot}/usr/share/sa
|
|
|
|
|
cp -pdf %{_builddir}/kernel_binder/ashmem/src/ashmem_linux.ko %{buildroot}/usr/share/sa
|
|
|
|
|
cp -pdf %{_builddir}/kernel_binder/ft.pp %{buildroot}/usr/share/sa
|
|
|
|
|
%endif
|
2023-11-06 10:00:37 +08:00
|
|
|
|
2023-11-06 10:12:12 +08:00
|
|
|
%clean
|
2023-11-06 10:00:37 +08:00
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
2023-12-12 10:22:28 +08:00
|
|
|
%post
|
|
|
|
|
semodule -X 300 -i /usr/share/sa/ft.pp
|
|
|
|
|
insmod /usr/share/sa/ashmem_linux.ko
|
|
|
|
|
insmod /usr/share/sa/binder_linux.ko
|
|
|
|
|
|
2023-11-06 10:00:37 +08:00
|
|
|
%files
|
2023-12-12 10:22:28 +08:00
|
|
|
/usr/include/ft/event_loop/*
|
|
|
|
|
%if 0%{?with_ko}
|
|
|
|
|
/usr/share/sa/*
|
|
|
|
|
%endif
|
2023-11-06 10:00:37 +08:00
|
|
|
|
|
|
|
|
%changelog
|
2023-12-15 16:19:44 +08:00
|
|
|
* Fri Dec 15 2023 Paul Thomas <paulthomas100199@gmail.com> - 1.0.0-3
|
|
|
|
|
- add missing buildrequires
|
|
|
|
|
|
2023-12-15 10:08:54 +08:00
|
|
|
* Thu Dec 14 2023 Peng He <hepeng68@huawei.com> - 1.0.0-2
|
|
|
|
|
- Update kernel dir in makefile
|
|
|
|
|
|
2023-11-06 10:12:12 +08:00
|
|
|
* Mon Nov 6 2023 abc12133 <jinguoen@huawei.com> - 1.0.0-1
|
|
|
|
|
-
|
2023-11-06 10:00:37 +08:00
|
|
|
|