2016-08-29 12 views
0

前任者。 ソースコードからRPMを構築するのに問題があります。 Qt5.7.0でQt5で書かれています。 私のシステムはFedora 24です。 私はqt-opensource-linux-x64-5.7.0.runをインストールし、自分のコードを正常に構築しました。 しかし、RPMを構築しているうちに、インストール段階でエラーが発生します。Qt5アプリケーションのRPMを構築する

私のRPMファイルは以下の通りです。

 

    Name:   KPIViewer 
    Version:  1.0 
    Release:  1%{?dist} 
    Summary:  KPIViewer 

    Group:   Applications/Productivity 
    License:  [email protected] 
    #Source0:  %{name}-%{version}-%(release).tar.gz 
    Source0:  %{name}-%{version}.tar.gz 
    #BuildArch:  i386 
    BuildRoot:  %{_tmppath}/%{name}-root 
    Packager:  PhonPanom Sivilay 
    Url:   [http://www.kjbsoft.com] 
    Vendor:   PhonPanom Sivilay 
    Requires:  libtool 

    %define QT_LIB /opt/Qt5.7.0/5.7/gcc_64/lib/ 

    %description 
    KPI Viewer 

    %prep 
    %setup -q -n %{name}-%{version} 

    %build 
    # % configure 
    qmake KPIViewer.pro 
    make %{?_smp_mflags} BINDIR=%{_bindir} 

    %install 
    mkdir -p $RPM_BUILD_ROOT/usr/{bin,share} 
    mkdir -p $RPM_BUILD_ROOT/usr/bin/%{name} 
    mkdir -p $RPM_BUILD_ROOT/usr/bin/%{name}/platforms 
    mkdir -p $RPM_BUILD_ROOT/usr/share/{applications,pixmaps} 
    mkdir -p $RPM_BUILD_ROOT%{QT_LIB} 
    install %{name} $RPM_BUILD_ROOT/usr/bin/%{name} 
    #install %{name}.sh $RPM_BUILD_ROOT/usr/bin/%{name} 
    #install %{QT_LIB}libQt5*.so.* $RPM_BUILD_ROOT/usr/bin/%{name} 
    #install %{QT_LIB}libicu*.so.* $RPM_BUILD_ROOT/usr/bin/%{name} 
    #install %{QT_LIB}libq* $RPM_BUILD_ROOT/usr/bin/%{name}/platforms 
    install %{QT_LIB}libQt5*.so.* $RPM_BUILD_ROOT%{QT_LIB} 
    install %{QT_LIB}libicu*.so.* $RPM_BUILD_ROOT%{QT_LIB} 
    install %{QT_LIB}libq* $RPM_BUILD_ROOT%{QT_LIB} 
    #install %{name}.desktop $RPM_BUILD_ROOT/usr/share/applications 
    #install %{name}.png $RPM_BUILD_ROOT/usr/share/pixmaps 

    %files 
    % defattr(-,root,root) 
    %{_bindir}/%{name}/%{name} 
    %{_bindir}/%{name}/%{name}.sh 
    %{_bindir}/%{name}/libicu* 
    %{_bindir}/%{name}/libQt5* 
    %{_bindir}/%{name}/platforms/libq* 
    %{_datadir}/applications/%{name}.desktop 
    %{_datadir}/pixmaps/%{name}.png 

    %clean 
    rm -rf $RPM_BUILD_ROOT 
    rm -rf $RPM_BUILD_DIR 

    %changelog 
     * Mon Aug 29 2016 super2lao 
     - Initial build 

インストール段階では、次のエラーが発生します。

 

    extracting debug info from /home/makerpm/rpmbuild/BUILDROOT/KPIViewer-1.0-1.fc24.x86_64/usr/bin/KPIViewer/KPIViewer 
    extracting debug info from /home/makerpm/rpmbuild/BUILDROOT/KPIViewer-1.0-1.fc24.x86_64/opt/Qt5.7.0/5.7/gcc_64/lib/libicudata.so.56.1 
    xz: /tmp/tmp.JB9sU3EDbZ: No such file or directory 
    objcopy: cannot open: /tmp/tmp.JB9sU3EDbZ.xz: No such file or directory 
    extracting debug info from /home/makerpm/rpmbuild/BUILDROOT/KPIViewer-1.0-1.fc24.x86_64/opt/Qt5.7.0/5.7/gcc_64/lib/libicui18n.so.56 
    extracting debug info from /home/makerpm/rpmbuild/BUILDROOT/KPIViewer-1.0-1.fc24.x86_64/opt/Qt5.7.0/5.7/gcc_64/lib/libicudata.so.56 
    xz: /tmp/tmp.WVrLRUiOv4: No such file or directory 
    objcopy: cannot open: /tmp/tmp.WVrLRUiOv4.xz: No such file or directory 
    *** WARNING: identical binaries are copied, not linked: 
      /opt/Qt5.7.0/5.7/gcc_64/lib/libicudata.so.56 
     and /opt/Qt5.7.0/5.7/gcc_64/lib/libicudata.so.56.1 
    extracting debug info from /home/makerpm/rpmbuild/BUILDROOT/KPIViewer-1.0-1.fc24.x86_64/opt/Qt5.7.0/5.7/gcc_64/lib/libicui18n.so.56.1 
    *** WARNING: identical binaries are copied, not linked: 
      /opt/Qt5.7.0/5.7/gcc_64/lib/libicui18n.so.56.1 
     and /opt/Qt5.7.0/5.7/gcc_64/lib/libicui18n.so.56 
    extracting debug info from /home/makerpm/rpmbuild/BUILDROOT/KPIViewer-1.0-1.fc24.x86_64/opt/Qt5.7.0/5.7/gcc_64/lib/libicuuc.so.56 
    extracting debug info from /home/makerpm/rpmbuild/BUILDROOT/KPIViewer-1.0-1.fc24.x86_64/opt/Qt5.7.0/5.7/gcc_64/lib/libicuuc.so.56.1 
    *** WARNING: identical binaries are copied, not linked: 
      /opt/Qt5.7.0/5.7/gcc_64/lib/libicuuc.so.56.1 
     and /opt/Qt5.7.0/5.7/gcc_64/lib/libicuuc.so.56 
    dwz: Too few files for multifile optimization 
    /usr/lib/rpm/sepdebugcrcfix: Updated 0 CRC32s, 7 CRC32s did match. 
    + '[' '%{buildarch}' = noarch ']' 
    + QA_CHECK_RPATHS=1 
    + case "${QA_CHECK_RPATHS:-}" in 
    + /usr/lib/rpm/check-rpaths 
    ******************************************************************************* 
    * 
    * WARNING: 'check-rpaths' detected a broken RPATH and will cause 'rpmbuild' 
    *   to fail. To ignore these errors, you can set the '$QA_RPATHS' 
    *   environment variable which is a bitmask allowing the values 
    *   below. The current value of QA_RPATHS is 0x0000. 
    * 
    * 0x0001 ... standard RPATHs (e.g. /usr/lib); such RPATHs are a minor 
    *    issue but are introducing redundant searchpaths without 
    *    providing a benefit. They can also cause errors in multilib 
    *    environments. 
    * 0x0002 ... invalid RPATHs; these are RPATHs which are neither absolute 
    *    nor relative filenames and can therefore be a SECURITY risk 
    * 0x0004 ... insecure RPATHs; these are relative RPATHs which are a 
    *    SECURITY risk 
    * 0x0008 ... the special '$ORIGIN' RPATHs are appearing after other 
    *    RPATHs; this is just a minor issue but usually unwanted 
    * 0x0010 ... the RPATH is empty; there is no reason for such RPATHs 
    *    and they cause unneeded work while loading libraries 
    * 0x0020 ... an RPATH references '..' of an absolute path; this will break 
    *    the functionality when the path before '..' is a symlink 
    *   
    * 
    * Examples: 
    * - to ignore standard and empty RPATHs, execute 'rpmbuild' like 
    * $ QA_RPATHS=$((0x0001|0x0010)) rpmbuild my-package.src.rpm 
    * - to check existing files, set $RPM_BUILD_ROOT and execute check-rpaths like 
    * $ RPM_BUILD_ROOT= /usr/lib/rpm/check-rpaths 
    * 
    ******************************************************************************* 
    ERROR 0002: file '/usr/bin/KPIViewer/KPIViewer' contains an invalid rpath '/opt/Qt5.7.0/5.7/gcc_64/lib' in [/opt/Qt5.7.0/5.7/gcc_64/lib] 
    error: Bad exit status from /var/tmp/rpm-tmp.CbBYR1 (%install) 


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

私の責任は何ですか? 私を助けてください。 ありがとうございます。

答えて

0

Fedoraで修正方法を説明していますhere

これは通常configureへの呼び出し後にspecファイルでは、私の作品:

%configure 
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool 
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool 
+0

は、あなたのrepsonseいただきありがとうございます。ところで、私はこれでこのエラーを受けました。 私を導くことができますか?

 + sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed: can't read libtool: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.Qa4Ds9 (%build) 
PhonPanom

+0

手作業でビルドする場合、 'configure'を実行した後に' libtool'がありますか? –

+0

ご覧のとおり、これはqtプログラムです。私はconfigureを使っていません。ちょうどqmakeを使いました。そしてlibtoolをインストールしました。 – PhonPanom

関連する問題