0

我正在尝试制作一个 RPM 以在 CentOS 6.3 机器上安装 PCRE-8.31。您可以查看我的规范文件。尽管符合所有要求(据我所知),但在尝试安装软件包时出现以下错误。我在正确的位置放置了指向 libpcre.so.0 的符号链接,那么我做错了什么?

pcre.spec

Name:           pcre
Version:        8.31
Release:        1%{?dist}
Summary:        Perl Compatible Expressions Library

Group:          Libraries
License:        BSD
URL:            http://wwww.pcre.org/
Source0:        ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{ __id_u} -n)

BuildRequires: readline-devel
BuildRequires: autoconf, automake, libtool

%description
Perl-compatible regular expression library.
PCRE has its own native API, but a set of "wrapper" functions that are based on
the POSIX API are also supplied in the library libpcreposix. Note that this
just provides a POSIX calling interface to PCRE: the regular expressions
themselves still follow Perl syntax and semantics. The header file
for the POSIX-style functions is called pcreposix.h.




%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
Development files (Headers, libraries for static linking, etc) for %{name}.




%prep
%setup -q



%build
%configure \
        --prefix=/usr \
        --build=x86_64-redhat-linux-gnu \
        --docdir=/usr/share/doc/pcre-8.31 \
        --enable-jit \
            --enable-pcre8 \
        --enable-pcre16 \
        --enable-pcregrep-libz \
        --enable-pcregrep-libbz2 \
        --enable-pcretest-libreadline \
        --enable-rebuild-chartables \
        --enable-unicode-properties \
        --enable-utf \
            --disable-static \
            CC="gcc -m64" \
            CXX="g++ -m64"
make %{?_smp_mflags}



%install
rm -Rf %{buildroot}

make install DESTDIR=$RPM_BUILD_ROOT

mkdir -p %{buildroot}/%{_lib}
mv %{buildroot}%{_libdir}/libpcre.so.* %{buildroot}/%{_lib}/
pushd %{buildroot}/%{_lib}
ln -fs libpcre.so.1.0.1 libpcre.so.0
popd

