Skip to content

Commit db2933f

Browse files
committed
Merge branch 'devel'
2 parents befbfe1 + 208cbcd commit db2933f

34 files changed

Lines changed: 1559 additions & 898 deletions

.travis-deps-linux.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make -j2 && sudo make install
1818
cd ../..
1919

2020
# CMocka
21-
wget https://cmocka.org/files/1.0/cmocka-1.0.1.tar.xz
22-
tar -xJf cmocka-1.0.1.tar.xz
23-
mkdir cmocka-1.0.1/build && cd cmocka-1.0.1/build
21+
wget https://cmocka.org/files/1.1/cmocka-1.1.1.tar.xz
22+
tar -xJf cmocka-1.1.1.tar.xz
23+
mkdir cmocka-1.1.1/build && cd cmocka-1.1.1/build
2424
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make -j2 && sudo make install
2525
cd ../..
2626

27-
git clone -b $TRAVIS_BRANCH https://github.com/CESNET/libyang.git
27+
if [[ "$TRAVIS_BRANCH" = "master" ]]; then LY_BRANCH="master"; else LY_BRANCH="devel"; fi
28+
git clone -b $LY_BRANCH https://github.com/CESNET/libyang.git
2829
mkdir libyang/build && cd libyang/build
2930
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make -j2 && sudo make install
3031
cd ../..

.travis-deps-osx.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set -e
44
#install dependencies using homebrew
55
brew update
66
brew upgrade openssl
7-
brew upgrade pcre
87

98
# libssh
109
wget https://git.libssh.org/projects/libssh.git/snapshot/libssh-0.7.5.tar.gz
@@ -19,7 +18,8 @@ mkdir cmocka/build && cd cmocka/build
1918
cmake .. && make -j2 && sudo make install
2019
cd ../..
2120

22-
git clone -b $TRAVIS_BRANCH https://github.com/CESNET/libyang.git
21+
if [[ "$TRAVIS_BRANCH" = "master" ]]; then LY_BRANCH="master"; else LY_BRANCH="devel"; fi
22+
git clone -b $LY_BRANCH https://github.com/CESNET/libyang.git
2323
mkdir libyang/build && cd libyang/build
2424
cmake .. && make -j2 && sudo make install
2525
cd ../..

.travis.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ matrix:
1010
dist: trusty
1111
sudo: required
1212
compiler: gcc
13+
addons:
14+
apt:
15+
sources:
16+
- ubuntu-toolchain-r-test
17+
packages:
18+
- g++-7
19+
env:
20+
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
1321
- os: osx
1422
compiler: gcc
1523
allow_failures:
@@ -21,17 +29,18 @@ branches:
2129
- devel
2230

2331
before_install:
32+
- eval "${MATRIX_EVAL}"
2433
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then bash .travis-deps-linux.sh; fi
2534
- if [ "$TRAVIS_OS_NAME" = "linux" -a "$CC" = "gcc" ]; then pip install --user codecov; export CFLAGS="-coverage"; fi
2635
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then bash .travis-deps-osx.sh; fi
2736

