1
0
Fork 0

Adding upstream version 3.1.0+dfsg.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-05 08:00:08 +01:00
parent 64dbec996d
commit cfcebb1a7d
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
569 changed files with 205393 additions and 0 deletions

9
distro/README.md Normal file
View file

@ -0,0 +1,9 @@
# upstream packaging
## RPM-based system (Fedora, CentOS, SUSE, ...) quickstart
```
sudo dnf install -y git rpm-build python3-pip
pip3 install apkg
apkg build -i
```
See apkg docs: https://pkg.labs.nic.cz/pages/apkg/

10
distro/config/apkg.toml Normal file
View file

@ -0,0 +1,10 @@
[project]
name = "libyang"
make_archive_script = "distro/scripts/make-archive.sh"
[upstream]
archive_url = "https://github.com/CESNET/libyang/archive/v{{ version }}/libyang-{{ version }}.tar.gz"
version_script = "distro/scripts/upstream-version.sh"
[apkg]
compat = 2

View file

@ -0,0 +1,38 @@
Debian packaging for libyang
============================
Where to file issues
--------------------
Please file issues on the Debian BTS as usual. You could also open issues
on github, but if it's something about the Debian packaging it's better to
stick with the proper Debian ways. The Debian BTS is where other people
involved with Debian go look for bugs regarding a package, so that's where
they should be.
Building straight off git
-------------------------
Just the normal:
```
git clone https://github.com/CESNET/libyang -b debian/master
cd libyang
dpkg-buildpackage
```
Building a Debian .dsc
----------------------
Again, pretty much the normal:
```
git clone https://github.com/CESNET/libyang -b debian/master
wget -Olibyang_0.16.105.orig.tar.gz https://github.com/CESNET/libyang/archive/v0.16-r3.tar.gz
cd libyang
dpkg-source -b .
```
(Note the diverging release numbering though.)
-- Ondřej Surý <Ondřej Surý <ondrej@debian.org>>, Fri, 22 May 2020 11:10:55 +0200

View file

