BelledonneCommunications / flexisip

Linphone.org mirror for flexisip (git://git.linphone.org/flexisip.git)
http://flexisip.org
GNU Affero General Public License v3.0
144 stars 69 forks source link

Build error rpm and deb packages for Ubuntu #64

Closed capitalfuse closed 5 years ago

capitalfuse commented 5 years ago

Build machine for Linux ThinkPad-E450 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux Ubuntu18.04

rpm package command is following;

./prepare.py flexisip-rpm -DENABLE_REDIS=ON -DENABLE_BC_HIREDIS=ON

error( wrote partially)

Executing(%build): /bin/bash -e /var/tmp/rpm-tmp.rHQFpq
+ umask 022
+ cd /home/takanobu/git_projects/flexisip/WORK/flexisip-rpm/rpmbuild/BUILD
+ cd bc-bctoolbox-0.6.0-166
+ %cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH:PATH=/opt/belledonne-communications -DENABLE_DECAF=0 -DENABLE_MBEDTLS=1 -DENABLE_POLARSSL=0 -DENABLE_SHARED=1 -DENABLE_STATIC=0 -DENABLE_STRICT=1 -DENABLE_TESTS=0 -DENABLE_TESTS_COMPONENT=0
/var/tmp/rpm-tmp.rHQFpq: line 28: fg: no job control
error: Bad exit status from /var/tmp/rpm-tmp.rHQFpq (%build)

I checked the above file /var/tpm/rpm-tmp.rHQpq, contents is below.

#!/bin/bash

  RPM_SOURCE_DIR="/home/takanobu/git_projects/flexisip/WORK/flexisip-rpm/Build/bctoolbox"
  RPM_BUILD_DIR="/home/takanobu/git_projects/flexisip/WORK/flexisip-rpm/rpmbuild/BUILD"
  RPM_OPT_FLAGS="-O2 -g"
  RPM_ARCH="x86_64"
  RPM_OS="linux"
  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
  RPM_DOC_DIR="/opt/belledonne-communications/share/doc"
  export RPM_DOC_DIR
  RPM_PACKAGE_NAME="bc-bctoolbox"
  RPM_PACKAGE_VERSION="0.6.0"
  RPM_PACKAGE_RELEASE="166.deb"
  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
  LANG=C
  export LANG
  unset CDPATH DISPLAY ||:
  RPM_BUILD_ROOT="/home/takanobu/git_projects/flexisip/WORK/flexisip-rpm/rpmbuild/BUILDROOT/bc-bctoolbox-0.6.0-166.deb.x86_64"
  export RPM_BUILD_ROOT

  PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/opt/belledonne-communications/lib/pkgconfig:/opt/belledonne-communications/share/pkgconfig"
  export PKG_CONFIG_PATH

  set -x
  umask 022
  cd "/home/takanobu/git_projects/flexisip/WORK/flexisip-rpm/rpmbuild/BUILD"
cd 'bc-bctoolbox-0.6.0-166'
%cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH:PATH=/opt/belledonne-communications  -DENABLE_DECAF=0 -DENABLE_MBEDTLS=1 -DENABLE_POLARSSL=0 -DENABLE_SHARED=1 -DENABLE_STATIC=0 -DENABLE_STRICT=1 -DENABLE_TESTS=0 -DENABLE_TESTS_COMPONENT=0
make -j4

exit $?

The cause of this error is the part of "%cmake . -DCMAKE_BUILD_TYPE ......." in line 28 which added "%" in front of "cmake".

if no "%" before "cmake", build process succeeded.

I want to clear why "%" added in front of "cmake" command.

capitalfuse commented 5 years ago

Installed the below package(copy files to /usr/lib/rpm directory) CMake builds use the the %cmake macro from the cmake-rpm-macros package. (Fedora Rawhide for x86_64) https://rpmfind.net/linux/rpm2html/search.php?query=cmake-rpm-macros

capitalfuse commented 5 years ago

Next error

/usr/lib/rpm/find-debuginfo.sh: line 239: eu-strip: command not found
error: Bad exit status from /var/tmp/rpm-tmp.tFoBTp (%install)

Resolved to install the following package

$ sudo apt install elfutils

jehandelalune commented 5 years ago

What about: docker run -v $PWD:/home/bc -it gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-ubuntu:18.04 ./prepare.py flexisip-rpm -DENABLE_REDIS=ON -DENABLE_BC_HIREDIS=ON

capitalfuse commented 5 years ago

Thnaks for your advice:jehandelalune. I made docker image and container by the following procedure.

docker run -v $PWD:/home/bc -it gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-ubuntu:18.04 ./prepare.py flexisip-rpm -DENABLE_REDIS=ON -DENABLE_BC_HIREDIS=ON

But need to copy files in cmake-rpm-macros into the container.

$ docker cp cmake.prov container_name:/usr/lib/rpm/cmake.prov
$ docker cp cmake.req container_name:/usr/lib/rpm/cmake.req
$ docker cp cmake.attr container_name:/usr/lib/rpm/fileattrs/cmake.attr
$ docker cp macros.cmake container_name:/usr/lib/rpm/macros.d/macros.cmake

then implement the shell command in the container.

$ docker exec -it container_name bash
bc@9df842ffe3cf:/home/takanobu/git_projects/flexisip$ make

Error

-- Build files have been written to: /home/takanobu/git_projects/flexisip/WORK/flexisip-rpm/Build/flexisip
make[4]: Entering directory '/home/takanobu/git_projects/flexisip/WORK/flexisip-rpm/Build/flexisip'
Run CPack packaging tool for source...
CPack: Create package using TGZ
CPack: Install projects
CPack: - Install directory: /home/takanobu/git_projects/flexisip
CPack: Create package
CPack: - package: /home/takanobu/git_projects/flexisip/WORK/flexisip-rpm/Build/flexisip/bc-flexisip-1.0.13.tar.gz generated.
make[4]: Leaving directory '/home/takanobu/git_projects/flexisip/WORK/flexisip-rpm/Build/flexisip'
[ 95%] Forcing build for 'EP_flexisip'
[ 97%] Performing build step for 'EP_flexisip'
error: File /home/takanobu/git_projects/flexisip/WORK/flexisip-rpm/Build/flexisip/bc-flexisip-1.0.13-0.tar.gz: No such file or directory
CMakeFiles/EP_flexisip.dir/build.make:117: recipe for target '/home/takanobu/git_projects/flexisip/WORK/flexisip-rpm/Stamp/EP_flexisip/EP_flexisip-build' failed

Doesn't match file name "bc-flexisip-1.0.13.tar.gz" with "bc-flexisip-1.0.13-0.tar.gz", "-0" added.

How to resolve this error, or when you need to rebuild, please follow the below procedure. In submodules/externals/sofia-sip directory:

$ make clean and remove other files not including of the beginning(recovery to the beginning).

capitalfuse commented 5 years ago

Thanks jehandelalune. I have succeeded to build flexisip for ubuntu 18.04.

$ cd /home/takanobu/git_projects
$ git clone https://gitlab.linphone.org/BC/public/flexisip.git
$ docker container restart container_name

in docker container:

     # cd /home/takanobu/git*/flexisip
     # git submodule sync && git submodule update --init --recursive
     # ./prepare.py flexisip-rpm -DENABLE_REDIS=ON -DENABLE_BC_HIREDIS=ON
     # make
hpng6 commented 4 years ago

im using ubuntu 18.04 with docker image.

error: line 66: Unknown tag: %{systemd_requires} CMakeFiles/EP_flexisip.dir/build.make:120: recipe for target '/home/bc/flexisip/WORK/flexisip-rpm/Stamp/EP_flexisip/EP_flexisip-build' failed make[3]: [/home/bc/flexisip/WORK/flexisip-rpm/Stamp/EP_flexisip/EP_flexisip-build] Error 1 make[3]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' CMakeFiles/Makefile2:351: recipe for target 'CMakeFiles/EP_flexisip.dir/all' failed make[2]: [CMakeFiles/EP_flexisip.dir/all] Error 2 make[2]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' Makefile:83: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' Makefile:14: recipe for target 'flexisip-rpm-build' failed make: [flexisip-rpm-build] Error 2

BasilMVarghese commented 4 years ago

Installed the below package(copy files to /usr/lib/rpm directory) CMake builds use the the %cmake macro from the cmake-rpm-macros package. (Fedora Rawhide for x86_64) https://rpmfind.net/linux/rpm2html/search.php?query=cmake-rpm-macros

I copied those files. But the error appears again.

BasilMVarghese commented 4 years ago

Installed the below package(copy files to /usr/lib/rpm directory) CMake builds use the the %cmake macro from the cmake-rpm-macros package. (Fedora Rawhide for x86_64) https://rpmfind.net/linux/rpm2html/search.php?query=cmake-rpm-macros

I copied those files. But the error appears again.

Installed the downloaded .rpm files using alien and solved the issue.

hpng6 commented 4 years ago

Installed the below package(copy files to /usr/lib/rpm directory) CMake builds use the the %cmake macro from the cmake-rpm-macros package. (Fedora Rawhide for x86_64) https://rpmfind.net/linux/rpm2html/search.php?query=cmake-rpm-macros

I copied those files. But the error appears again.

Installed the downloaded .rpm files using alien and solved the issue.

is presence server working and chat,calls history saving in database?

BasilMVarghese commented 4 years ago

im using ubuntu 18.04 with docker image.

error: line 66: Unknown tag: %{systemd_requires} CMakeFiles/EP_flexisip.dir/build.make:120: recipe for target '/home/bc/flexisip/WORK/flexisip-rpm/Stamp/EP_flexisip/EP_flexisip-build' failed make[3]: [/home/bc/flexisip/WORK/flexisip-rpm/Stamp/EP_flexisip/EP_flexisip-build] Error 1 make[3]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' CMakeFiles/Makefile2:351: recipe for target 'CMakeFiles/EP_flexisip.dir/all' failed make[2]: [CMakeFiles/EP_flexisip.dir/all] Error 2 make[2]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' Makefile:83: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' Makefile:14: recipe for target 'flexisip-rpm-build' failed make: [flexisip-rpm-build] Error 2

Man, I am stuck with same error. Were you able to solve this ?

hpng6 commented 4 years ago

im using ubuntu 18.04 with docker image. error: line 66: Unknown tag: %{systemd_requires} CMakeFiles/EP_flexisip.dir/build.make:120: recipe for target '/home/bc/flexisip/WORK/flexisip-rpm/Stamp/EP_flexisip/EP_flexisip-build' failed make[3]: [/home/bc/flexisip/WORK/flexisip-rpm/Stamp/EP_flexisip/EP_flexisip-build] Error 1 make[3]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' CMakeFiles/Makefile2:351: recipe for target 'CMakeFiles/EP_flexisip.dir/all' failed make[2]: [CMakeFiles/EP_flexisip.dir/all] Error 2 make[2]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' Makefile:83: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' Makefile:14: recipe for target 'flexisip-rpm-build' failed make: [flexisip-rpm-build] Error 2

Man, I am stuck with same error. Were you able to solve this ?

i already escalate the issue. but still didn't get reply from the team... https://github.com/BelledonneCommunications/flexisip/issues/73

BasilMVarghese commented 4 years ago

im using ubuntu 18.04 with docker image. error: line 66: Unknown tag: %{systemd_requires} CMakeFiles/EP_flexisip.dir/build.make:120: recipe for target '/home/bc/flexisip/WORK/flexisip-rpm/Stamp/EP_flexisip/EP_flexisip-build' failed make[3]: [/home/bc/flexisip/WORK/flexisip-rpm/Stamp/EP_flexisip/EP_flexisip-build] Error 1 make[3]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' CMakeFiles/Makefile2:351: recipe for target 'CMakeFiles/EP_flexisip.dir/all' failed make[2]: [CMakeFiles/EP_flexisip.dir/all] Error 2 make[2]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' Makefile:83: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' Makefile:14: recipe for target 'flexisip-rpm-build' failed make: [flexisip-rpm-build] Error 2

Man, I am stuck with same error. Were you able to solve this ?

i already escalate the issue. but still didn't get reply from the team...

This is my first time with flexisip. I have a fresh 18.04 .

Is there any working version of OS. 16.04 or older, where Its already working fine.

Since its a fresh install, I can go with anything which will work.

hpng6 commented 4 years ago

im using ubuntu 18.04 with docker image. error: line 66: Unknown tag: %{systemd_requires} CMakeFiles/EP_flexisip.dir/build.make:120: recipe for target '/home/bc/flexisip/WORK/flexisip-rpm/Stamp/EP_flexisip/EP_flexisip-build' failed make[3]: [/home/bc/flexisip/WORK/flexisip-rpm/Stamp/EP_flexisip/EP_flexisip-build] Error 1 make[3]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' CMakeFiles/Makefile2:351: recipe for target 'CMakeFiles/EP_flexisip.dir/all' failed make[2]: [CMakeFiles/EP_flexisip.dir/all] Error 2 make[2]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' Makefile:83: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/home/bc/flexisip/WORK/flexisip-rpm/cmake' Makefile:14: recipe for target 'flexisip-rpm-build' failed make: [flexisip-rpm-build] Error 2

Man, I am stuck with same error. Were you able to solve this ?

i already escalate the issue. but still didn't get reply from the team...

This is my first time with flexisip. I have a fresh 18.04 .

Is there any working version of OS. 16.04 or older, where Its already working fine.

Since its a fresh install, I can go with anything which will work.

can we talk private? skype hp.india

capitalfuse commented 4 years ago

Download systemd-rpm-macros from the following; https://rpmfind.net/linux/rpm2html/search.php?query=systemd-rpm-macros And I adopted this: https://rpmfind.net/linux/fedora/linux/releases/30/Everything/x86_64/os/Packages/s/systemd-rpm-macros-241-7.gita2eaa1c.fc30.noarch.rpm

In docker flexisip-sdk container,

$ sudo cp macros.systemd /usr/lib/rpm/macros.d

That's it.