Blob Blame Raw
# valgrind finds invalid writes in libcmocka on arm
# see bug #1699304 for more information
%ifarch %arm
%global run_valgrind_tests OFF
%global run_valgrind_tests ON

Name: libyang
Version: 0.16.105
Release: 1%{?dist}
Summary: YANG data modeling language library
Source: %{url}/archive/debian/libyang-%{version}-1.tar.gz
License: BSD

Requires:  pcre
BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  pcre-devel
BuildRequires:  gcc
BuildRequires:  valgrind
BuildRequires:  gcc-c++
BuildRequires:  swig >= 3.0.12
BuildRequires:  libcmocka-devel
BuildRequires:  python3-devel
BuildRequires:  flex
BuildRequires:  bison
BuildRequires:  graphviz

%package devel
Summary:    Development files for libyang
Requires:   %{name}%{?_isa} = %{version}-%{release}
Requires:   pcre-devel

%package devel-doc
Summary:    Documentation of libyang API
Requires:   %{name} = %{version}-%{release}
BuildArch:  noarch

%package -n libyang-cpp
Summary:    C++ bindings for libyang
Requires:   %{name}%{?_isa} = %{version}-%{release}

%package -n libyang-cpp-devel
Summary:    Development files for libyang-cpp
Requires:   libyang-cpp%{?_isa} = %{version}-%{release}
Requires:   pcre-devel

%package -n python3-libyang
Summary:    Python3 bindings for libyang
Requires:   libyang-cpp%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python3-libyang}

%description -n libyang-cpp
Bindings of libyang library to C++ language.

%description -n libyang-cpp-devel
Headers of bindings to c++ language.

%description -n python3-libyang
Bindings of libyang library to python language.

%description devel
Headers of libyang library.

%description devel-doc
Documentation of libyang API.

Libyang is YANG data modeling language parser and toolkit
written (and providing API) in C.

%setup -q -n libyang-debian-libyang-%{version}-1
mkdir build

cd build
%cmake \
   %{?_smp_mflags} \
   -DCMAKE_BUILD_TYPE:String="Package" \
   -DENABLE_VALGRIND_TESTS=%{run_valgrind_tests} ..
make doc

cd build
ctest --output-on-failure -V %{?_smp_mflags}

pushd build
%make_install DESTDIR=%{buildroot}
mkdir -m0755 -p %{buildroot}/%{_docdir}/libyang
cp -r doc/html %{buildroot}/%{_docdir}/libyang/html

%license LICENSE
%dir %{_libdir}/libyang/

%files devel
%dir %{_includedir}/libyang/

%files devel-doc

%files -n libyang-cpp

%files -n libyang-cpp-devel
%dir %{_includedir}/libyang/

%files -n python3-libyang

* Tue May 07 2019 Tomas Korbar <> - 0.16.105-1
- Initial import (#1699846).

* Fri Apr 26 2019 Tomas Korbar <> - 0.16.105-1
- Change specfile accordingly to mosvald's review
- Remove obsolete ldconfig scriptlets
- libyang-devel-doc changed to noarch package
- Add python_provide macro to python3-libyang subpackage
- Remove obsolete Requires from libyang-cpp-devel
- Start using cmake with smp_mflags macro

* Wed Apr 03 2019 Tomas Korbar <> - 0.16.105-1
- Initial commit of package after editation of specfile