@ -0,0 +1,66 @@
This module uses gbp and upstream git repository
To update this package, first import the changes from upstream:
- git fetch --all
Find the latest version:
VERSION=$(git describe --tags $(git rev-list '--tags=v2*' --max-count=1) | sed 's/^v//')
echo $VERSION
Update debian/sid branch
- git checkout debian/master
- git merge v$VERSION
Update the debian/copyright file:
- cme update dpkg-copyright
See also https://github.com/dod38fr/config-model/wiki/Updating-debian-copyright-file-with-cme
Check patches (and cleanup if necessary):
- gbp pq rebase --commit --drop
Download upstream tarball:
- uscan --download --verbose --download-version $VERSION
Add pristine-tar:
- pristine-tar commit ../libyang_$VERSION.orig.tar.gz v$VERSION
Generate a temporary changelog:
- gbp dch --new-version=$VERSION-1 --snapshot --auto --commit debian/
Test the first build::
- gbp buildpackage --git-ignore-new --git-pristine-tar --git-no-purge
Regenerate the symbol file (See https://qt-kde-team.pages.debian.net/symbolfiles.html)
- pkgkde-symbolshelper batchpatch -v $VERSION < <path_to>/buildlog
See https://www.debian.org/doc/manuals/maint-guide/advanced.en.html#librarysymbols
and dpkg-gensymbols man page
Update the changelog:
- gbp dch -Ra -c
Once everything is fine, build a source package and tag:
- gbp buildpackage -S --git-tag
Push on salsa:
- gbp push
For more details, see
https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.import.upstream-git.html#gbp.import.upstream.git.notarball
Maintainer Notes (moved from README.md)
=======================================
* the project version number is actually the SO ABI version. The release
point numbers (0.16-r3) isn't used for Debian.
* it's intentional that the SONAME is libyang.so.0.16 and not libyang.so.0.
ABI compatibility is indicated by the first two numbers being equal;
the third number is incremented for compatible changes. cf.
CESNET/libyang#656
* the watch file doesn't work yet but the libyang people agreed to make
future release tags the same as the internal version number. At that point
the watch file will work.
-- Ondřej Surý <Ondřej Surý <ondrej@debian.org>>, Tue, 21 Jul 2020 16:31:52 +0200

5
distro/pkg/deb/changelog Normal file
View file

@ -0,0 +1,5 @@
libyang3 ({{ version }}-{{ release }}) unstable; urgency=medium
* upstream packaging
-- Ondřej Surý <ondrej@debian.org> Tue, 04 May 2021 22:20:03 +0200

1
distro/pkg/deb/compat Normal file
View file

@ -0,0 +1 @@
10

73
distro/pkg/deb/control Normal file
View file

@ -0,0 +1,73 @@
Source: libyang3
Section: libs
Homepage: https://github.com/CESNET/libyang/
Maintainer: Ondřej Surý <ondrej@debian.org>
Priority: optional
Standards-Version: 4.5.0
Build-Depends: cmake,
debhelper (>= 10),
libcmocka-dev <!nocheck>,
libpcre2-dev,
pkg-config
Vcs-Browser: https://github.com/CESNET/libyang/tree/master
Vcs-Git: https://github.com/CESNET/libyang.git
Package: libyang3
Depends: ${misc:Depends},
${shlibs:Depends}
Architecture: any
Multi-Arch: same
Description: parser toolkit for IETF YANG data modeling - runtime
Libyang implements functions to process schemas expressed in the
YANG data modeling language defined by the IETF in RFCs 6020/7950.
Schemas expressed in this language primarily describe configuration
used by larger network equipment like routers and switches.
.
In addition to handling the schemas itself, the library also provides
functions to process data described by the schemas.
.
The library is implemented in C and provides an API for other software
to use in processing configurations.
Package: libyang-dev
Depends: libpcre2-dev,
libyang3 (= ${binary:Version}),
${misc:Depends}
Conflicts: libyang2-dev
Section: libdevel
Architecture: any
Multi-Arch: same
Description: parser toolkit for IETF YANG data modeling - development files
Libyang implements functions to process schemas expressed in the
YANG data modeling language defined by the IETF in RFCs 6020/7950.
Schemas expressed in this language primarily describe configuration
used by larger network equipment like routers and switches.
.
In addition to handling the schemas itself, the library also provides
functions to process data described by the schemas.
.
This package contains the C headers, a pkgconfig file, and .so entry point
for libyang.
Package: libyang-tools
Depends: libyang3 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: libyang2-tools (<< ${source:Version})
Replaces: libyang2-tools (<< ${source:Version})
Section: devel
Architecture: any
Multi-Arch: foreign
Description: parser toolkit for IETF YANG data modeling - executable tools
This package provides the "yanglint" and "yangre" tools which can be used
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.

79
distro/pkg/deb/copyright Normal file
View file

@ -0,0 +1,79 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: libyang
License: BSD-3-clause
Files: *
Copyright: 2015-2021 by CESNET, z.s.p.o.
License: BSD-3-clause
Files: */iana-*.yin */iana-*.yang */ietf-*.yin */ietf-*.yang */ietf-*.h
Copyright: 2011-2018 by the IETF Trust and the persons identified as authors
License: IETF-BSD-3-clause
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject
to the license terms contained in, the Simplified BSD
License set forth in Section 4.c of the IETF Trust's
Legal Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info).
.
This version of this YANG module is part of RFC 6536; see
the RFC itself for full legal notices.
Files: tools/lint/linenoise/*
Copyright:
Copyright (c) 2010-2014, Salvatore Sanfilippo <antirez at gmail dot com>
Copyright (c) 2010-2013, Pieter Noordhuis <pcnoordhuis at gmail dot com>
License: BSD-2-clause
All rights reserved.
.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
.
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Files: debian/*
Copyright: 2018 by David Lamparter
2020-2021 Ondřej Surý
License: BSD-3-clause
License: BSD-3-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
.
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
.
* Neither the name of libyang nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

4
distro/pkg/deb/gbp.conf Normal file
View file

@ -0,0 +1,4 @@
[DEFAULT]
pristine-tar = False
debian-branch = master
upstream-tree = SLOPPY

View file

@ -0,0 +1,3 @@
usr/include/libyang/*.h
usr/lib/*/*.so
usr/lib/*/pkgconfig/*.pc

View file

@ -0,0 +1 @@
usr/share/yang/modules/libyang

View file

@ -0,0 +1 @@
tools/lint/examples/*

View file

@ -0,0 +1,3 @@
usr/bin/yanglint
usr/bin/yangre
usr/share/man/man1

View file

@ -0,0 +1 @@
usr/lib/*/*.so.*

12
distro/pkg/deb/rules Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/make -f
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/default.mk
%:
dh $@
override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE:String="Release"

View file

@ -0,0 +1 @@
3.0 (quilt)

View file

@ -0,0 +1,3 @@
Tests: yanglint
Depends: gzip,
libyang-tools

18
distro/pkg/deb/tests/yanglint Executable file
View file

@ -0,0 +1,18 @@
#!/bin/sh
set -e
# Setup the test file
trap 'rm -f "${TESTFILE}"; rmdir "${TESTDIR}"' EXIT
TESTDIR=$(mktemp -d /tmp/yanglint.XXXXXX)
TESTFILE="${TESTDIR}/ietf-interfaces.yang"
# Unpack or copy the test file
if test -f /usr/share/doc/libyang-tools/examples/ietf-interfaces.yang.gz; then
gunzip -c < /usr/share/doc/libyang-tools/examples/ietf-interfaces.yang.gz > "${TESTFILE}"
else
cp /usr/share/doc/libyang-tools/examples/ietf-interfaces.yang "${TESTFILE}"
fi
# Lint the test file
yanglint "${TESTFILE}"

