%global orangepi_build_ref 206214916c796df6842a5df1d95ae580881ce603 %global shortcommit %(c=%{orangepi_build_ref}; echo ${c:0:7}) Name: hciattach-opi Version: 1.0 Release: 1.git%{shortcommit}%{?dist} Summary: hciattach_opi helper for UWE5622 Bluetooth License: GPL-2.0-only URL: https://github.com/orangepi-xunlong/orangepi-build Source0: %{url}/archive/%{orangepi_build_ref}.tar.gz BuildArch: aarch64 AutoReqProv: no BuildRequires: make gcc %description ARM64 hciattach_opi helper used by sprd-bluetooth for UWE5622 Bluetooth. %prep %autosetup -n orangepi-build-%{orangepi_build_ref} -N sed -i 's/"sprd", 0x0000, 0x0000, NULL,/"sprd", 0x0000, 0x0000, HCI_UART_H4,/' external/cache/sources/hcitools/hciattach.c sed -i '1i #include ' external/cache/sources/hcitools/hciattach_qualcomm.c sed -i '1i #include ' external/cache/sources/hcitools/hciattach_tialt.c %build make -C external/cache/sources/hcitools hciattach_opi %install install -Dm 0755 external/cache/sources/hcitools/output/hciattach_opi %{buildroot}/usr/bin/hciattach_opi %files /usr/bin/hciattach_opi %changelog %autochangelog