Make /var directory tree owned by $CLICON_GROUP

This commit is contained in:
Philip Prindeville 2023-09-11 15:29:21 -06:00 committed by Olof Hagsand
parent 3a2ffd4233
commit 951aa71d56
164 changed files with 348 additions and 345 deletions

View file

@ -52,6 +52,9 @@ localstatedir = @localstatedir@
libdir = @exec_prefix@/lib
APPNAME = example
CLICON_USER = @CLICON_USER@
CLICON_GROUP = @CLICON_GROUP@
# Here is where example yang appears
YANG_INSTALLDIR = @YANG_INSTALLDIR@
# Install here if you want default clixon location:
@ -169,8 +172,8 @@ distclean: clean
rm -f Makefile *~ .depend
install: $(YANGSPECS) $(CLISPECS) $(PLUGINS) $(APPNAME).xml
groupadd $(CLICON_GROUP)
useradd -M -s /usr/sbin/nologin -g $(CLICON_GROUP) $(CLICON_USER)
[ -n "$$(getent group "$(CLICON_GROUP)")" ] || groupadd "$(CLICON_GROUP)"
[ -n "$$(getent passwd "$(CLICON_USER)")" ] || useradd -M -s /usr/sbin/nologin -g "$(CLICON_GROUP)" "$(CLICON_USER)"
install -d -m 0755 $(DESTDIR)$(sysconfdir)
install -m 0644 $(APPNAME).xml $(DESTDIR)$(sysconfdir)
# install -m 0644 $(APPNAME).xml $(DESTDIR)$(CLIXON_DEFAULT_CONFIG)
@ -189,8 +192,8 @@ ifdef with_restconf
endif
install -d -m 0755 $(DESTDIR)$(libdir)/$(APPNAME)/clispec
install -m 0644 $(CLISPECS) $(DESTDIR)$(libdir)/$(APPNAME)/clispec
install -d -m 0755 $(DESTDIR)$(localstatedir)/$(APPNAME) # This is for XMLDB_DIR
install -d -m 0755 $(DESTDIR)$(localstatedir)/run # This is for PID and SOCK
install -d -m 0775 -g $(CLICON_GROUP) $(DESTDIR)$(localstatedir)/$(APPNAME) # This is for XMLDB_DIR
install -d -m 0775 -g $(CLICON_GROUP) $(DESTDIR)$(localstatedir)/run # This is for PID and SOCK
uninstall:
rm -rf $(DESTDIR)$(sysconfdir)/$(APPNAME).xml