无法构建 apr-util rpm,缺少 apr_dbd_mysql 文件

无法构建 apr-util rpm,缺少 apr_dbd_mysql 文件

我正在尝试在 CentOS 6.8 服务器上安装 apache 2.4,并按照本教程进行操作:geekpeek.net/running-latest-apache-2-4-with-php-7-0-on-centos-6/#disqus_thread

但是我卡在第 5 步,因为我无法构建 apr-util-1.5.4 rpm,我的命令是:

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

结果是(我自己从法语翻译过来,经过多行文件处理):

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*

以下是指定目录的内容:

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

我从Apache 官方网站,并使用md5sum验证文件完整性。前一个问题指出可以在 apr-util-mysql 包中找到丢失的文件,我相信我可以从 rpmfind(www.rpmfind.net/linux/rpm2html/search.php?query=apr-util-mysql&submit=Search+...)中获取。

但我现在很为难,不知道该怎么做?我是否应该尝试强制构建没有缺失文件的 rpm,然后在之后(或之前)安装 apr-util-mysql?我能否以某种方式解压 apr-util-mysql 包以提取缺失的 apr_dbd_mysql 文件(我应该这样做吗)?

答案1

所以我最终通过一个低级黑客技术解决了这个错误。错误信息表明,在我的构建中,无法在此位置找到 apt-dbd-mysql:

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

我继续安装

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

(虽然是旧版本但没问题,因为当您完成 rpm 构建并安装后它会更新软件包)我注意到当我在屏幕上看到这个时错误弹出:

======== 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

我打开了另一个 shell,并根据我们安装的软件包,我导航到这里并将所有 apr-dbd-mysql 文件复制到 rpmbuiild 工具正在搜索它的位置:

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

同时在另一个屏幕上,一旦工具完成所有测试,它就会为我构建 apr-util 的最新 rpm:

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

现在您可以安装这些新软件包来更新系统上的旧 apr-util 软件包。希望这对您有所帮助!

相关内容