0

I'm trying to install apache 2.4 on a CentOS 6.8 server and I have followed this tutorial to do it: geekpeek.net/running-latest-apache-2-4-with-php-7-0-on-centos-6/#disqus_thread

But I'm stuck at step 5 since I can't build apr-util-1.5.4 rpm, my command:

$ rpmbuild -tb  apr-util-1.5.4.tar.bz2

Resulting in (translated from french by myself, and after many lines of file processing):

Rpm build error:
    File not found by substitution: ~/rpmbuild/BUILDROOT/apr-util-1.5.4-1.x86_64/usr/lib64/apr-util-1/apr_dbd_mysql*

Here's the content of the specified directory:

apr_crypto_nss-1.so      apr_dbd_freetds.so    apr_dbd_sqlite3.la
apr_crypto_nss.a         apr_dbd_odbc-1.so     apr_dbd_sqlite3.so
apr_crypto_nss.la        apr_dbd_odbc.a        apr_dbm_db-1.so
apr_crypto_nss.so        apr_dbd_odbc.la       apr_dbm_db.a
apr_crypto_openssl-1.so  apr_dbd_odbc.so       apr_dbm_db.la
apr_crypto_openssl.a     apr_dbd_pgsql-1.so    apr_dbm_db.so
apr_crypto_openssl.la    apr_dbd_pgsql.a       apr_ldap-1.so
apr_crypto_openssl.so    apr_dbd_pgsql.la      apr_ldap.a
apr_dbd_freetds-1.so     apr_dbd_pgsql.so      apr_ldap.la
apr_dbd_freetds.a        apr_dbd_sqlite3-1.so  apr_ldap.so
apr_dbd_freetds.la       apr_dbd_sqlite3.a

I downloaded the apr-util-1.5.4.tar.bz2 from apache official website, and verified the file intergrity with md5sum. A former question stated that the missing files could be found in the apr-util-mysql package, which I believe that I can take from rpmfind (www.rpmfind.net/linux/rpm2html/search.php?query=apr-util-mysql&submit=Search+...).

But I'm troubled for how to proceed right now? Should I try to force building the rpm without the missing files, and install apr-util-mysql after (or before)? Could I somehow explode the apr-util-mysql package to extract the missing apr_dbd_mysql files (and should I)?

raaaahman
  • 13
  • 7
  • So i've tried to install apr-util-mysql-1.4.1 rpm which is said to provide apr_dbd_mysql-1.so, but I had to do it with --nodeps as it wanted apr-util to be installed first. Then when I try to locate any apr_dbd_mysql* files I have some in ~/rpmbuild/BUILD but I'm still missing file in ~/rpmbuild/BUILDROOT. – raaaahman Jan 26 '17 at 22:55

1 Answers1

0

So I was able to get past this error eventually by a sleazy hack. The error tells that it is not able to find the apt-dbd-mysql at this location for my build:

/root/rpmbuild/BUILDROOT/apr-util-1.5.4-1.x86_64/usr/lib64/apr-util-1/ 

I went ahead and installed

apr-util
apr-util-devel
apr-util-mysql 

(although an old version but would be fine, since it will update the package when you are done building the rpm and you install that) I noticed the error popping up around the time when I see this on screen:

======== drop table ========
drop table test successful

Loaded freetds driver OK.
Failed to open freetds[]
Loaded odbc driver OK.
[Tue Apr 18 16:00:12 2017] [dbd_odbc] SQLConnect returned SQL_ERROR (-1) at dbd/apr_dbd_odbc.c:1146 [unixODBC][Driver Manager]Data source name not found, and no default driver specified IM002
Failed to open odbc[]
teststrmatch        : SUCCESS
testuri             : SUCCESS
testuuid            : SUCCESS
testbuckets         : SUCCESS
testpass            : SUCCESS
testmd4             : SUCCESS
testmd5             : SUCCESS
testcrypto          : SUCCESS
testldap            : SUCCESS
testdbd             : SUCCESS
testdate            : SUCCESS
testmemcache        : SUCCESS
testxml             : SUCCESS
testxlate           : SUCCESS
testrmm             : SUCCESS
testdbm             : SUCCESS
testqueue           : SUCCESS
testreslist         : SUCCESS
All tests passed.
+ popd
~/rpmbuild/BUILD/apr-util-1.5.4

I opened up another shell and based on the packages we installed, i navigated here and copied all the apr-dbd-mysql files to the location where the rpmbuiild tool was searching for it:

cd /usr/lib64/apr-util-1/
cp * /root/rpmbuild/BUILDROOT/apr-util-1.5.4-1.x86_64/usr/lib64/apr-util-1/

meanwhile on the other screen as soon as the tool finished all the tests, it did built the latest rpms for apr-util for me:

Checking for unpackaged file(s): /usr/lib/rpm/check-files     /root/rpmbuild/BUILDROOT/apr-util-1.5.4-1.x86_64
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-1.5.4-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-devel-1.5.4-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-dbm-1.5.4-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-pgsql-1.5.4-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-mysql-1.5.4-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-sqlite-1.5.4-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-freetds-1.5.4-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-odbc-1.5.4-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-ldap-1.5.4-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-openssl-1.5.4-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-nss-1.5.4-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/apr-util-debuginfo-1.5.4-1.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.0SGJGz
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd apr-util-1.5.4
+ rm -rf /root/rpmbuild/BUILDROOT/apr-util-1.5.4-1.x86_64
+ exit 0

Now you can install these new packages to update the old apr-util packages on your system. Hope this helps!

Diadems
  • 26
  • 4
  • Is copying the files necessary? I'd try a symlink first. – chicks Apr 18 '17 at 20:56
  • @chicks I understand. That would work as well. Anyways once the buildtool completes the creation of the rpms it deleted that and all other files required during the build process from `~/rpmbuild/BUILDROOT/` So it is not going to take up space beyond that on the system. – Diadems Apr 18 '17 at 21:20
  • Thank you for sharing your solution. I don't have this problem anymore since I've switched to CentOS 7, but I bet this can help somebody else. – raaaahman Apr 23 '17 at 20:00