Skip to content

Commit

Permalink
distro UPDATE separate package for YANG modules
Browse files Browse the repository at this point in the history
Currently, YANG modules are installed as part of the main libyang
deb/rpm package. This makes it impossible to install both libyang2 and
libyang3 at the same time, because package managers don't allow to
simultaneously install packages that provide the same files.

As the YANG modules are already embedded into libyang binaries and not
needed for libyang operation, we can move them to a separate
libyang-modules optional package. It allows to install both libyang2 and
libyang3 at the same time.

Signed-off-by: Igor Ryzhov <[email protected]>
  • Loading branch information
idryzhov authored and michalvasko committed Apr 3, 2024
1 parent 1a35d70 commit b050075
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions distro/pkg/deb/control
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,11 @@ Description: parser toolkit for IETF YANG data modeling - executable tools
during the creation of IETF YANG schemas. The tools are not generally
useful for normal operation where libyang primarily processes configuration
data, not schemas.

Package: libyang-modules
Section: devel
Architecture: all
Description: parser toolkit for IETF YANG data modeling - YANG modules
This package provides the IETF YANG modules used by libyang. These modules
are embedded into libyang so this package is not necessary for libyang
operation.
1 change: 1 addition & 0 deletions distro/pkg/deb/libyang-modules.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/share/yang/modules/libyang
1 change: 0 additions & 1 deletion distro/pkg/deb/libyang3.install
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
usr/lib/*/*.so.*
usr/share/yang/modules/libyang
8 changes: 8 additions & 0 deletions distro/pkg/rpm/libyang.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ BuildRequires: cmake(cmocka) >= 1.0.1
BuildRequires: make
BuildRequires: pkgconfig(libpcre2-8) >= 10.21

%package modules
Summary: YANG modules for libyang

%package devel
Summary: Development files for libyang
Requires: %{name}%{?_isa} = %{version}-%{release}
Expand All @@ -32,6 +35,9 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
# This was not properly split out before
Conflicts: %{name} < 1.0.225-3

%description modules
YANG modules for libyang.

%description devel
Headers of libyang library.

Expand Down Expand Up @@ -92,6 +98,8 @@ mkdir -m0755 -p %{buildroot}/%{_docdir}/libyang
%license LICENSE
%{_libdir}/libyang.so.3
%{_libdir}/libyang.so.3.*

%files modules
%{_datadir}/yang/modules/libyang/*.yang
%dir %{_datadir}/yang/
%dir %{_datadir}/yang/modules/
Expand Down

0 comments on commit b050075

Please sign in to comment.