File netifd.spec of Package netifd

#
# spec file for package netifd
#
# Copyright (c) 2024, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           netifd
Version:        0~git20240226
Release:        0
Summary:        OpenWrt Network Interface Configuration Daemon
License:        GPL-2.0-only
URL:            https://git.openwrt.org/?p=project/netifd.git;a=summary
Source:         %{name}-%{version}.tar.xz
BuildRequires:  cmake
BuildRequires:  libnl-tiny-devel
BuildRequires:  libnl3-devel
BuildRequires:  libubox-devel
BuildRequires:  libuci-devel
BuildRequires:  linux-glibc-devel
BuildRequires:  pkgconfig
BuildRequires:  ubus-devel
BuildRequires:  udebug-devel
BuildRequires:  pkgconfig(json-c)

%description
OpenWrt Network Interface Configuration Daemon.

%prep
%setup -q

%build
export CFLAGS=$(pkg-config --cflags libnl-tiny)
# FIXME: you should use the %%cmake macros
cmake . -DLIBNL_LIBS=-lnl-tiny
%make_build

%install
%make_install
#HACK
install -d %{buildroot}%{_sbindir}/
mv %{buildroot}%{_prefix}/local/sbin/netifd %{buildroot}%{_sbindir}/

%files
%doc DESIGN
%{_sbindir}/netifd

%changelog
openSUSE Build Service is sponsored by