2837
script:
2938
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export OPENSSLFLAGS="-DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include"; fi
30-
- cd $TRAVIS_BUILD_DIR && mkdir build_none && cd build_none ; cmake -DENABLE_TLS=OFF -DENABLE_SSH=OFF -DENABLE_DNSSEC=OFF .. && make -j2 && ctest -V
31-
- cd $TRAVIS_BUILD_DIR && mkdir build_tls && cd build_tls ; cmake $OPENSSLFLAGS -DENABLE_TLS=ON -DENABLE_SSH=OFF -DENABLE_DNSSEC=OFF .. && make -j2 && ctest -V
32-
- cd $TRAVIS_BUILD_DIR && mkdir build_ssh && cd build_ssh ; cmake $OPENSSLFLAGS -DENABLE_TLS=OFF -DENABLE_SSH=ON -DENABLE_DNSSEC=OFF .. && make -j2 && ctest -V
33-
- cd $TRAVIS_BUILD_DIR && mkdir build_ssh_tls && cd build_ssh_tls ; cmake $OPENSSLFLAGS -DENABLE_TLS=ON -DENABLE_SSH=ON -DENABLE_DNSSEC=OFF .. && make -j2 && ctest -V
34-
- cd $TRAVIS_BUILD_DIR && mkdir build_all && cd build_all ; cmake $OPENSSLFLAGS -DENABLE_TLS=ON -DENABLE_SSH=ON -DENABLE_DNSSEC=ON .. && make -j2 && ctest -V
39+
- cd $TRAVIS_BUILD_DIR && mkdir build_none && cd build_none ; cmake -DENABLE_TLS=OFF -DENABLE_SSH=OFF -DENABLE_DNSSEC=OFF .. && make -j2 && ctest --output-on-failure
40+
- cd $TRAVIS_BUILD_DIR && mkdir build_tls && cd build_tls ; cmake $OPENSSLFLAGS -DENABLE_TLS=ON -DENABLE_SSH=OFF -DENABLE_DNSSEC=OFF .. && make -j2 && ctest --output-on-failure
41+
- cd $TRAVIS_BUILD_DIR && mkdir build_ssh && cd build_ssh ; cmake $OPENSSLFLAGS -DENABLE_TLS=OFF -DENABLE_SSH=ON -DENABLE_DNSSEC=OFF .. && make -j2 && ctest --output-on-failure
42+
- cd $TRAVIS_BUILD_DIR && mkdir build_ssh_tls && cd build_ssh_tls ; cmake $OPENSSLFLAGS -DENABLE_TLS=ON -DENABLE_SSH=ON -DENABLE_DNSSEC=OFF .. && make -j2 && ctest --output-on-failure
43+
- cd $TRAVIS_BUILD_DIR && mkdir build_all && cd build_all ; cmake $OPENSSLFLAGS -DENABLE_TLS=ON -DENABLE_SSH=ON -DENABLE_DNSSEC=ON .. && make -j2 && ctest --output-on-failure
3544
- cd -
3645

3746
after_success:

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ if(NOT UNIX)
1313
message(FATAL_ERROR "Only *nix like systems are supported.")
1414
endif()
1515

16+
# osx specific
17+
set(CMAKE_MACOSX_RPATH TRUE)
18+
1619
set(INCLUDE_INSTALL_SUBDIR ${CMAKE_INSTALL_INCLUDEDIR}/libnetconf2)
1720
set(DATA_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/libnetconf2)
1821

@@ -28,8 +31,8 @@ set(CMAKE_C_FLAGS_DEBUG "-g -O0")
2831

2932
# set version
3033
set(LIBNETCONF2_MAJOR_VERSION 0)
31-
set(LIBNETCONF2_MINOR_VERSION 10)
32-
set(LIBNETCONF2_MICRO_VERSION 30)
34+
set(LIBNETCONF2_MINOR_VERSION 11)
35+
set(LIBNETCONF2_MICRO_VERSION 37)
3336
set(LIBNETCONF2_VERSION ${LIBNETCONF2_MAJOR_VERSION}.${LIBNETCONF2_MINOR_VERSION}.${LIBNETCONF2_MICRO_VERSION})
3437
set(LIBNETCONF2_SOVERSION ${LIBNETCONF2_MAJOR_VERSION}.${LIBNETCONF2_MINOR_VERSION})
3538

@@ -41,6 +44,7 @@ option(ENABLE_PYTHON "Include bindings for Python 3" OFF)
4144
set(READ_INACTIVE_TIMEOUT 20 CACHE STRING "Maximum number of seconds waiting for new data once some data have arrived")
4245
set(READ_ACTIVE_TIMEOUT 300 CACHE STRING "Maximum number of seconds for receiving a full message")
4346
set(MAX_PSPOLL_THREAD_COUNT 6 CACHE STRING "Maximum number of threads that could simultaneously access a ps_poll structure")
47+
set(SCHEMAS_DIR "${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}" CACHE STRING "Directory with internal lnc2 schemas")
4448