rm -f %{buildroot}%{_libdir}/*.la


%check
make check

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -Rf %{buildroot}

%files
%defattr(-,root,root)
/%{_lib}/*.so.*
%{_libdir}/*.so.*
%{_mandir}/man1/*
%{_bindir}/pcregrep
%{_bindir}/pcretest
%doc LICENCE AUTHORS

%files devel
%defattr(-,root,root)
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
%{_includedir}/*.h
%{_mandir}/man3/*
%{_bindir}/pcre-config
%{_prefix}/share/doc/%{name}-%{version}/*

%changelog

安装

# yum install pcre-8.31-1.el6.x86_64.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Examining pcre-8.31-1.el6.x86_64.rpm: pcre-8.31-1.el6.x86_64
Marking pcre-8.31-1.el6.x86_64.rpm as an update to pcre-7.8-4.el6.x86_64
Resolving Dependencies
--> Running transaction check
---> Package pcre.x86_64 0:7.8-4.el6 will be updated
--> Processing Dependency: libpcre.so.0()(64bit) for package: 1:libguestfs-1.16.19-1.el6.x86_64
--> Processing Dependency: libpcre.so.0()(64bit) for package: 6:kdelibs-4.3.4-14.el6.x86_64
--> Processing Dependency: libpcre.so.0()(64bit) for package: httpd-2.2.15-15.el6.centos.1.x86_64
--> Processing Dependency: libpcre.so.0()(64bit) for package: sssd-1.8.0-32.el6.x86_64
--> Processing Dependency: libpcre.so.0()(64bit) for package: grep-2.6.3-3.el6.x86_64
--> Processing Dependency: libpcre.so.0()(64bit) for package: kdelibs3-3.5.10-24.el6_1.1.x86_64
--> Processing Dependency: libpcre.so.0()(64bit) for package: gnote-0.6.3-3.el6.x86_64
--> Processing Dependency: libpcre.so.0()(64bit) for package: less-436-10.el6.x86_64
--> Processing Dependency: libpcre.so.0()(64bit) for package: httpd-tools-2.2.15-15.el6.centos.1.x86_64
---> Package pcre.x86_64 0:8.31-1.el6 will be an update
--> Finished Dependency Resolution
Error: Package: 1:libguestfs-1.16.19-1.el6.x86_64 (@c6-media)
           Requires: libpcre.so.0()(64bit)
           Removing: pcre-7.8-4.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
               libpcre.so.0()(64bit)
           Updated By: pcre-8.31-1.el6.x86_64 (/pcre-8.31-1.el6.x86_64)
               Not found
Error: Package: httpd-2.2.15-15.el6.centos.1.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
           Requires: libpcre.so.0()(64bit)
           Removing: pcre-7.8-4.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
               libpcre.so.0()(64bit)
           Updated By: pcre-8.31-1.el6.x86_64 (/pcre-8.31-1.el6.x86_64)
               Not found
Error: Package: gnote-0.6.3-3.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
           Requires: libpcre.so.0()(64bit)
           Removing: pcre-7.8-4.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
               libpcre.so.0()(64bit)
           Updated By: pcre-8.31-1.el6.x86_64 (/pcre-8.31-1.el6.x86_64)
               Not found
Error: Package: 6:kdelibs-4.3.4-14.el6.x86_64 (@c6-media)
           Requires: libpcre.so.0()(64bit)
           Removing: pcre-7.8-4.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
               libpcre.so.0()(64bit)
           Updated By: pcre-8.31-1.el6.x86_64 (/pcre-8.31-1.el6.x86_64)
               Not found
Error: Package: grep-2.6.3-3.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
           Requires: libpcre.so.0()(64bit)
           Removing: pcre-7.8-4.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
               libpcre.so.0()(64bit)
           Updated By: pcre-8.31-1.el6.x86_64 (/pcre-8.31-1.el6.x86_64)
               Not found
Error: Package: kdelibs3-3.5.10-24.el6_1.1.x86_64 (@c6-media)
           Requires: libpcre.so.0()(64bit)
           Removing: pcre-7.8-4.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
               libpcre.so.0()(64bit)
           Updated By: pcre-8.31-1.el6.x86_64 (/pcre-8.31-1.el6.x86_64)
               Not found
Error: Package: httpd-tools-2.2.15-15.el6.centos.1.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
           Requires: libpcre.so.0()(64bit)
           Removing: pcre-7.8-4.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
               libpcre.so.0()(64bit)
           Updated By: pcre-8.31-1.el6.x86_64 (/pcre-8.31-1.el6.x86_64)
               Not found
Error: Package: sssd-1.8.0-32.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
           Requires: libpcre.so.0()(64bit)
           Removing: pcre-7.8-4.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
               libpcre.so.0()(64bit)
           Updated By: pcre-8.31-1.el6.x86_64 (/pcre-8.31-1.el6.x86_64)
               Not found
Error: Package: less-436-10.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
           Requires: libpcre.so.0()(64bit)
           Removing: pcre-7.8-4.el6.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
               libpcre.so.0()(64bit)
           Updated By: pcre-8.31-1.el6.x86_64 (/pcre-8.31-1.el6.x86_64)
               Not found
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
4

1 回答 1

1

CentOS 6 提供的 PCRE 7.x 版本包含 SO 版本为 0(libpcre.so.0) 的共享库。它与您尝试构建的 PCRE 8.1 软件包 libpcre.so.1 不同。

即使您强制安装软件包,显示为依赖项的软件也很可能无法正常运行。

如果定制的 PCRE 应该被限制用于特定目的,您需要更改其包名称以免与原始名称冲突,并将其安装在与原始名称不同的目录中。

%define _prefix /usr/local
于 2012-10-26T04:00:45.950 回答