4
distro/pkg/deb/watch Normal file
View file

@ -0,0 +1,4 @@
version=4
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%libyang-$1.tar.gz%" \
https://github.com/CESNET/libyang/releases \
(?:.*?/)?v?(\d[\d.]*)(?:-r\d+)?\.tar\.gz debian uupdate

125
distro/pkg/rpm/libyang.spec Normal file
View file

@ -0,0 +1,125 @@
%if 0%{?rhel} == 8
%undefine __cmake_in_source_build
%endif
Name: libyang
Version: {{ version }}
Release: {{ release }}%{?dist}
Summary: YANG data modeling language library
Url: https://github.com/CESNET/libyang
Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
License: BSD
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: gcc
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}
Requires: pcre2-devel
%package devel-doc
Summary: Documentation of libyang API
Requires: %{name}%{?_isa} = %{version}-%{release}
%package tools
Summary: YANG validator tools
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.
%description devel-doc
Documentation of libyang API.
%description tools
YANG validator tools.
%description
Libyang is YANG data modeling language parser and toolkit
written (and providing API) in C.
%prep
%autosetup -p1
%if 0%{?rhel} && 0%{?rhel} < 8
mkdir build
%endif
%build
%if 0%{?rhel} && 0%{?rhel} < 8
cd build
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
-DCMAKE_BUILD_TYPE:String="Release" \
-DCMAKE_C_FLAGS="${RPM_OPT_FLAGS}" \
-DCMAKE_CXX_FLAGS="${RPM_OPT_FLAGS}" \
..
make
%else
%cmake -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
%cmake_build
%if "x%{?suse_version}" == "x"
cd %{__cmake_builddir}
%endif
%endif
make doc
%check
%if ( 0%{?rhel} == 0 ) || 0%{?rhel} > 7
%if "x%{?suse_version}" == "x"
cd %{__cmake_builddir}
%endif
%endif
ctest --output-on-failure -V %{?_smp_mflags}
%install
mkdir -m0755 -p %{buildroot}/%{_docdir}/libyang
%if 0%{?rhel} && 0%{?rhel} < 8
cd build
make DESTDIR=%{buildroot} install
%else
%cmake_install
cp -a doc/html %{buildroot}/%{_docdir}/libyang/html
%endif
%files
%license LICENSE
%{_libdir}/libyang.so.3
%{_libdir}/libyang.so.3.*
%files modules
%{_datadir}/yang/modules/libyang/*.yang
%dir %{_datadir}/yang/
%dir %{_datadir}/yang/modules/
%dir %{_datadir}/yang/modules/libyang/
%files tools
%{_bindir}/yanglint
%{_bindir}/yangre
%{_datadir}/man/man1/yanglint.1.gz
%{_datadir}/man/man1/yangre.1.gz
%files devel
%{_libdir}/libyang.so
%{_libdir}/pkgconfig/libyang.pc
%{_includedir}/libyang/*.h
%dir %{_includedir}/libyang/
%files devel-doc
%{_docdir}/libyang
%changelog
* {{ now }} Jakub Ružička <jakub.ruzicka@nic.cz> - {{ version }}-{{ release }}
- upstream package

14
distro/scripts/make-archive.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
# create archive from current source using git
VERSION=$(git log --oneline -n1 --grep="^VERSION" | rev | cut -d' ' -f1 | rev)
NAMEVER=libyang-$VERSION
ARCHIVE=$NAMEVER.tar.gz
git archive --format tgz --output $ARCHIVE --prefix $NAMEVER/ HEAD
mkdir -p pkg/archives/dev/
mv $ARCHIVE pkg/archives/dev/
# apkg expects stdout to list archive files
echo pkg/archives/dev/$ARCHIVE

View file

@ -0,0 +1,7 @@
#!/bin/bash
# get latest upstream libyang version from github
RLS_URL=https://api.github.com/repos/CESNET/libyang/releases
VERSION=$(curl -s $RLS_URL | grep tag_name | cut -d '"' -f 4 | sort --version-sort | tail -n 1)
VERSION=${VERSION#v}
echo $VERSION

1
distro/tests/control Normal file
View file

@ -0,0 +1 @@
Tests: test-pkg-config.sh test-yanglint.sh

View file

@ -0,0 +1,5 @@
#!/bin/bash
set -ex
version=`pkg-config --modversion libyang`
echo "$version" | grep '2\.[0-9.]\+'

5
distro/tests/test-yanglint.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
set -ex
version=`yanglint --version`
echo "$version" | grep '2\.[0-9.]\+'