4549
if(ENABLE_DNSSEC AND NOT ENABLE_SSH)
4650
message(WARNING "DNSSEC SSHFP retrieval cannot be used without SSH support.")

libnetconf2.pc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Libs: -L${libdir} -lnetconf2
99
Cflags: -I${includedir}
1010

1111
LNC2_MAX_THREAD_COUNT=@MAX_PSPOLL_THREAD_COUNT@
12+
LNC2_SCHEMAS_DIR=@SCHEMAS_DIR@

packages/debian.control.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,15 @@ Depends: @PACKAGE_NAME@ (= @LIBNETCONF2_VERSION@)
2323
Section: debug
2424
Architecture: any
2525
Description: Debug symbols for libnetconf2 library.
26+
27+
Package: python3-netconf2@COMPAT_PACKAGES@
28+
Depends: @PACKAGE_NAME@ (= @LIBNETCONF2_VERSION@)
29+
Section: libs
30+
Architecture: any
31+
Description: Bindings of libyang library to python3 language.
32+
33+
Package: python3-netconf2@COMPAT_PACKAGES@-dbg
34+
Depends: python3-netconf2@COMPAT_PACKAGES@ (= @LIBNETCONF2_VERSION@)
35+
Section: debug
36+
Architecture: any
37+
Description: Debug symbols of python3 bidings of libnetconf2 library.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/lib*/python*/*-packages/*

packages/debian.rules.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ export DH_VERBOSE=1
77
dh $@
88

99
override_dh_strip:
10-
dh_strip --dbg-package=@PACKAGE_NAME@-dbg
10+
dh_strip -p@PACKAGE_NAME@ --dbg-package=@PACKAGE_NAME@-dbg
11+
dh_strip -ppython3-netconf2@COMPAT_PACKAGES@ --dbg-package=python3-netconf2@COMPAT_PACKAGES@-dbg
1112

1213
override_dh_auto_configure:
13-
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -D CMAKE_BUILD_TYPE:String="@BUILD_TYPE@" .
14+
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DENABLE_PYTHON=ON -DCMAKE_BUILD_TYPE:String="@BUILD_TYPE@" .
1415

1516
override_dh_auto_test:
1617
ctest --output-on-failure

packages/libnetconf2.dsc.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Format: 3.0 (quilt)
22
Source: @PACKAGE_NAME@
3-
Binary: @PACKAGE_NAME@, @PACKAGE_NAME@-dbg, @PACKAGE_NAME@-dev
3+
Binary: @PACKAGE_NAME@, @PACKAGE_NAME@-dbg, @PACKAGE_NAME@-dev, python3-netconf2@COMPAT_PACKAGES@, python3-netconf2@COMPAT_PACKAGES@-dbg
44
Maintainer: CESNET <rkrejci@cesnet.cz>
55
Version: @LIBNETCONF2_VERSION@
66
Architecture: any
77
Standards-Version: 3.8.2
88
Homepage: https://github.com/CESNET/libnetconf2
99
Vcs-Git: https://github.com/CESNET/libnetconf2
10-
Build-Depends: debhelper (>= 9), make, gcc, cmake, pkg-config, libcmocka-dev, libyang@COMPAT_PACKAGES@-dev, libssh-dev (>= 0.7.1), openssl
10+
Build-Depends: debhelper (>= 9), make, gcc, cmake, pkg-config, libcmocka-dev, libyang@COMPAT_PACKAGES@-dev, libssh-dev (>= 0.7.1), openssl, python3-dev (>= 3.4)

packages/libnetconf2.spec.in

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Source: %{url}/archive/@BRANCH@.tar.gz
77
License: BSD-3-Clause
88
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
99

10-
Requires: libnetconf2-@LIBNETCONF2_MAJOR_VERSION@_@LIBNETCONF2_MINOR_VERSION@ = %{version}-%{release}
10+
Requires: libyang@COMPAT_PACKAGES@
1111
BuildRequires: libyang@COMPAT_PACKAGES@-devel
1212
BuildRequires: libssh-devel >= 0.7.1
1313
BuildRequires: openssl-devel
@@ -18,32 +18,37 @@ BuildRequires: gcc
1818
%if 0%{?suse_version}
1919
BuildRequires: timezone
2020
%endif
21-
Conflicts: @CONFLICT_PACKAGE_NAME@
2221

23-
%package -n libnetconf2-@LIBNETCONF2_MAJOR_VERSION@_@LIBNETCONF2_MINOR_VERSION@
24-
Summary: Libnetconf2 library
25-
Requires: libyang@COMPAT_PACKAGES@
26-
Requires: %{name} = %{version}-%{release}
22+
%if 0%{?suse_version} + 0%{?fedora} > 0
23+
BuildRequires: python3-devel
24+
%else
25+
BuildRequires: python34-devel
26+
%endif
27+
Conflicts: @CONFLICT_PACKAGE_NAME@
2728

2829
%package devel
2930
Summary: Headers of libnetconf2 library
3031
Requires: %{name} = %{version}-%{release}
3132
Requires: libssh-devel
3233

33-
%description -n libnetconf2-@LIBNETCONF2_MAJOR_VERSION@_@LIBNETCONF2_MINOR_VERSION@
34-
Libnetconf2 is a NETCONF library in C intended for building NETCONF clients and servers.
34+
%package -n python3-netconf2@COMPAT_PACKAGES@
35+
Summary: Bindings to python3
36+
Requires: %{name} = %{version}-%{release}
3537

3638
%description devel
3739
Headers of libnetconf2 library.
3840

41+
%description -n python3-netconf2@COMPAT_PACKAGES@
42+
Bindings of libnetconf2 library to python3 language.
43+
3944
%description
4045
Libnetconf2 is a NETCONF library in C intended for building NETCONF clients and servers.
4146

4247
%prep
4348
%setup -n libnetconf2-@BRANCH@
4449

4550
%build
46-
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -D CMAKE_BUILD_TYPE:String="@BUILD_TYPE@" -D ENABLE_VALGRIND_TESTS:BOOL=FALSE .
51+
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:String="@BUILD_TYPE@" -DENABLE_PYTHON=ON -DENABLE_VALGRIND_TESTS:BOOL=FALSE .
4752
make
4853

4954
%check
@@ -52,17 +57,15 @@ ctest --output-on-failure
5257
%install
5358
make DESTDIR=%{buildroot} install
5459

55-
%post -n libnetconf2-@LIBNETCONF2_MAJOR_VERSION@_@LIBNETCONF2_MINOR_VERSION@ -p /sbin/ldconfig
60+
%post -p /sbin/ldconfig
5661

57-
%postun -n libnetconf2-@LIBNETCONF2_MAJOR_VERSION@_@LIBNETCONF2_MINOR_VERSION@ -p /sbin/ldconfig
62+
%postun -p /sbin/ldconfig
5863

5964
%files
60-
%{_datadir}/libnetconf2/*
61-
%dir %{_datadir}/libnetconf2/
62-
63-
%files -n libnetconf2-@LIBNETCONF2_MAJOR_VERSION@_@LIBNETCONF2_MINOR_VERSION@
6465
%defattr(-,root,root)
6566
%{_libdir}/libnetconf2.so.*
67+
%{_datadir}/libnetconf2/*
68+
%dir %{_datadir}/libnetconf2/
6669

6770
%files devel
6871
%defattr(-,root,root)
@@ -73,4 +76,8 @@ make DESTDIR=%{buildroot} install
7376
%{_includedir}/nc_server.h
7477
%dir %{_includedir}/libnetconf2/
7578

79+
%files -n python3-netconf2@COMPAT_PACKAGES@
80+
%defattr(-,root,root)
81+
/usr/lib*/python*/*-packages/*
82+
7683
%changelog

0 commit comments

Comments
 (0)