Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues Packing icinga 2.6.3 tar.gz to RPM #5177

Closed
Esteban2812 opened this issue Apr 20, 2017 · 7 comments
Closed

Issues Packing icinga 2.6.3 tar.gz to RPM #5177

Esteban2812 opened this issue Apr 20, 2017 · 7 comments
Assignees
Labels
area/setup Installation, systemd, sample files
Milestone

Comments

@Esteban2812
Copy link

General summary

Scenario I'm working on it is a one where I'm no able to run RPMs because I don't have access to root user. So we provide RPMs to a team that have root access and install it without any option, I guess they simple run "rpm -i package.rpm". It is the reason why we want to build RPM from your tar gz. First of our shoot failed which consist to run with the spec is inside the tar.gz file.

Expected Behavior

As I've haven't changed anything in the spec file I expect the RPM files created without errors.

Current Behavior

It is failing during the creation of the RPM file. Giving this error ouput:

-- Found BISON: /usr/bin/bison (Required is at least version "2.3.0")
-- Found FLEX: 2.5.35 (Required is at least version "2.5.31")
-- MySQL Include dir: /usr/include/mysql library dir: /usr/lib64/mysql
-- MySQL client libraries: mysqlclient
-- Found PostgreSQL: /usr/lib64/libpq.so
-- NOTE: boost::test-based targets and tests cannot be added: boost >= 1.34.0 required but not found. (found: '' want >=103400) BUILD_TESTING disabled, so continuing anyway.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/third-party/mmatch
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/third-party/yajl/src
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/third-party/execvpe
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/third-party/socketpair
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/tools/mkclass
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/tools/mkembedconfig
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/tools/mkunity
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/base
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/cli
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/config
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/remote
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/remote
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/icinga
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/methods
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/checker
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/compat
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/db_ido
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/db_ido
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/db_ido_mysql
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/db_ido_pgsql
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/livestatus
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/notification
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/lib/perfdata
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/icinga-app
used as include directory in directory /root/rpmbuild/BUILD/icinga2-2.6.3/icinga-app

-- Configuring incomplete, errors occurred!
See also "/root/rpmbuild/BUILD/icinga2-2.6.3/CMakeFiles/CMakeOutput.log".
See also "/root/rpmbuild/BUILD/icinga2-2.6.3/CMakeFiles/CMakeError.log".
error: Bad exit status from /var/tmp/rpm-tmp.2IxdGR (%build)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.2IxdGR (%build)

Steps to Reproduce (for bugs)

  1. Creating RPM

cat >/etc/yum.repos.d/devtools-2.repo <<REPO
[testing-devtools-2-centos-$releasever]
name=testing 2 devtools for CentOS $releasever
baseurl=http://people.centos.org/tru/devtools-2/\$releasever/\$basearch/RPMS
gpgcheck=0
REPO

#change repo link
#https://superuser.com/questions/866420/why-doesnt-the-centos-devtools-repo-work-on-redhat

[testing-devtools-2-centos-$releasever]
name=testing 2 devtools for CentOS
baseurl=http://people.centos.org/tru/devtools-2/6/$basearch/RPMS
gpgcheck=0
End Step 1

  1. Install requirements

             yum -y install libedit-devel
    
    
             yum -y install ncurses-devel
    
    
             yum -y install openssl-devel 
    
    
             yum -y install cmake
    
    
             yum -y install     boost-devel       
    
    
             yum -y install mysql-devel
     
    
             yum -y install postgresql-devel
    
    
             yum -y install httpd
    

yum install -y gcc-c++

yum install -y flex

yum install -y bison

yum install -y libstdc++-devel

yum install -y devtoolset-2-gcc devtoolset-2-gcc-c++ devtoolset-2-binutils

yum -y install rpmdevtools

yum -y install boost-devel

  1. Creating rpm tree

rpmdev-setuptree

mkdir ~/tar; cd ~/tar; wget https://github.com/Icinga/icinga2/archive/v2.6.3.tar.gz
cd ~/tar; tar -xvzf v2.6.3.tar.gz
cp ~/tar/icinga2-2.6.3/icinga2.spec ~/rpmbuild/SPECS
cp ~/tar/v2.6.3.tar.gz ~/rpmbuild/SOURCES

  1. Configuration

