Skip to content

Commit

Permalink
distro UPDATE sysrepo and general updates
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvasko committed Mar 12, 2024
1 parent cfaccc1 commit 3553179
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 41 deletions.
3 changes: 2 additions & 1 deletion distro/pkg/deb/control
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ Build-Depends: cmake,
libssh-dev,
libssl-dev,
libsysrepo-dev (>= 2.0.0),
libyang2-dev (>= 2.0.0),
libyang-dev (>= 2.0.0),
pkg-config,
sysrepo-tools (>= 2.0.0),
libcurl4-openssl-dev (>= 7.30.0)
Homepage: https://github.com/CESNET/netopeer2/

Package: netopeer2
Depends: openssl,
passwd,
${misc:Depends},
${shlibs:Depends}
Section: admin
Expand Down
14 changes: 2 additions & 12 deletions distro/pkg/deb/netopeer2.postinst
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/bin/sh
# postinst script for netopeer2
#
# see: dh_installdeb(1)

set -e

Expand All @@ -20,20 +17,13 @@ set -e

case "$1" in
configure)
if ! getent group netconf > /dev/null; then
addgroup --quiet --system netconf
fi
env - \
NP2_MODULE_DIR=/usr/share/yang/modules/netopeer2 \
NP2_MODULE_PERMS=660 \
NP2_MODULE_PERMS=640 \
NP2_MODULE_OWNER=root \
NP2_MODULE_GROUP=netconf \
NP2_MODULE_GROUP=sysrepo \
LN2_MODULE_DIR=/usr/share/yang/modules/libnetconf2 \
bash /usr/share/netopeer2/scripts/setup.sh
env - \
bash /usr/share/netopeer2/scripts/merge_hostkey.sh
env - \
bash /usr/share/netopeer2/scripts/merge_config.sh
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
27 changes: 27 additions & 0 deletions distro/pkg/deb/netopeer2.preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

set -e


case "$1" in
install)
if ! groups root | grep sysrepo > /dev/null; then
usermod -G sysrepo -a root
fi
;;

upgrade|abort-upgrade)
;;

*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
15 changes: 0 additions & 15 deletions distro/pkg/deb/netopeer2.prerm
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/bin/sh
# prerm script for netopeer2
#
# see: dh_installdeb(1)

set -e

Expand All @@ -20,20 +17,8 @@ set -e


case "$1" in
purge)
if [ -x "$(command -v delgroup)" ]; then
delgroup --quiet --system netconf > /dev/null || true
else
echo >&2 "not removing netconf system group because delgroup command was not found"
fi
;;
remove)
env - \
SYSREPOCTL_EXECUTABLE=sysrepoctl \
NP2_MODULE_DIR=/usr/share/yang/modules/netopeer2 \
NP2_MODULE_PERMS=660 \
NP2_MODULE_OWNER=root \
NP2_MODULE_GROUP=netconf \
bash /usr/share/netopeer2/scripts/remove.sh
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
Expand Down
8 changes: 1 addition & 7 deletions distro/pkg/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,15 @@ CXXFLAGS+=$(CPPFLAGS)
# be strict when comparing symbols in netopeer2-1
export DPKG_GENSYMBOLS_CHECK_LEVEL=4

# use the executable from the system
SYSREPOCFG_EXECUTABLE=/usr/bin/sysrepoctl

%:
dh $@ --buildsystem=cmake --builddir=build

override_dh_auto_configure:
dh_auto_configure --builddir=build -- -DBUILD_CLI=ON -DBUILD_TESTS=ON -DSYSREPO_SETUP=OFF -DPIDFILE_PREFIX=/run -DSERVER_DIR=/var/lib/netopeer2
dh_auto_configure --builddir=build -- -DCMAKE_BUILD_TYPE="Release" -DENABLE_TESTS=OFF -DBUILD_CLI=ON -DSYSREPO_SETUP=OFF -DPIDFILE_PREFIX=/run -DSERVER_DIR=/var/lib/netopeer2

override_dh_auto_install:
dh_auto_install --builddir=build --destdir=$(CURDIR)/debian/tmp

override_dh_missing:
dh_missing --fail-missing

override_dh_auto_test:
dh_auto_test --builddir=build || ( make -C build test_clean; exit 1; )
make -C build test_clean
2 changes: 0 additions & 2 deletions distro/pkg/rpm/netopeer2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ export NP2_MODULE_OWNER=root
export LN2_MODULE_DIR=%{_datadir}/yang/modules/libnetconf2

%{_datadir}/netopeer2/scripts/setup.sh
%{_datadir}/netopeer2/scripts/merge_hostkey.sh
%{_datadir}/netopeer2/scripts/merge_config.sh

%systemd_post netopeer2-server.service

Expand Down
5 changes: 1 addition & 4 deletions distro/scripts/make-archive.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash
# create archive from current source using git

VERSION=$(git describe --tags --always)
# skip "v" from start of version number (if it exists) and replace - with .
VERSION=${VERSION#v}
VERSION=${VERSION//[-]/.}
VERSION=$(git log --oneline -n1 --grep="^VERSION" | rev | cut -d' ' -f1 | rev)

NAMEVER=netopeer2-$VERSION
ARCHIVE=$NAMEVER.tar.gz
Expand Down

0 comments on commit 3553179

Please sign in to comment.