Skip to content

Commit

Permalink
New version 1.0 :-)
Browse files Browse the repository at this point in the history
Signed-off-by: Erez Geva <[email protected]>
  • Loading branch information
erezgeva committed Nov 22, 2022
1 parent a8d4a3b commit a21ee7f
Show file tree
Hide file tree
Showing 27 changed files with 314 additions and 85 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ perl_SFLAGS+=-Iswig/perl5
$(foreach n,lua php tcl,$(eval $(n)_SFLAGS+=-Iswig/$n))
endif #SWIGARGCARGV

# suppress swig compilation warnings for old swig versions
ifneq ($(call verCheck,$(SWIGVER),4.1),)
# SWIG warnings
# comparison integer of different signedness
CXXFLAGS_RUBY+=-Wno-sign-compare
# suppress swig compilation warnings for old swig versions
ifneq ($(call verCheck,$(SWIGVER),4.1),)
# ANYARGS is deprecated (seems related to ruby headers)
CXXFLAGS_RUBY+=-Wno-deprecated-declarations
# label 'thrown' is not used
Expand Down
8 changes: 3 additions & 5 deletions archlinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
# @copyright 2021 Erez Geva
#
# Docker file for Arch Linux contianer for building and create packages
# Search packages at: https://archlinux.org/packages/
###############################################################################
FROM archlinux
MAINTAINER "Erez Geva" <[email protected]>
ARG UID
ARG USER
RUN patched_glibc=glibc-linux4-2.35-2-x86_64.pkg.tar.zst &&\
curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" &&\
bsdtar -C / -xvf "$patched_glibc" &&\
pacman -Syu --noconfirm --needed bash rustup gcc fakeroot pkgconf libtool\
RUN pacman -Syu --noconfirm --needed bash rustup gcc fakeroot pkgconf libtool\
autoconf which make git sudo doxygen graphviz perl ruby swig python3\
lua lua51 lua52 lua53 vim tcl json-c php m4 &&\
lua lua51 lua52 lua53 vim tcl json-c php m4 gtest texlive-core &&\
useradd $USER -u $UID -m -G users,wheel &&\
echo "$USER ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
USER $USER
Expand Down
2 changes: 1 addition & 1 deletion archlinux/PKGBUILD.org
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# @copyright 2021 Erez Geva
#
###############################################################################
pkgver=0.9
pkgver=1.0
pkgrel=1
pkgname=(libptpmgmt libptpmgmt-jsonc libptpmgmt-dev libptpmgmt-doc
libptpmgmt-perl lua-ptpmgmt ruby-ptpmgmt tcl-ptpmgmt
Expand Down
66 changes: 66 additions & 0 deletions archlinux/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@
* Mon Nov 21 2022 [email protected] 1.0-1
- Project uses 5 script languages, 2 JSON libraries,
support 3 Linux distribution and support cross compilation.
- Add autoconf configuration as most distribution provide autoconf
probing of current system.
- Remove all options from make file that are probed or
set by the configuration script.
- Add unit tests
- ptpmgmt library
- scripts languages Message dispatcher and builder classes
- Json to messages
- load Json to messages libraries
- Build
- Split make file
- Catch Doxygen warning and exit with error.
- Add unit test main to the unit test make file.
- Improve format script and exit with error on error.
- Probe astyle change and exit with error.
So we can use the make format goal in
a continuous integration checking container.
- Check for dot application to use with doxygen.
- Fix clean.
- Update source files list for archive.
- Fix installed man pages file mode.
- Prevent copy of man pages on seconds install.
- Add all markdown documentation to documentation package.
- Add update_doxygen.pl script file header.
- Fix Doxygen configuration.
- Update Doxygen to version 1.9.1
- Improve Doxygen handling.
- testing
- Fix Lua using local library.
- Improve testing.
- Run all testing from root folder.
- Use system libraries only if specify with a flag.
- Add rule to run default configuration of distribution system.
- Add Message Builder Base C++ class to Lua.
The C++ class destructor free the send TLV in the message object.
- Debian Bookworm have a installation bug with GCC C++ cross compiler.
- Add CI script to run all steps needed in CI:
- check licenses with reuse tool
- build Debian packages
- pass format and Doxygen
- run unit tests
- verify no left over after clean and distribution clean.
- The system test and build packages on other distribution is done
out side CI.
- Merge headers used during compilation only,
into a single compilation only header.
The compilation header is used during compilation only,
and do not hold any public API.
- Add a new error class to store the last error happened in the library.
The library do not print the error to standard error no longer.
It is up to the application how to handle the error.
- Improve error in: socket, PTP and clock classes.
- Rebase binary class to support operator [] with reference.
- Add support for Debian bookworm.
- Add docker for Debian to use on github CI.
- Create the version header by the make file.
So we have only one configuration file created by configure.
All the reset is created by the make file.
- Fix tcl library package version in index file.
- Fix Perl library folder location.
- Move source code and objects to sub-folders.
- Replace GCC prepossess with m4 to generate headers files.

* Tue Jul 26 2022 [email protected] 0.9-1
- Add header to define the C++ namespace.
- Swig generated code
Expand Down
5 changes: 3 additions & 2 deletions archlinux/make_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ clean_unused_images()
make_all_args()
{
local arg
for arg in USER SRC UID
for arg in USER SRC
do local -n n=$arg;args+=" --build-arg $arg=$n";done
args+=" --build-arg UID=$uid"
}
main()
{
local -r base_dir=$(dirname $(realpath $0))
local -r name=pacmanbuild
local -r USER=builder
local -r SRC=.
local -r UID=$(id -u)
local -r uid=$(id -u)
cd $base_dir/..
while getopts 'n' opt; do
case $opt in
Expand Down
10 changes: 8 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,8 @@ AS_HELP_STRING([--with-php=path], [Set location of PHP executable])],
AS_IF([test -z "$SWIGMINVER"],
[AS_VAR_SET([PHPBIN], ["no"])],
[AS_VERSION_COMPARE([$SWIGMINVER], [3.0.12],
[AS_VAR_SET([PHPBIN], ["no"])])]) # below 3.0.12
[AS_VAR_SET([PHPBIN], ["no"])], # below 3.0.12
[AS_VAR_SET([PHPBIN], ["no"])])]) # equal 3.0.12

# First, check for "--without-php" or "--with-php=no".
if test "x$PHPBIN" = xno; then
Expand Down Expand Up @@ -841,6 +842,7 @@ AS_UNSET([LUALIB])
AS_UNSET([LUA_INC])
AS_UNSET([LUALINK])
AS_UNSET([LUAVERSIONS])
AS_UNSET([LUAVERSIONS_UNIT])
AS_UNSET([LUA_5_1_INC])
AS_UNSET([LUA_5_2_INC])
AS_UNSET([LUA_5_3_INC])
Expand Down Expand Up @@ -888,7 +890,10 @@ else
AS_VAR_SET([tag], [`echo $name | $SED 's%\.%_%'`])
AS_VAR_SET([LUA_${tag}_INC], ["$v"])
AS_VAR_SET([LUA_${tag}_LINK], ["-llua$name"])
AS_VAR_SET([LUAVERSIONS], ["$LUAVERSIONS $name"])])
AS_VAR_SET([LUAVERSIONS], ["$LUAVERSIONS $name"])
AS_IF([lua$name -e "require 'luaunit'" 2>/dev/null],
[AS_VAR_SET([LUAVERSIONS_UNIT],
["$LUAVERSIONS_UNIT $name"])])])
done
done])

Expand Down Expand Up @@ -972,6 +977,7 @@ AC_SUBST([LUABIN_VERSION])
AC_SUBST([LUA_INC])
AC_SUBST([LUALINK])
AC_SUBST([LUAVERSIONS])
AC_SUBST([LUAVERSIONS_UNIT])
AC_SUBST([LUA_5_1_INC])
AC_SUBST([LUA_5_2_INC])
AC_SUBST([LUA_5_3_INC])
Expand Down
69 changes: 69 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,72 @@
libptpmgmt (1.0) bullseye; urgency=medium

* Project uses 5 script languages, 2 JSON libraries,
support 3 Linux distribution and support cross compilation.
* Add autoconf configuration as most distribution provide autoconf
probing of current system.
* Remove all options from make file that are probed or
set by the configuration script.
* Add unit tests
- ptpmgmt library
- scripts languages Message dispatcher and builder classes
- Json to messages
- load Json to messages libraries
* Build
- Split make file
- Catch Doxygen warning and exit with error.
- Add unit test main to the unit test make file.
- Improve format script and exit with error on error.
- Probe astyle change and exit with error.
So we can use the make format goal in
a continuous integration checking container.
- Check for dot application to use with doxygen.
- Fix clean.
- Update source files list for archive.
- Fix installed man pages file mode.
- Prevent copy of man pages on seconds install.
- Add all markdown documentation to documentation package.
* Add update_doxygen.pl script file header.
* Fix Doxygen configuration.
* Update Doxygen to version 1.9.1
* Improve Doxygen handling.
* testing
- Fix Lua using local library.
- Improve testing.
- Run all testing from root folder.
- Use system libraries only if specify with a flag.
- Add rule to run default configuration of distribution system.
* Add Message Builder Base C++ class to Lua.
The C++ class destructor free the send TLV in the message object.
* Debian Bookworm have a installation bug with GCC C++ cross compiler.
* Add CI script to run all steps needed in CI:
- check licenses with reuse tool
- build Debian packages
- pass format and Doxygen
- run unit tests
- verify no left over after clean and distribution clean.
- The system test and build packages on other distribution is done
out side CI.
* Merge headers used during compilation only,
into a single compilation only header.
The compilation header is used during compilation only,
and do not hold any public API.
* Add a new error class to store the last error happened in the library.
The library do not print the error to standard error no longer.
It is up to the application how to handle the error.
* Improve error in: socket, PTP and clock classes.
* Rebase binary class to support operator [] with reference.
* Add support for Debian bookworm.
* Add docker for Debian to use on github CI.
* Create the version header by the make file.
So we have only one configuration file created by configure.
All the reset is created by the make file.
* Fix tcl library package version in index file.
* Fix Perl library folder location.
* Move source code and objects to sub-folders.
* Replace GCC prepossess with m4 to generate headers files.

-- Erez Geva <[email protected]> Mon, 21 Nov 2022 22:05:27 +0100

libptpmgmt (0.9) bullseye; urgency=medium

* Add header to define the C++ namespace.
Expand Down
2 changes: 0 additions & 2 deletions debian/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ main()
equit "Configuratation fails"
# Run syntax checking
make checkall -j$jobs
# Make sure we have all compiled for the unit tests
make -j$jobs
echo " * Run unit test"
eacmd make utest -j$jobs
equit "Unit test fails"
Expand Down
19 changes: 8 additions & 11 deletions debian/make_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ clean_unused_images()
make_all_args()
{
local arg
for arg in USER SRC UID ARCHS
for arg in USER SRC ARCHS
do local -n d=$arg;args+=" --build-arg $arg=$d";done
args+=" --build-arg UID=$uid"
}
set_dist_args()
{
Expand Down Expand Up @@ -66,10 +67,10 @@ main()
local -r ARCHS='arm64'
local -r USER=builder
local -r lua54='lua5.4 liblua5.4-dev@'
local DPKGS_stretch='vim-gtk'
local DPKGS_buster='vim-gtk'
local DPKGS_bullseye="vim-gtk $lua54"
local DPKGS_bookworm="reuse vim-gtk3 $lua54"
local -r DPKGS_stretch='vim-gtk'
local -r DPKGS_buster='vim-gtk'
local -r DPKGS_bullseye="vim-gtk $lua54"
local -r DPKGS_bookworm="reuse vim-gtk3 $lua54"
# Packages per architecture
for n in libstdc++6 liblua5.1-0-dev liblua5.2-dev liblua5.3-dev\
libpython3-all-dev ruby-dev tcl-dev libpython3-dev\
Expand All @@ -83,14 +84,10 @@ main()
done
for a in $ARCHS; do
n="$(dpkg-architecture -a$a -qDEB_TARGET_GNU_TYPE 2> /dev/null)"
# TODO: bookworm have a bug
DPKGS_stretch+=" g++-$n"
DPKGS_buster+=" g++-$n"
DPKGS_bullseye+=" g++-$n"
#DPKGS_all+=" g++-$n"
DPKGS_all+=" g++-$n"
done
local -r SRC=.
local -r UID=$(id -u)
local -r uid=$(id -u)
cd $base_dir/..
while getopts 'n' opt; do
case $opt in
Expand Down
1 change: 1 addition & 0 deletions defs.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ LUABIN_VERSION:=@LUABIN_VERSION@
LUA_INC:=@LUA_INC@
LUALINK:=@LUALINK@
LUAVERSIONS:=@LUAVERSIONS@
LUAVERSIONS_UNIT:=@LUAVERSIONS_UNIT@
LUA_5_1_INC:=@LUA_5_1_INC@
LUA_5_2_INC:=@LUA_5_2_INC@
LUA_5_3_INC:=@LUA_5_3_INC@
Expand Down
4 changes: 2 additions & 2 deletions lua/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ utest_lua_a: $(LIB_NAME_SO) $(LUA_LIB)
$(call Q_UTEST,Lua)LD_PRELOAD=./$< LUA_CPATH="lua/?.so;;" $(LUABIN)\
lua/utest.lua $(LUA_FILTERS)
endif # LUA_VERSION
utest_lua: utest_lua_a $(foreach n,$(filter-out 5.4,$(LUAVERSIONS)),utest_lua_$n)
utest_lua: utest_lua_a $(foreach n,$(LUAVERSIONS_UNIT),utest_lua_$n)

install_lua:
$(foreach n,$(LUAVERSIONS),\
$Q$(foreach n,$(LUAVERSIONS),\
$(INSTALL_PROGRAM) -D $(LUA_LIB_$n)\
$(DLIBDIR)/$(LUA_FLIB_$n).$(PACKAGE_VERSION);\
$(LN) $(LUA_FLIB_$n).$(PACKAGE_VERSION)\
Expand Down
2 changes: 2 additions & 0 deletions new_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ main()
sed -i -e "s/^\(Version:\s*\).*/\1$next_ver/"\
-e "s/\.so\.[0-9]*{/.so.$next_maj_ver{/" rpm/libptpmgmt.spec
sed -i "s/^pkgver=.*/pkgver=$next_ver/" archlinux/PKGBUILD.org
# TODO tcl do not find the library major version.
#sed -i "s/ver_maj=[0-9][0-9]*/ver_maj=$next_maj_ver/" tcl/pkgIndex_tcl.sh
if [[ "$update_only" != "true" ]]; then
local -r hash=$(git blame debian/changelog | head -n1 | sed 's/ .*//')
local -a log
Expand Down
2 changes: 1 addition & 1 deletion perl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ utest_perl5: $(LIB_NAME_SO) $(PERL_SO_DIR)/$(SWIG_NAME).so
$(call Q_UTEST,Perl5)LD_PRELOAD=./$< PERL5LIB=perl perl/utest.pl

install_perl5:
$(INSTALL_PROGRAM) -D perl/auto/*/*.so -t\
$Q$(INSTALL_PROGRAM) -D perl/auto/*/*.so -t\
$(DESTDIR)$(PERL5DIR)/auto/$(SWIG_NAME)
$(INSTALL_DATA) perl/*.pm $(DESTDIR)$(PERL5DIR)
2 changes: 1 addition & 1 deletion php/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ utest_php: $(LIB_NAME_SO) $(PHP_LNAME).so php/php.ini
$(PHP_NO_COL) $(PHP_FILTERS)

install_php:
$(INSTALL_PROGRAM) -D $(PHP_LNAME).so -t $(DESTDIR)$(PHPEXT)
$Q$(INSTALL_PROGRAM) -D $(PHP_LNAME).so -t $(DESTDIR)$(PHPEXT)
$(INSTALL_DATA) -D $(PHP_LNAME).php -t $(DESTDIR)$(PHPINCDIR)
2 changes: 1 addition & 1 deletion python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ utest_python3: $(LIB_NAME_SO) $(PY_SO_3)
python/utest.py $(PY_FILTERS)

install_python3:
$(INSTALL_PROGRAM) -D python/3/$(PY_LIB_NAME).so\
$Q$(INSTALL_PROGRAM) -D python/3/$(PY_LIB_NAME).so\
$(DESTDIR)$(PY3SITE_DIR)/$(PY_LIB_NAME)$(PY3EXT)
$(INSTALL_DATA) python/$(SWIG_LNAME).py $(DESTDIR)$(PY3SITE_DIR)
4 changes: 0 additions & 4 deletions python/utest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
# See: https://wiki.python.org/moin/PyUnit

class myDisp(ptpmgmt.MessageDispatcher):
priority1 :int
func : int
id : str
def __init__(self):
self.priority1 = 0
self.func = 0
Expand All @@ -31,7 +28,6 @@ def noTlvCallBack(self, msg, tlv_id):
self.func |= 0x4
self.id = tlv_id
class myBuild(ptpmgmt.MessageBuilder):
run : int
def PRIORITY1_b(self, msg, tlv):
self.run = 1
tlv.priority1 = 117
Expand Down
4 changes: 3 additions & 1 deletion rpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# @copyright 2021 Erez Geva
#
# Docker file for Fedora contianer for building and create rpm packages
# Search packages at: https://packages.fedoraproject.org/
###############################################################################
FROM fedora
MAINTAINER "Erez Geva" <[email protected]>
Expand All @@ -15,7 +16,8 @@ RUN dnf install -y gcc gcc-c++ libtool libtool-ltdl make cmake git pkgconfig\
rpmdevtools doxygen graphviz perl php-devel ruby ruby-devel swig\
lua lua-devel python3-devel php python3 which gtest-devel gtest\
perl-devel perl-ExtUtils-Embed lua-posix tcl tcl-devel libfastjson\
libfastjson-devel json-c-devel m4 && dnf clean all &&\
libfastjson-devel json-c-devel m4 rubygem-test-unit perl-Test-Class\
texlive-epstopdf ghostscript && dnf clean all &&\
sed -i 's/^enable_dl\s*=\s*Off/enable_dl = On/' /etc/php.ini &&\
useradd $USER -u $UID -m -G users,wheel &&\
echo "$USER ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
Expand Down
Loading

0 comments on commit a21ee7f

Please sign in to comment.