rscada / libmbus

Meter-bus library and utility programs
http://www.rscada.se/libmbus
BSD 3-Clause "New" or "Revised" License
228 stars 141 forks source link

Debian build seems to be broken? #174

Open sjlongland opened 4 years ago

sjlongland commented 4 years ago

We're trying to build a binary .deb package for libmbus so we can distribute that instead of statically linking it. It would appear this build references files that no longer exist:

14-Jul-2020 16:07:00 | make[3]: Leaving directory '/mnt/src/obj-x86_64-linux-gnu'
-- | --
14-Jul-2020 16:07:00 | make -f CMakeFiles/libmbus.dir/build.make CMakeFiles/libmbus.dir/build
14-Jul-2020 16:07:00 | make[3]: Entering directory '/mnt/src/obj-x86_64-linux-gnu'
14-Jul-2020 16:07:00 | make[3]: Nothing to be done for 'CMakeFiles/libmbus.dir/build'.
14-Jul-2020 16:07:00 | make[3]: Leaving directory '/mnt/src/obj-x86_64-linux-gnu'
14-Jul-2020 16:07:00 | [100%] Built target libmbus
14-Jul-2020 16:07:00 | make[2]: Leaving directory '/mnt/src/obj-x86_64-linux-gnu'
14-Jul-2020 16:07:00 | /usr/bin/cmake -E cmake_progress_start /mnt/src/obj-x86_64-linux-gnu/CMakeFiles 0
14-Jul-2020 16:07:00 | make -f CMakeFiles/Makefile2 preinstall
14-Jul-2020 16:07:00 | make[2]: Entering directory '/mnt/src/obj-x86_64-linux-gnu'
14-Jul-2020 16:07:00 | make[2]: Nothing to be done for 'preinstall'.
14-Jul-2020 16:07:00 | make[2]: Leaving directory '/mnt/src/obj-x86_64-linux-gnu'
14-Jul-2020 16:07:00 | Install the project...
14-Jul-2020 16:07:00 | /usr/bin/cmake -P cmake_install.cmake
14-Jul-2020 16:07:00 | -- Install configuration: "None"
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/share/pkgconfig/libmbus.pc
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/lib/x86_64-linux-gnu/libmbus.so
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/lib/x86_64-linux-gnu/cmake/libmbus/libmbusTargets.cmake
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/lib/x86_64-linux-gnu/cmake/libmbus/libmbusTargets-none.cmake
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/lib/x86_64-linux-gnu/cmake/libmbus/libmbusConfig.cmake
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/lib/x86_64-linux-gnu/cmake/libmbus/libmbusConfigVersion.cmake
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/include/mbus
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/include/mbus/mbus-protocol-aux.h
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/include/mbus/mbus-protocol.h
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/include/mbus/mbus-serial.h
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/include/mbus/mbus-tcp.h
14-Jul-2020 16:07:00 | -- Installing: /mnt/src/debian/tmp/usr/include/mbus/mbus.h
14-Jul-2020 16:07:00 | make[1]: Leaving directory '/mnt/src/obj-x86_64-linux-gnu'
14-Jul-2020 16:07:00 | dh_install
14-Jul-2020 16:07:00 | dh_install: Compatibility levels before 9 are deprecated (level 7 in use)
14-Jul-2020 16:07:00 | dh_install: Cannot find (any matches for) "usr/lib/lib*.a" (tried in "." and "debian/tmp")
14-Jul-2020 16:07:00 | dh_install: libmbus-dev missing files: usr/lib/lib*.a
14-Jul-2020 16:07:00 | dh_install: Cannot find (any matches for) "usr/lib/lib*.so" (tried in "." and "debian/tmp")
14-Jul-2020 16:07:00 | dh_install: libmbus-dev missing files: usr/lib/lib*.so
14-Jul-2020 16:07:00 | dh_install: Cannot find (any matches for) "usr/lib/*.la" (tried in "." and "debian/tmp")
14-Jul-2020 16:07:00 | dh_install: libmbus-dev missing files: usr/lib/*.la
14-Jul-2020 16:07:00 | dh_install: Cannot find (any matches for) "usr/lib/pkgconfig/libmbus.pc" (tried in "." and "debian/tmp")
14-Jul-2020 16:07:00 | dh_install: libmbus-dev missing files: usr/lib/pkgconfig/libmbus.pc
14-Jul-2020 16:07:00 | dh_install: Cannot find (any matches for) "usr/lib/lib*.so.*" (tried in "." and "debian/tmp")
14-Jul-2020 16:07:00 | dh_install: libmbus1 missing files: usr/lib/lib*.so.*
14-Jul-2020 16:07:00 | dh_install: Cannot find (any matches for) "usr/bin/*" (tried in "." and "debian/tmp")
14-Jul-2020 16:07:00 | dh_install: libmbus1 missing files: usr/bin/*
14-Jul-2020 16:07:00 | dh_install: missing files, aborting
14-Jul-2020 16:07:00 | make: *** [binary] Error 2
14-Jul-2020 16:07:00 | debian/rules:6: recipe for target 'binary' failed
14-Jul-2020 16:07:00 | dpkg-buildpackage: error: debian/rules binary gave error exit status 2

Culprit seems to be this line: https://github.com/rscada/libmbus/blob/master/debian/libmbus-dev.install#L2

The build script we use used to work. Is there something we missed when preparing the sources for building as a Debian package?

lategoodbye commented 4 years ago

Sorry, for the inconvenience. During the conversion of the build system the target for the static library get dropped.

Unfortunately i'm not that cmake expert and i partly regret the decision. Nevertheless i started my work, but it's still not usable. Maybe you have an idea what's the problem.

fredrik-sk commented 4 years ago

We had an issue where the .so file was named liblibmbus.so, I would assume that we removed one "lib" from the name. So it is possible that the file that previously was called libmbus.a now instead is named mbus.a.

I don't know CMake and do not intend to learn it unless I really have to. So I am of little help.

I tried to build a .deb file, but my "employer" wanted the example programs as well, I was not able to solve that without starting to patch the build files, so I went with a normal .tar.gz where I could do things between the build/installation and the final packaging in an archive file,

EDIT: Sorry!, after actually looking, I cannot se any trace of a statically linked file in the .deb build. (Would once again wave the do-it-yourself flag.)

This seems to e the lines that actually do something from our Makefile.

.PHONY: some_target
some_target:
    mkdir -p "$(MBUS_BUILD_TAR)"
    (cd "$(MBUS_BUILD_TAR)" && \
        cmake  -DCMAKE_INSTALL_PREFIX="$(MBUS_INSTALL_TAR)/$(MBUS_PREFIX)" -DLIBMBUS_BUILD_EXAMPLES=ON "$(MBUS_SOURCE)" )
    (cd "$(MBUS_BUILD_TAR)" && cmake --build . )
    mkdir -p "$(MBUS_INSTALL_TAR)"
    (cd "$(MBUS_BUILD_TAR)" && cmake --build . --target install)
    mkdir -p "$(MBUS_INSTALL_TAR)/$(MBUS_PREFIX)/bin"
    (cd "$(MBUS_BUILD_TAR)" && cp bin/mbus-* $(MBUS_INSTALL_TAR)/$(MBUS_PREFIX)/bin/)

If you want both statically and dynamically linked, you might have to generate and build twice (I don't know CMake.)

lategoodbye commented 4 years ago

The lib prefix issue has been fixed recently. But in case we don't have a solution at the end of the week, i think about reverting.

lategoodbye commented 4 years ago

@sjlongland The debian directory is now deprecated. Please take a look at #175 and modify the build.sh to build the debian packages with cmake. I will add the binaries and doc later, after you gave me the okay this is going into the right direction.

fredrik-sk commented 4 years ago

I don't think it because of the lib prefix.

@sjlongland The debian directory is now deprecated.

Are you certain. I think the the CMake/cpack could use some files from that directory. (But that is only my belife/assumtion. I don't know cmake, nor deb packages nor cpack

fredrik-sk commented 4 years ago

I did build the Dockerfile.deb image. It seems that there is a static library being built, and it is presnt in the in the resulting -dev.deb file.

# ls -l /tmp/build/lib/libmbus.a
-rw-r--r-- 1 root root 325474 Jul 15 19:56 /tmp/build/lib/libmbus.a

# dpkg -c libmbus_0.9.0-dev.deb
...
-rw-r--r-- root/root    325474 2020-07-15 19:56 ./usr/lib/libmbus.a
...
lategoodbye commented 4 years ago

@fredrik-sk Do you mean before or after my changes in #175?

fredrik-sk commented 4 years ago

@lategoodbye : After #175

sjlongland commented 4 years ago

That works, although the build time was unexpectedly short. A bigger issue is the file names don't conform to Debian packaging conventions.

Nominally these would be named libmbus_0.9.0_${ARCH}.deb and libmbus-dev_0.9.0_${ARCH}.deb (where ${ARCH} is the target architecture). Instead, they're named libmbus_0.9.0-lib.deb and libmbus_0.9.0-dev.deb. There's also no source Debian package produced via this method which makes re-building on other architectures easier.

sjlongland commented 4 years ago

Okay, was able to hack around the package naming:

        arch=$( dpkg --print-architecture )
        for f in *.deb; do
            pkgbasename=${f%_*}
            suffix=${f#${pkgbasename}_}
            version=${suffix%-*}
            case "$f" in
                *-lib.deb)
                    mv -v $f ${pkgbasename}_${version}_${arch}.deb
                    ;;
                *-dev.deb)
                    mv -v $f ${pkgbasename}-dev_${version}_${arch}.deb
                    ;;
                *)
                    mv -v $f ${f/.deb/_${arch}.deb}
                    ;;
            esac
        done

Until we start getting packages with files named *_amd64_amd64.deb, this will get us by I think. :-)

lategoodbye commented 4 years ago

All those those debuild/debmake/cmake crap, drives me crazy :(

sjlongland commented 4 years ago

It can be a pain, but try asking your typical end user to do a ./configure && make && make install.

They just want to press a button and "magic happens", and it doesn't seem to matter whether it's a smartphone user pressing the install button on their phone's application repository, or whether its an engineer that wants to integrate M-Bus meters.

lategoodbye commented 4 years ago

@sjlongland Can you please retest with build-deb.sh?

sjlongland commented 4 years ago
root@bc58b76794df:/tmp/work# ./build-deb.sh 
Running autotools...
configure.ac:19: warning: LT_INIT was called before AM_PROG_AR
aclocal.m4:10027: AM_PROG_AR is expanded from...
configure.ac:19: the top level
…
libtoolize: and rerunning libtoolize and aclocal.
configure.ac:19: warning: LT_INIT was called before AM_PROG_AR
aclocal.m4:10027: AM_PROG_AR is expanded from...
configure.ac:19: the top level
configure.ac:19: warning: LT_INIT was called before AM_PROG_AR
aclocal.m4:10027: AM_PROG_AR is expanded from...
configure.ac:19: the top level
 dpkg-buildpackage -rfakeroot -us -uc -i -b
dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: info: source package libmbus
dpkg-buildpackage: info: source version 0.9.0
dpkg-buildpackage: info: source distribution xenial
dpkg-buildpackage: info: source changed by Stefan Wahren <stefan.wahren@i2se.com>
 dpkg-source -i --before-build work
dpkg-buildpackage: info: host architecture amd64
 fakeroot debian/rules clean
dh --with autoreconf clean
dh: Compatibility levels before 9 are deprecated (level 7 in use)
…
configure: creating ./config.status
config.status: creating Makefile
config.status: creating mbus/Makefile
config.status: creating test/Makefile
config.status: creating bin/Makefile
config.status: creating libmbus.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: WARNING: unrecognized options: --disable-maintainer-mode
----------------------------------------------------------
Configuration:

        Source location:        .
        Compile:                gcc
        Compiler flags:         -g -O2
        Linker flags:            -version-info 0:9:0
        Host system type:       x86_64-pc-linux-gnu
        Install path:           /usr

        See config.h for further configuration.
----------------------------------------------------------
   dh_auto_build
dh_auto_build: Compatibility levels before 9 are deprecated (level 7 in use)
        make -j1
make[1]: Entering directory '/tmp/work'
make  all-recursive
make[2]: Entering directory '/tmp/work'
Making all in mbus
make[3]: Entering directory '/tmp/work/mbus'
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I..   -g -O2 -c -o mbus.lo mbus.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -g -O2 -c mbus.c  -fPIC -DPIC -o .libs/mbus.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -g -O2 -c mbus.c -o mbus.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I..   -g -O2 -c -o mbus-protocol.lo mbus-protocol.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -g -O2 -c mbus-protocol.c  -fPIC -DPIC -o .libs/mbus-protocol.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -g -O2 -c mbus-protocol.c -o mbus-protocol.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I..   -g -O2 -c -o mbus-tcp.lo mbus-tcp.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -g -O2 -c mbus-tcp.c  -fPIC -DPIC -o .libs/mbus-tcp.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -g -O2 -c mbus-tcp.c -o mbus-tcp.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I..   -g -O2 -c -o mbus-serial.lo mbus-serial.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -g -O2 -c mbus-serial.c  -fPIC -DPIC -o .libs/mbus-serial.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -g -O2 -c mbus-serial.c -o mbus-serial.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I..   -g -O2 -c -o mbus-protocol-aux.lo mbus-protocol-aux.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -g -O2 -c mbus-protocol-aux.c  -fPIC -DPIC -o .libs/mbus-protocol-aux.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -g -O2 -c mbus-protocol-aux.c -o mbus-protocol-aux.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2  -version-info 0:9:0 -o libmbus.la -rpath /usr/lib mbus.lo mbus-protocol.lo mbus-tcp.lo mbus-serial.lo mbus-protocol-aux.lo  
libtool: link: gcc -shared  -fPIC -DPIC  .libs/mbus.o .libs/mbus-protocol.o .libs/mbus-tcp.o .libs/mbus-serial.o .libs/mbus-protocol-aux.o    -g -O2   -Wl,-soname -Wl,libmbus.so.0 -o .libs/libmbus.so.0.0.9
libtool: link: (cd ".libs" && rm -f "libmbus.so.0" && ln -s "libmbus.so.0.0.9" "libmbus.so.0")
libtool: link: (cd ".libs" && rm -f "libmbus.so" && ln -s "libmbus.so.0.0.9" "libmbus.so")
libtool: link: ar cru .libs/libmbus.a  mbus.o mbus-protocol.o mbus-tcp.o mbus-serial.o mbus-protocol-aux.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libmbus.a
libtool: link: ( cd ".libs" && rm -f "libmbus.la" && ln -s "../libmbus.la" "libmbus.la" )
make[3]: Leaving directory '/tmp/work/mbus'
Making all in bin
make[3]: Entering directory '/tmp/work/bin'
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-tcp-scan.o mbus-tcp-scan.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-tcp-scan mbus-tcp-scan.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-tcp-scan mbus-tcp-scan.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-tcp-request-data.o mbus-tcp-request-data.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-tcp-request-data mbus-tcp-request-data.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-tcp-request-data mbus-tcp-request-data.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-tcp-request-data-multi-reply.o mbus-tcp-request-data-multi-reply.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-tcp-request-data-multi-reply mbus-tcp-request-data-multi-reply.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-tcp-request-data-multi-reply mbus-tcp-request-data-multi-reply.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-tcp-select-secondary.o mbus-tcp-select-secondary.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-tcp-select-secondary mbus-tcp-select-secondary.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-tcp-select-secondary mbus-tcp-select-secondary.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-tcp-scan-secondary.o mbus-tcp-scan-secondary.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-tcp-scan-secondary mbus-tcp-scan-secondary.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-tcp-scan-secondary mbus-tcp-scan-secondary.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-serial-scan.o mbus-serial-scan.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-serial-scan mbus-serial-scan.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-serial-scan mbus-serial-scan.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-serial-request-data.o mbus-serial-request-data.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-serial-request-data mbus-serial-request-data.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-serial-request-data mbus-serial-request-data.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-serial-request-data-multi-reply.o mbus-serial-request-data-multi-reply.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-serial-request-data-multi-reply mbus-serial-request-data-multi-reply.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-serial-request-data-multi-reply mbus-serial-request-data-multi-reply.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-serial-select-secondary.o mbus-serial-select-secondary.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-serial-select-secondary mbus-serial-select-secondary.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-serial-select-secondary mbus-serial-select-secondary.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-serial-scan-secondary.o mbus-serial-scan-secondary.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-serial-scan-secondary mbus-serial-scan-secondary.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-serial-scan-secondary mbus-serial-scan-secondary.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-serial-switch-baudrate.o mbus-serial-switch-baudrate.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-serial-switch-baudrate mbus-serial-switch-baudrate.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-serial-switch-baudrate mbus-serial-switch-baudrate.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-tcp-raw-send.o mbus-tcp-raw-send.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-tcp-raw-send mbus-tcp-raw-send.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-tcp-raw-send mbus-tcp-raw-send.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-tcp-application-reset.o mbus-tcp-application-reset.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-tcp-application-reset mbus-tcp-application-reset.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-tcp-application-reset mbus-tcp-application-reset.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I.. -I../src   -g -O2 -c -o mbus-serial-set-address.o mbus-serial-set-address.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L../mbus -version-info 0:9:0 -o mbus-serial-set-address mbus-serial-set-address.o -lmbus -lm 
libtool: warning: '-version-info' is ignored for programs
libtool: link: gcc -g -O2 -o .libs/mbus-serial-set-address mbus-serial-set-address.o  -L../mbus /tmp/work/mbus/.libs/libmbus.so -lm
pod2man --release=0.9.0 --center=libmbus libmbus.pod \
        >.pod2man.tmp.$$ 2>/dev/null && mv -f .pod2man.tmp.$$ libmbus.1 || true
make[3]: Leaving directory '/tmp/work/bin'
make[3]: Entering directory '/tmp/work'
make[3]: Leaving directory '/tmp/work'
make[2]: Leaving directory '/tmp/work'
make[1]: Leaving directory '/tmp/work'
   dh_auto_test
dh_auto_test: Compatibility levels before 9 are deprecated (level 7 in use)
        make -j1 check VERBOSE=1
make[1]: Entering directory '/tmp/work'
Making check in mbus
make[2]: Entering directory '/tmp/work/mbus'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/tmp/work/mbus'
Making check in bin
make[2]: Entering directory '/tmp/work/bin'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/tmp/work/bin'
make[2]: Entering directory '/tmp/work'
make[2]: Leaving directory '/tmp/work'
make[1]: Leaving directory '/tmp/work'
   create-stamp debian/debhelper-build-stamp
 fakeroot debian/rules binary
dh --with autoreconf binary
dh: Compatibility levels before 9 are deprecated (level 7 in use)
   dh_testroot
   dh_prep
   dh_installdirs
dh_installdirs: Compatibility levels before 9 are deprecated (level 7 in use)
   dh_auto_install
dh_auto_install: Compatibility levels before 9 are deprecated (level 7 in use)
        make -j1 install DESTDIR=/tmp/work/debian/tmp AM_UPDATE_INFO_DIR=no
make[1]: Entering directory '/tmp/work'
Making install in mbus
make[2]: Entering directory '/tmp/work/mbus'
make[3]: Entering directory '/tmp/work/mbus'
 /bin/mkdir -p '/tmp/work/debian/tmp/usr/lib'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libmbus.la '/tmp/work/debian/tmp/usr/lib'
libtool: install: /usr/bin/install -c .libs/libmbus.so.0.0.9 /tmp/work/debian/tmp/usr/lib/libmbus.so.0.0.9
libtool: install: (cd /tmp/work/debian/tmp/usr/lib && { ln -s -f libmbus.so.0.0.9 libmbus.so.0 || { rm -f libmbus.so.0 && ln -s libmbus.so.0.0.9 libmbus.so.0; }; })
libtool: install: (cd /tmp/work/debian/tmp/usr/lib && { ln -s -f libmbus.so.0.0.9 libmbus.so || { rm -f libmbus.so && ln -s libmbus.so.0.0.9 libmbus.so; }; })
libtool: install: /usr/bin/install -c .libs/libmbus.lai /tmp/work/debian/tmp/usr/lib/libmbus.la
libtool: install: /usr/bin/install -c .libs/libmbus.a /tmp/work/debian/tmp/usr/lib/libmbus.a
libtool: install: chmod 644 /tmp/work/debian/tmp/usr/lib/libmbus.a
libtool: install: ranlib /tmp/work/debian/tmp/usr/lib/libmbus.a
libtool: warning: remember to run 'libtool --finish /usr/lib'
 /bin/mkdir -p '/tmp/work/debian/tmp/usr/include/mbus'
 /usr/bin/install -c -m 644 mbus.h mbus-protocol.h mbus-tcp.h mbus-serial.h mbus-protocol-aux.h '/tmp/work/debian/tmp/usr/include/mbus'
make[3]: Leaving directory '/tmp/work/mbus'
make[2]: Leaving directory '/tmp/work/mbus'
Making install in bin
make[2]: Entering directory '/tmp/work/bin'
make[3]: Entering directory '/tmp/work/bin'
 /bin/mkdir -p '/tmp/work/debian/tmp/usr/bin'
  /bin/bash ../libtool   --mode=install /usr/bin/install -c mbus-tcp-scan mbus-tcp-request-data mbus-tcp-request-data-multi-reply mbus-tcp-select-secondary mbus-tcp-scan-secondary mbus-serial-scan mbus-serial-request-data mbus-serial-request-data-multi-reply mbus-serial-select-secondary mbus-serial-scan-secondary mbus-serial-switch-baudrate mbus-tcp-raw-send mbus-tcp-application-reset mbus-serial-set-address '/tmp/work/debian/tmp/usr/bin'
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-tcp-scan /tmp/work/debian/tmp/usr/bin/mbus-tcp-scan
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-tcp-request-data /tmp/work/debian/tmp/usr/bin/mbus-tcp-request-data
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-tcp-request-data-multi-reply /tmp/work/debian/tmp/usr/bin/mbus-tcp-request-data-multi-reply
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-tcp-select-secondary /tmp/work/debian/tmp/usr/bin/mbus-tcp-select-secondary
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-tcp-scan-secondary /tmp/work/debian/tmp/usr/bin/mbus-tcp-scan-secondary
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-serial-scan /tmp/work/debian/tmp/usr/bin/mbus-serial-scan
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-serial-request-data /tmp/work/debian/tmp/usr/bin/mbus-serial-request-data
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-serial-request-data-multi-reply /tmp/work/debian/tmp/usr/bin/mbus-serial-request-data-multi-reply
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-serial-select-secondary /tmp/work/debian/tmp/usr/bin/mbus-serial-select-secondary
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-serial-scan-secondary /tmp/work/debian/tmp/usr/bin/mbus-serial-scan-secondary
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-serial-switch-baudrate /tmp/work/debian/tmp/usr/bin/mbus-serial-switch-baudrate
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-tcp-raw-send /tmp/work/debian/tmp/usr/bin/mbus-tcp-raw-send
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-tcp-application-reset /tmp/work/debian/tmp/usr/bin/mbus-tcp-application-reset
libtool: warning: '/tmp/work/mbus/libmbus.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/mbus-serial-set-address /tmp/work/debian/tmp/usr/bin/mbus-serial-set-address
 /bin/mkdir -p '/tmp/work/debian/tmp/usr/share/man/man1'
 /usr/bin/install -c -m 644 libmbus.1 mbus-tcp-scan.1 mbus-tcp-request-data.1 mbus-tcp-request-data-multi-reply.1 mbus-tcp-select-secondary.1 mbus-tcp-scan-secondary.1 mbus-tcp-raw-send.1 mbus-serial-scan.1 mbus-serial-request-data.1 mbus-serial-request-data-multi-reply.1 mbus-serial-select-secondary.1 mbus-serial-scan-secondary.1 mbus-serial-switch-baudrate.1 '/tmp/work/debian/tmp/usr/share/man/man1'
make[3]: Leaving directory '/tmp/work/bin'
make[2]: Leaving directory '/tmp/work/bin'
make[2]: Entering directory '/tmp/work'
make[3]: Entering directory '/tmp/work'
make[3]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/tmp/work/debian/tmp/usr/share/doc/libmbus-0.9.0'
 /usr/bin/install -c -m 644 README.md COPYING hardware/MBus_USB.pdf hardware/MBus_USB.txt '/tmp/work/debian/tmp/usr/share/doc/libmbus-0.9.0'
 /bin/mkdir -p '/tmp/work/debian/tmp/usr/lib/pkgconfig'
 /usr/bin/install -c -m 644 libmbus.pc '/tmp/work/debian/tmp/usr/lib/pkgconfig'
make[3]: Leaving directory '/tmp/work'
make[2]: Leaving directory '/tmp/work'
make[1]: Leaving directory '/tmp/work'
   dh_install
dh_install: Compatibility levels before 9 are deprecated (level 7 in use)
   dh_installdocs
   dh_installchangelogs
   dh_installman
   dh_perl
   dh_link
   dh_strip_nondeterminism
   dh_compress
   dh_fixperms
   debian/rules override_dh_strip
make[1]: Entering directory '/tmp/work'
dh_strip --dbg-package=libmbus1-dbg
dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
make[1]: Leaving directory '/tmp/work'
   dh_makeshlibs
   dh_shlibdeps
dpkg-shlibdeps: warning: symbol pow used by debian/libmbus1/usr/lib/libmbus.so.0.0.9 found in none of the libraries
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/libmbus1/usr/bin/mbus-tcp-application-reset debian/libmbus1/usr/bin/mbus-tcp-request-data debian/libmbus1/usr/bin/mbus-tcp-raw-send debian/libmbus1/usr/bin/mbus-serial-scan debian/libmbus1/usr/bin/mbus-serial-scan-secondary debian/libmbus1/usr/bin/mbus-serial-select-secondary debian/libmbus1/usr/bin/mbus-tcp-scan-secondary debian/libmbus1/usr/bin/mbus-serial-request-data-multi-reply debian/libmbus1/usr/bin/mbus-serial-request-data debian/libmbus1/usr/bin/mbus-tcp-scan debian/libmbus1/usr/bin/mbus-serial-set-address debian/libmbus1/usr/bin/mbus-tcp-request-data-multi-reply debian/libmbus1/usr/bin/mbus-tcp-select-secondary debian/libmbus1/usr/bin/mbus-serial-switch-baudrate were not linked against libm.so.6 (they use none of the library's symbols)
   dh_installdeb
dh_installdeb: Compatibility levels before 9 are deprecated (level 7 in use)
   dh_gencontrol
   dh_md5sums
   dh_builddeb
dpkg-deb: building package 'libmbus-dev' in '../libmbus-dev_0.9.0_amd64.deb'.
dpkg-deb: building package 'libmbus1-dbg' in '../libmbus1-dbg_0.9.0_amd64.deb'.
dpkg-deb: building package 'libmbus1' in '../libmbus1_0.9.0_amd64.deb'.
 dpkg-genbuildinfo --build=binary
 dpkg-genchanges --build=binary >../libmbus_0.9.0_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
 dpkg-source -i --after-build work
dpkg-buildpackage: info: binary-only upload (no source included)
Now running lintian...
warning: the authors of lintian do not recommend running it with root privileges!
E: libmbus changes: bad-distribution-in-changes-file xenial
W: libmbus1: package-name-doesnt-match-sonames libmbus0
W: libmbus1: extra-license-file usr/share/doc/libmbus-0.9.0/COPYING
W: libmbus1: manpage-has-bad-whatis-entry usr/share/man/man1/libmbus.1.gz
W: libmbus1: binary-without-manpage usr/bin/mbus-serial-set-address
W: libmbus1: binary-without-manpage usr/bin/mbus-tcp-application-reset
Finished running lintian.
root@bc58b76794df:/tmp/work# 

Looking good! That was on Debian Stretch (v9) via Docker.

sjlongland commented 4 years ago

Have a look at https://github.com/rscada/libmbus/pull/178 and see what you think. This adds in source packages, and also allows for signing of packages, should a user require it.