2016-08-29 16 views
0

предшественники. У меня возникла проблема с созданием RPM из исходного кода. В Qt5 написано Qt5.7.0. Моя система Fedora 24. Я установил qt-opensource-linux-x64-5.7.0.run и успешно скомпилировал свой код. Но при создании RPM у меня есть ошибка на этапе установки.Создание RPM приложения Qt5

Мой файл 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:

%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