Removed extras/ and build-root/ code since they are not properly maintained
This commit is contained in:
parent
b39ee078c4
commit
ca697c9a36
8 changed files with 3 additions and 205 deletions
|
|
@ -65,6 +65,7 @@ Developers may need to change their code
|
||||||
|
|
||||||
### Minor features
|
### Minor features
|
||||||
|
|
||||||
|
* Removed extras/ and build-root/ build code since they are not properly maintained
|
||||||
* Refactored cli-syntax code to use cligen pt_head instead (long overdue)
|
* Refactored cli-syntax code to use cligen pt_head instead (long overdue)
|
||||||
* Modified backend exit strategy so that 2nd ^C actually exits
|
* Modified backend exit strategy so that 2nd ^C actually exits
|
||||||
* Performance: A change in the `merge` code made "co-located" config and non-config get retrieval go considerable faster. This is done by a specialized `xml_child_each_attr()` function.
|
* Performance: A change in the `merge` code made "co-located" config and non-config get retrieval go considerable faster. This is done by a specialized `xml_child_each_attr()` function.
|
||||||
|
|
|
||||||
42
Makefile.in
42
Makefile.in
|
|
@ -155,50 +155,10 @@ mrproper: uninstall uninstall-example uninstall-util clean clean-example clean-u
|
||||||
|
|
||||||
distclean:
|
distclean:
|
||||||
rm -f Makefile TAGS config.status config.log *~ .depend
|
rm -f Makefile TAGS config.status config.log *~ .depend
|
||||||
rm -rf autom4te.cache build-root/rpmbuild
|
rm -rf autom4te.cache
|
||||||
rm -f build-root/*.tar.xz build-root/*.rpm extras/rpm/Makefile
|
|
||||||
for i in $(SUBDIRS) doc example util docker; \
|
for i in $(SUBDIRS) doc example util docker; \
|
||||||
do (cd $$i && $(MAKE) $(MFLAGS) $@); done
|
do (cd $$i && $(MAKE) $(MFLAGS) $@); done
|
||||||
|
|
||||||
export BR=$(CURDIR)/build-root
|
|
||||||
|
|
||||||
$(BR)/scripts/.version:
|
|
||||||
ifneq ("$(wildcard /etc/redhat-release)","")
|
|
||||||
$(shell $(BR)/scripts/version rpm-string > $(BR)/scripts/.version)
|
|
||||||
else
|
|
||||||
$(shell $(BR)/scripts/version > $(BR)/scripts/.version)
|
|
||||||
endif
|
|
||||||
|
|
||||||
DIST_FILE = $(BR)/clixon-$(shell extras/scripts/version).tar
|
|
||||||
DIST_SUBDIR = clixon-$(shell extras/scripts/version | cut -f1 -d-)
|
|
||||||
|
|
||||||
dist:
|
|
||||||
@if git rev-parse 2> /dev/null ; then \
|
|
||||||
git archive \
|
|
||||||
--prefix=$(DIST_SUBDIR)/ \
|
|
||||||
--format=tar \
|
|
||||||
-o $(DIST_FILE) \
|
|
||||||
HEAD ; \
|
|
||||||
git describe > $(BR)/.version ; \
|
|
||||||
else \
|
|
||||||
(cd .. ; tar -cf $(DIST_FILE) $(DIST_SUBDIR) --exclude=*.tar) ; \
|
|
||||||
extras/scripts/version > $(BR)/.version ; \
|
|
||||||
fi
|
|
||||||
@tar --append \
|
|
||||||
--file $(DIST_FILE) \
|
|
||||||
--transform='s,.*/.version,$(DIST_SUBDIR)/extras/scripts/.version,' \
|
|
||||||
$(BR)/.version
|
|
||||||
@$(RM) $(BR)/.version $(DIST_FILE).xz
|
|
||||||
@xz -v --threads=0 $(DIST_FILE)
|
|
||||||
@$(RM) $(BR)/clixon-latest.tar.xz
|
|
||||||
@ln -rs $(DIST_FILE).xz $(BR)/clixon-latest.tar.xz
|
|
||||||
|
|
||||||
pkg-rpm: dist
|
|
||||||
make -C extras/rpm
|
|
||||||
|
|
||||||
pkg-srpm: dist
|
|
||||||
make -C extras/rpm srpm
|
|
||||||
|
|
||||||
# To make the example you need to run the "install-include" target first
|
# To make the example you need to run the "install-include" target first
|
||||||
example: checkinstall util warnroot
|
example: checkinstall util warnroot
|
||||||
(cd $@ && $(MAKE) $(MFLAGS) all)
|
(cd $@ && $(MAKE) $(MFLAGS) all)
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
../../extras/scripts/version
|
|
||||||
3
configure
vendored
3
configure
vendored
|
|
@ -6705,7 +6705,7 @@ LIBDIR=`eval echo $libdir`
|
||||||
LIBDIR=`eval echo $LIBDIR`
|
LIBDIR=`eval echo $LIBDIR`
|
||||||
LOCALSTATEDIR=`eval echo $localstatedir`
|
LOCALSTATEDIR=`eval echo $localstatedir`
|
||||||
|
|
||||||
ac_config_files="$ac_config_files Makefile lib/Makefile lib/src/Makefile lib/clixon/Makefile apps/Makefile apps/cli/Makefile apps/backend/Makefile apps/netconf/Makefile apps/restconf/Makefile apps/snmp/Makefile include/Makefile etc/Makefile etc/clixonrc example/Makefile example/main/Makefile example/main/example.xml extras/rpm/Makefile docker/Makefile docker/clixon-dev/Makefile docker/example/Makefile docker/test/Makefile util/Makefile yang/Makefile yang/clixon/Makefile yang/mandatory/Makefile doc/Makefile test/Makefile test/config.sh test/cicd/Makefile test/vagrant/Makefile"
|
ac_config_files="$ac_config_files Makefile lib/Makefile lib/src/Makefile lib/clixon/Makefile apps/Makefile apps/cli/Makefile apps/backend/Makefile apps/netconf/Makefile apps/restconf/Makefile apps/snmp/Makefile include/Makefile etc/Makefile etc/clixonrc example/Makefile example/main/Makefile example/main/example.xml docker/Makefile docker/clixon-dev/Makefile docker/example/Makefile docker/test/Makefile util/Makefile yang/Makefile yang/clixon/Makefile yang/mandatory/Makefile doc/Makefile test/Makefile test/config.sh test/cicd/Makefile test/vagrant/Makefile"
|
||||||
|
|
||||||
cat >confcache <<\_ACEOF
|
cat >confcache <<\_ACEOF
|
||||||
# This file is a shell script that caches the results of configure
|
# This file is a shell script that caches the results of configure
|
||||||
|
|
@ -7410,7 +7410,6 @@ do
|
||||||
"example/Makefile") CONFIG_FILES="$CONFIG_FILES example/Makefile" ;;
|
"example/Makefile") CONFIG_FILES="$CONFIG_FILES example/Makefile" ;;
|
||||||
"example/main/Makefile") CONFIG_FILES="$CONFIG_FILES example/main/Makefile" ;;
|
"example/main/Makefile") CONFIG_FILES="$CONFIG_FILES example/main/Makefile" ;;
|
||||||
"example/main/example.xml") CONFIG_FILES="$CONFIG_FILES example/main/example.xml" ;;
|
"example/main/example.xml") CONFIG_FILES="$CONFIG_FILES example/main/example.xml" ;;
|
||||||
"extras/rpm/Makefile") CONFIG_FILES="$CONFIG_FILES extras/rpm/Makefile" ;;
|
|
||||||
"docker/Makefile") CONFIG_FILES="$CONFIG_FILES docker/Makefile" ;;
|
"docker/Makefile") CONFIG_FILES="$CONFIG_FILES docker/Makefile" ;;
|
||||||
"docker/clixon-dev/Makefile") CONFIG_FILES="$CONFIG_FILES docker/clixon-dev/Makefile" ;;
|
"docker/clixon-dev/Makefile") CONFIG_FILES="$CONFIG_FILES docker/clixon-dev/Makefile" ;;
|
||||||
"docker/example/Makefile") CONFIG_FILES="$CONFIG_FILES docker/example/Makefile" ;;
|
"docker/example/Makefile") CONFIG_FILES="$CONFIG_FILES docker/example/Makefile" ;;
|
||||||
|
|
|
||||||
|
|
@ -427,7 +427,6 @@ AC_CONFIG_FILES([Makefile
|
||||||
example/Makefile
|
example/Makefile
|
||||||
example/main/Makefile
|
example/main/Makefile
|
||||||
example/main/example.xml
|
example/main/example.xml
|
||||||
extras/rpm/Makefile
|
|
||||||
docker/Makefile
|
docker/Makefile
|
||||||
docker/clixon-dev/Makefile
|
docker/clixon-dev/Makefile
|
||||||
docker/example/Makefile
|
docker/example/Makefile
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
TARBALL=$(shell realpath ../../build-root/clixon-latest.tar.xz)
|
|
||||||
BASENAME=$(shell basename $(TARBALL) | sed -e s/.tar.\*//)
|
|
||||||
VERSION=$(shell echo $(BASENAME) | cut -f2 -d-)
|
|
||||||
RELEASE=$(shell echo $(BASENAME) | cut -f3- -d- | sed -e s/-/_/g)
|
|
||||||
BR=$(shell realpath $(CURDIR)/../../build-root)
|
|
||||||
RPMBUILD=$(BR)/rpmbuild
|
|
||||||
|
|
||||||
all: RPM
|
|
||||||
|
|
||||||
spec:
|
|
||||||
@echo $(TARBALL)
|
|
||||||
mkdir -p $(RPMBUILD)/{RPMS,SRPMS,BUILD,SOURCES,SPECS}
|
|
||||||
cp $(TARBALL) $(RPMBUILD)/SOURCES/clixon-$(VERSION)-$(RELEASE).tar.xz
|
|
||||||
cp clixon.spec $(RPMBUILD)/SPECS
|
|
||||||
|
|
||||||
srpm: spec
|
|
||||||
rpmbuild -bs \
|
|
||||||
--define "cligen_prefix @CLIGEN_PREFIX@" \
|
|
||||||
--define "_topdir $(RPMBUILD)" \
|
|
||||||
--define "_version $(VERSION)" \
|
|
||||||
--define "_release $(RELEASE)" \
|
|
||||||
$(RPMBUILD)/SPECS/clixon.spec
|
|
||||||
mv $$(find $(RPMBUILD)/SRPMS -name \*.src.rpm -type f) $(BR)
|
|
||||||
|
|
||||||
# Define DEVELOPER environmrnt variable to prevent .spec to add cligent to the
|
|
||||||
# list of build requirements
|
|
||||||
RPM: spec
|
|
||||||
rpmbuild -bb \
|
|
||||||
--define "cligen_prefix @CLIGEN_PREFIX@" \
|
|
||||||
$${DEVELOPER:+--define "developer yes"} \
|
|
||||||
--define "_topdir $(RPMBUILD)" \
|
|
||||||
--define "_version $(VERSION)" \
|
|
||||||
--define "_release $(RELEASE)" \
|
|
||||||
$(RPMBUILD)/SPECS/clixon.spec
|
|
||||||
mv $$(find $(RPMBUILD)/RPMS -name \*.rpm -type f) $(BR)
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
%{!?_topdir: %define _topdir %(pwd)}
|
|
||||||
%{!?cligen_prefix: %define cligen_prefix %{_prefix}}
|
|
||||||
|
|
||||||
Name: clixon
|
|
||||||
Version: %{_version}
|
|
||||||
Release: %{_release}
|
|
||||||
Summary: The XML-based command line processing tool CLIXON
|
|
||||||
Group: System Environment/Libraries
|
|
||||||
License: ASL 2.0 or GPLv2
|
|
||||||
URL: http://www.clicon.org
|
|
||||||
AutoReq: no
|
|
||||||
BuildRequires: flex, bison
|
|
||||||
Requires: cligen, fcgi
|
|
||||||
|
|
||||||
# Sometimes developers want to build it without installing cligen but passing
|
|
||||||
# path using --with-cligen and pointing it to cligen buildroot. Use %{developer}
|
|
||||||
# macro for these cases
|
|
||||||
%if 0%{!?developer:1}
|
|
||||||
BuildRequires: cligen
|
|
||||||
%endif
|
|
||||||
|
|
||||||
Source: %{name}-%{version}-%{release}.tar.xz
|
|
||||||
|
|
||||||
%description
|
|
||||||
The XML-based command line processing tool CLIXON.
|
|
||||||
|
|
||||||
%package devel
|
|
||||||
Summary: CLIXON header files
|
|
||||||
Group: Development/Libraries
|
|
||||||
Requires: clixon
|
|
||||||
|
|
||||||
%description devel
|
|
||||||
This package contains header files for CLIXON.
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup
|
|
||||||
|
|
||||||
%build
|
|
||||||
%configure --with-cligen=%{cligen_prefix}
|
|
||||||
make
|
|
||||||
|
|
||||||
%install
|
|
||||||
make DESTDIR=${RPM_BUILD_ROOT} install install-include
|
|
||||||
|
|
||||||
%files
|
|
||||||
%{_libdir}/*
|
|
||||||
%{_bindir}/*
|
|
||||||
%{_sbindir}/*
|
|
||||||
#%{_sysconfdir}/*
|
|
||||||
%{_datadir}/%{name}/*
|
|
||||||
/www-data/clixon_restconf
|
|
||||||
|
|
||||||
%files devel
|
|
||||||
%{_includedir}/%{name}/*
|
|
||||||
|
|
||||||
%clean
|
|
||||||
|
|
||||||
%post
|
|
||||||
/sbin/ldconfig
|
|
||||||
|
|
||||||
caps="cap_setuid,cap_fowner,cap_chown,cap_dac_override"
|
|
||||||
caps="${caps},cap_kill,cap_net_admin,cap_net_bind_service"
|
|
||||||
caps="${caps},cap_net_broadcast,cap_net_raw"
|
|
||||||
|
|
||||||
if [ -x /usr/sbin/setcap ]; then
|
|
||||||
/usr/sbin/setcap ${caps}=ep %{_bindir}/clixon_cli
|
|
||||||
/usr/sbin/setcap ${caps}=ep %{_bindir}/clixon_netconf
|
|
||||||
/usr/sbin/setcap ${caps}=ep %{_sbindir}/clixon_backend
|
|
||||||
fi
|
|
||||||
|
|
||||||
%postun
|
|
||||||
/sbin/ldconfig
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# Obtained from VPP - https://wiki.fd.io/view/VPP
|
|
||||||
#
|
|
||||||
|
|
||||||
path=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )
|
|
||||||
|
|
||||||
cd "$path"
|
|
||||||
|
|
||||||
if [ -f .version ]; then
|
|
||||||
vstring=$(cat .version)
|
|
||||||
else
|
|
||||||
vstring=$(git describe)
|
|
||||||
if [ $? != 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
TAG=$(echo ${vstring} | cut -d- -f1 | sed -e 's/^[vR]//')
|
|
||||||
ADD=$(echo ${vstring} | cut -s -d- -f2)
|
|
||||||
|
|
||||||
git rev-parse 2> /dev/null
|
|
||||||
if [ $? == 0 ]; then
|
|
||||||
CMT=$(git describe --dirty | cut -s -d- -f3,4)
|
|
||||||
else
|
|
||||||
CMT=$(echo ${vstring} | cut -s -d- -f3,4)
|
|
||||||
fi
|
|
||||||
CMTR=$(echo $CMT | sed 's/-/_/')
|
|
||||||
|
|
||||||
if [ -n "${BUILD_NUMBER}" ]; then
|
|
||||||
BLD="~b${BUILD_NUMBER}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$1" = "rpm-version" ]; then
|
|
||||||
echo ${TAG}
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$1" = "rpm-release" ]; then
|
|
||||||
[ -z "${ADD}" ] && echo release && exit
|
|
||||||
echo ${ADD}${CMTR:+~${CMTR}}${BLD}
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${ADD}" ]; then
|
|
||||||
if [ "$1" = "rpm-string" ]; then
|
|
||||||
echo ${TAG}-${ADD}${CMTR:+~${CMTR}}${BLD}
|
|
||||||
else
|
|
||||||
echo ${TAG}-${ADD}${CMT:+~${CMT}}${BLD}
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo ${TAG}-release
|
|
||||||
fi
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue