Skip to content

Commit 7fbed08

Browse files
authored
packages CHANGE rename RPM package to libyang1 for coexisting with libyang 0.x (#1141)
* Update RPM package to coexist with libyang 0.x Renamed packages similar to official debian package Moved yanglint/yangre utilities to new yang-tools package Changes allow libyang 0.x version and libyang 1.x lib package to be installed at the same time. Signed-off-by: Martin Winter <[email protected]> * rpm Fix libyang-devel package name Signed-off-by: Martin Winter <[email protected]> * rpm Use LIBYANG_MAJOR_SOVERSION to refer to major libyang version Signed-off-by: Martin Winter <[email protected]> * rpm Use libyang-tools as pkg name for the tools Signed-off-by: Martin Winter <[email protected]>
1 parent 875bcf8 commit 7fbed08

File tree

2 files changed

+31
-21
lines changed

2 files changed

+31
-21
lines changed

packages/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
set(PACKAGE "libyang")
22
set(CPP_PACKAGE "libyang-cpp")
33
set(PYTHON_PACKAGE "python3-yang")
4+
set(TOOLS_PACKAGE "libyang-tools")
45

56
find_program(DEB_BUILDER NAMES debuild)
67
find_program(RPM_BUILDER NAMES rpmbuild)

packages/libyang.spec.in

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Name: @PACKAGE@
1+
name: @PACKAGE@@LIBYANG_MAJOR_SOVERSION@
22
Version: @LIBYANG_VERSION@
33
Release: 0
44
Summary: Libyang library
@@ -28,7 +28,6 @@ BuildRequires: gcc
2828
BuildRequires: libcmocka-devel
2929

3030
%if %{with_lang_bind}
31-
3231
BuildRequires: gcc-c++
3332
%if 0%{?rhel} == 7
3433
BuildRequires: swig3 >= 3.0.12
@@ -44,39 +43,46 @@ BuildRequires: python36-devel
4443

4544
%endif
4645

47-
%package devel
46+
%package -n @PACKAGE@-devel
4847
Summary: Headers of libyang library
4948
Requires: %{name} = %{version}-%{release}
5049
Requires: pcre-devel
5150

51+
%package -n @TOOLS_PACKAGE@
52+
Summary: Helper Tools
53+
Requires: %{name} = %{version}-%{release}
54+
5255
%if %{with_lang_bind}
53-
%package -n @CPP_PACKAGE@
56+
%package -n @CPP_PACKAGE@@LIBYANG_MAJOR_SOVERSION@
5457
Summary: Bindings to c++ language
5558
Requires: %{name} = %{version}-%{release}
5659

5760
%package -n @CPP_PACKAGE@-devel
5861
Summary: Headers of bindings to c++ language
59-
Requires: @CPP_PACKAGE@ = %{version}-%{release}
62+
Requires: @CPP_PACKAGE@@LIBYANG_MAJOR_SOVERSION@ = %{version}-%{release}
6063
Requires: pcre-devel
6164

62-
%package -n @PYTHON_PACKAGE@
65+
%package -n @PYTHON_PACKAGE@@LIBYANG_MAJOR_SOVERSION@
6366
Summary: Binding to python
64-
Requires: @CPP_PACKAGE@ = %{version}-%{release}
67+
Requires: @CPP_PACKAGE@@LIBYANG_MAJOR_SOVERSION@ = %{version}-%{release}
6568
Requires: %{name} = %{version}-%{release}
6669

67-
%description -n @CPP_PACKAGE@
70+
%description -n @CPP_PACKAGE@@LIBYANG_MAJOR_SOVERSION@
6871
Bindings of libyang library to C++ language.
6972

7073
%description -n @CPP_PACKAGE@-devel
7174
Headers of bindings to c++ language.
7275

73-
%description -n @PYTHON_PACKAGE@
76+
%description -n @PYTHON_PACKAGE@@LIBYANG_MAJOR_SOVERSION@
7477
Bindings of libyang library to python language.
7578
%endif
7679

77-
%description devel
80+
%description -n @PACKAGE@-devel
7881
Headers of libyang library.
7982

83+
%description -n @TOOLS_PACKAGE@
84+
Helper Tools and examples for libyang library.
85+
8086
%description
8187
@LIBYANG_DESCRIPTION@
8288

@@ -116,33 +122,35 @@ make DESTDIR=%{buildroot} install
116122

117123
%post -p /sbin/ldconfig
118124
%if %{with_lang_bind}
119-
%post -n @CPP_PACKAGE@ -p /sbin/ldconfig
125+
%post -n @CPP_PACKAGE@@LIBYANG_MAJOR_SOVERSION@ -p /sbin/ldconfig
120126
%endif
121127

122128
%postun -p /sbin/ldconfig
123129
%if %{with_lang_bind}
124-
%postun -n @CPP_PACKAGE@ -p /sbin/ldconfig
130+
%postun -n @CPP_PACKAGE@@LIBYANG_MAJOR_SOVERSION@ -p /sbin/ldconfig
125131
%endif
126132

127133
%files
128134
%defattr(-,root,root)
129-
%{_bindir}/yanglint
130-
%{_bindir}/yangre
131-
%{_datadir}/man/man1/yanglint.1.gz
132-
%{_datadir}/man/man1/yangre.1.gz
133135
%{_libdir}/libyang.so.*
134-
%{_libdir}/libyang1/*
135-
%dir %{_libdir}/libyang1/
136+
%{_libdir}/libyang@LIBYANG_MAJOR_SOVERSION@/*
137+
%dir %{_libdir}/libyang@LIBYANG_MAJOR_SOVERSION@/
136138

137-
%files devel
139+
%files -n @PACKAGE@-devel
138140
%defattr(-,root,root)
139141
%{_libdir}/libyang.so
140142
%{_libdir}/pkgconfig/libyang.pc
141143
%{_includedir}/libyang/*.h
142144
%dir %{_includedir}/libyang/
143145

146+
%files -n @TOOLS_PACKAGE@
147+
%{_bindir}/yanglint
148+
%{_bindir}/yangre
149+
%{_datadir}/man/man1/yanglint.1.gz
150+
%{_datadir}/man/man1/yangre.1.gz
151+
144152
%if %{with_lang_bind}
145-
%files -n @CPP_PACKAGE@
153+
%files -n @CPP_PACKAGE@@LIBYANG_MAJOR_SOVERSION@
146154
%defattr(-,root,root)
147155
%{_libdir}/libyang-cpp.so.*
148156

@@ -153,9 +161,10 @@ make DESTDIR=%{buildroot} install
153161
%{_libdir}/pkgconfig/libyang-cpp.pc
154162
%dir %{_includedir}/libyang/
155163

156-
%files -n @PYTHON_PACKAGE@
164+
%files -n @PYTHON_PACKAGE@@LIBYANG_MAJOR_SOVERSION@
157165
%defattr(-,root,root)
158166
%{_libdir}/python*
167+
159168
%endif
160169

161170
%changelog

0 commit comments

Comments
 (0)