export LD_LIBRARY_PATH=/opt/rh/devtoolset-2/root/usr/lib:$LD_LIBRARY_PATH
export PATH=/opt/rh/devtoolset-2/root/usr/bin:$PATH
ln -sf /opt/rh/devtoolset-2/root/usr/bin/ld.bfd /opt/rh/devtoolset-2/root/usr/bin/ld
for file in find /opt/rh/devtoolset-2/root/usr/include/c++ -name c++config.h; do
echo '#define _GLIBCXX__PTHREADS' >> $file
done

  1. Building RPM

cd ~/rpmbuild/SPECS
rpmbuild -ba icinga2.spec

Context

I'm trying to create RPM file from tar.gz

This is rpmbuild tree:
├── BUILD
│ └── icinga2-2.6.3
├── BUILDROOT
├── RPMS
├── SOURCES
│ └── v2.6.3.tar.gz
├── SPECS
│ └── icinga2.spec
└── SRPMS
I'm following this link to create rpm.

Your Environment

  • Version used (icinga2 --version): 2.6.3
  • Operating System and version:
    Linux scsblnx-4352025 2.6.32-642.3.1.el6.x86_64 Add notes about certificate permission  #1 SMP Sun Jun 26 18:16:44 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
@lazyfrosch
Copy link
Contributor

So just to clarify, you are on RHEL6?

@dnsmichi
Copy link
Contributor

Can you please add the entire build log, starting with the call to rpmbuild and everything until the error occurs?

@dnsmichi dnsmichi added area/setup Installation, systemd, sample files needs feedback We'll only proceed once we hear from you again labels Apr 21, 2017
@Esteban2812
Copy link
Author

Sure, logs are enclosed:

@Esteban2812
Copy link
Author

It is run in RedHat distribution.

cat /proc/version
Linux version 2.6.32-642.3.1.el6.x86_64 (mockbuild@x86-029.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) #1 SMP Sun Jun 26 18:16:44 EDT 2016

@dnsmichi
Copy link
Contributor

Well. The boost headers are not installed and as such cmake fails.

CMake Error at /usr/share/cmake/Modules/FindBoost.cmake:1138 (message):
  Unable to find the requested Boost libraries.

  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.
Call Stack (most recent call first):
  CMakeLists.txt:119 (find_package)

@lazyfrosch
Copy link
Contributor

Unfortunately, the actual problem are our build dependencies on newer Boost.

There are two parts in the spec file that cause you problems.

Choice 1 - Use Boost 153 (we ship it in our repo)

  • Search for boost153 in https://packages.icinga.com/epel/5/release/x86_64/
  • The BuildRequires only get used when -Dbuild_icinga_org is used

This is set here:

%if 0%{?build_icinga_org} && "%{_vendor}" == "redhat" && (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")

Choice 2 - Fix deps for Boost 143 (EPEL)

We set the actual include path of boost without looking for -Dbuild_icinga_org

CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost153 \

  • Either fix the if, or change the include path to .../boost/143

@lazyfrosch lazyfrosch self-assigned this Apr 24, 2017
lazyfrosch added a commit that referenced this issue Apr 24, 2017
Icinga 2 does not build with 1.41:

    /usr/include/boost/range/const_iterator.hpp:37:58: error: no type
    named 'const_iterator' in 'class boost::intrusive_ptr<icinga::Array>'
    ...
    /usr/include/boost/thread/locks.hpp:269:22: error: cannot bind
    'boost::unique_lock<boost::mutex>' lvalue to
    'boost::unique_lock<boost::mutex>&&'

fixes #5188

This also refs #5177 as a partial fix for the dependencies, when not
using Icinga's boost packages.
@lazyfrosch
Copy link
Contributor

We are going to clean up the dependencies, please see #5189

@dnsmichi dnsmichi added this to the 2.7.0 milestone May 3, 2017
dnsmichi pushed a commit that referenced this issue May 3, 2017
Icinga 2 does not build with 1.41:

    /usr/include/boost/range/const_iterator.hpp:37:58: error: no type
    named 'const_iterator' in 'class boost::intrusive_ptr<icinga::Array>'
    ...
    /usr/include/boost/thread/locks.hpp:269:22: error: cannot bind
    'boost::unique_lock<boost::mutex>' lvalue to
    'boost::unique_lock<boost::mutex>&&'

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>

fixes #5188

This also refs #5177 as a partial fix for the dependencies, when not
using Icinga's boost packages.
@dnsmichi dnsmichi removed needs feedback We'll only proceed once we hear from you again labels May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/setup Installation, systemd, sample files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants