Cmake/Cpack creates a corrupt .rpm

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Cmake/Cpack creates a corrupt .rpm

Gonzalo Garramuño
I have a CMakeLists.txt (extract) with the following commands:


SET(CPACK_GENERATOR DEB RPM TGZ )

# SET the installation directory.

SET(CPACK_SET_DESTDIR true) # Needed
SET(CPACK_INSTALL_PREFIX /usr/local/${mrViewerShortName})

SET(CPACK_RPM_PACKAGE_NAME mrViewer)
SET(CPACK_RPM_PACKAGE_RELOCATABLE false)


SET(  CPACK_RPM_POST_INSTALL_SCRIPT_FILE
     ${PROJECT_BINARY_DIR}/etc/Linux/install.sh)
SET( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
     ${PROJECT_BINARY_DIR}/etc/Linux/uninstall.sh)


   SET(CPACK_PACKAGE_VENDOR "Film Aura, LLC")
   SET(CPACK_PACKAGE_VERSION_MAJOR ${VersionMajor})
   SET(CPACK_PACKAGE_VERSION_MINOR ${VersionMinor})
   SET(CPACK_PACKAGE_VERSION_PATCH ${VersionPatch})
   SET(CPACK_PACKAGE_VERSION "${SHORTVERSION}" )
   SET(CPACK_PACKAGE_FILE_NAME "${mrViewerPackageName}" )
   SET(CPACK_PACKAGE_CONTACT "[hidden email]")
   SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
       "mrViewer provides professional flipbook, audio and video playback.")


#SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${mrViewerPackageName} )
SET(CPACK_RESOURCE_FILE_LICENSE
${PROJECT_SOURCE_DIR}/../../docs/LICENSE.txt)

SET( CPACK_OUTPUT_CONFIG_FILE "${CMAKE_BINARY_DIR}/BundleConfig.cmake" )
include(CPack)

ADD_CUSTOM_TARGET( bundle
                COMMAND "${CMAKE_CPACK_COMMAND}"
                "-C" "$<CONFIGURATION>"
                "--config" "${CMAKE_BINARY_DIR}/BundleConfig.cmake"
                COMMENT "Running CPack. Please wait..."
                USES_TERMINAL
                DEPENDS translations )

This creates a valid DEB file but an invalid RPM which fails with:

Running transaction
Preparing : 1/1
Running scriptlet: mrViewer-5.0.5.20190517-1.x86_64 1/1
Installing : mrViewer-5.0.5.20190517-1.x86_64 1/1
Error unpacking rpm package mrViewer-5.0.5.20190517-1.x86_64
error: unpacking of archive failed: cpio: read

Verifying : mrViewer-5.0.5.20190517-1.x86_64 1/1

Failed:
mrViewer-5.0.5.20190517-1.x86_64

Error: Transaction failed


You can find the RPM file here:

https://sourceforge.net/projects/mrviewer/files/v5.0.6/mrViewer-v5.0.6-Linux-64.rpm/download

If I use:

rpm -ql mrViewer-v5.0.6-Linux-64.rpm

all files are there.  However, when installing, the installer fails on
reaching the lib directory of the rpm.

CMake/CPack used to build the rpm just fine some (long) versions ago
with this same CMakeLists.txt.


--
Gonzalo Garramuño

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Cmake/Cpack creates a corrupt .rpm

Gonzalo Garramuño

El 30/5/19 a las 12:51, Gonzalo Garramuño escribió:

> I have a CMakeLists.txt (extract) with the following commands:
>
>
> SET(CPACK_GENERATOR DEB RPM TGZ )
>
> # SET the installation directory.
>
> SET(CPACK_SET_DESTDIR true) # Needed
> SET(CPACK_INSTALL_PREFIX /usr/local/${mrViewerShortName})
>
> SET(CPACK_RPM_PACKAGE_NAME mrViewer)
> SET(CPACK_RPM_PACKAGE_RELOCATABLE false)
>
>
> SET(  CPACK_RPM_POST_INSTALL_SCRIPT_FILE
>     ${PROJECT_BINARY_DIR}/etc/Linux/install.sh)
> SET( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
>     ${PROJECT_BINARY_DIR}/etc/Linux/uninstall.sh)
>
>
>   SET(CPACK_PACKAGE_VENDOR "Film Aura, LLC")
>   SET(CPACK_PACKAGE_VERSION_MAJOR ${VersionMajor})
>   SET(CPACK_PACKAGE_VERSION_MINOR ${VersionMinor})
>   SET(CPACK_PACKAGE_VERSION_PATCH ${VersionPatch})
>   SET(CPACK_PACKAGE_VERSION "${SHORTVERSION}" )
>   SET(CPACK_PACKAGE_FILE_NAME "${mrViewerPackageName}" )
>   SET(CPACK_PACKAGE_CONTACT "[hidden email]")
>   SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
>       "mrViewer provides professional flipbook, audio and video
> playback.")
>
>
> #SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${mrViewerPackageName} )
> SET(CPACK_RESOURCE_FILE_LICENSE
> ${PROJECT_SOURCE_DIR}/../../docs/LICENSE.txt)
>
> SET( CPACK_OUTPUT_CONFIG_FILE "${CMAKE_BINARY_DIR}/BundleConfig.cmake" )
> include(CPack)
>
> ADD_CUSTOM_TARGET( bundle
>                COMMAND "${CMAKE_CPACK_COMMAND}"
>                "-C" "$<CONFIGURATION>"
>                "--config" "${CMAKE_BINARY_DIR}/BundleConfig.cmake"
>                COMMENT "Running CPack. Please wait..."
>                USES_TERMINAL
>                DEPENDS translations )
>
> This creates a valid DEB file but an invalid RPM which fails with:
>
> Running transaction
> Preparing : 1/1
> Running scriptlet: mrViewer-5.0.5.20190517-1.x86_64 1/1
> Installing : mrViewer-5.0.5.20190517-1.x86_64 1/1
> Error unpacking rpm package mrViewer-5.0.5.20190517-1.x86_64
> error: unpacking of archive failed: cpio: read
>
> Verifying : mrViewer-5.0.5.20190517-1.x86_64 1/1
>
> Failed:
> mrViewer-5.0.5.20190517-1.x86_64
>
> Error: Transaction failed
>
>
> You can find the RPM file here:
>
> https://sourceforge.net/projects/mrviewer/files/v5.0.6/mrViewer-v5.0.6-Linux-64.rpm/download 
>
>
> If I use:
>
> rpm -ql mrViewer-v5.0.6-Linux-64.rpm
>
> all files are there.  However, when installing, the installer fails on
> reaching the lib directory of the rpm.
>
> CMake/CPack used to build the rpm just fine some (long) versions ago
> with this same CMakeLists.txt.
>
Forgot to mention, I am using cmake 3.14.1.

--
Gonzalo Garramuño

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Cmake/Cpack creates a corrupt .rpm

Gonzalo Garramuño
In reply to this post by Gonzalo Garramuño

El 30/5/19 a las 12:51, Gonzalo Garramuño escribió:
> rpm -ql mrViewer-v5.0.6-Linux-64.rpm

If I run cpio -i < mrViewer-v5.0.6-Linux-64.rpm

I get a bunch of warnings of Incorrect numbers (and garbage) and Cannot
make mknod: the multibyte or extended character is incomplete or
invalid, and attention: 4390 bytes of garbage skipped and header is
reversed and type of archive unknown and premature end of the archive.

--
Gonzalo Garramuño

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Cmake/Cpack creates a corrupt .rpm

Zan Lynx
On May 30, 2019 5:21:59 PM MST, "Gonzalo Garramuño" <[hidden email]> wrote:

>
>El 30/5/19 a las 12:51, Gonzalo Garramuño escribió:
>> rpm -ql mrViewer-v5.0.6-Linux-64.rpm
>
>If I run cpio -i < mrViewer-v5.0.6-Linux-64.rpm
>
>I get a bunch of warnings of Incorrect numbers (and garbage) and Cannot
>
>make mknod: the multibyte or extended character is incomplete or
>invalid, and attention: 4390 bytes of garbage skipped and header is
>reversed and type of archive unknown and premature end of the archive.

RPM files are not cpio. They contain a cpio. Use rpm2cpio as a filter.
--
                Knowledge is Power -- Power Corrupts
                        Study Hard -- Be Evil
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Cmake/Cpack creates a corrupt .rpm

Gonzalo Garramuño

El 30/5/19 a las 21:36, Zan Lynx escribió:
> RPM files are not cpio. They contain a cpio. Use rpm2cpio as a filter.

Thanks for that.  Using:

rpm2cpio mrViewer-v5.0.7-Linux-64.rpm | cpio -idmv

I can extract all the contents of the archive with no errors.

However, rpm -i bails out with a cpio: read error.  I don't know what to
try next.  I have to wonder if the pre/post install scripts are the problem.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Cmake/Cpack creates a corrupt .rpm

Gonzalo Garramuño

El 30/5/19 a las 22:16, Gonzalo Garramuño escribió:

>
> El 30/5/19 a las 21:36, Zan Lynx escribió:
>> RPM files are not cpio. They contain a cpio. Use rpm2cpio as a filter.
>
> Thanks for that.  Using:
>
> rpm2cpio mrViewer-v5.0.7-Linux-64.rpm | cpio -idmv
>
> I can extract all the contents of the archive with no errors.
>
> However, rpm -i bails out with a cpio: read error.  I don't know what
> to try next.  I have to wonder if the pre/post install scripts are the
> problem.
>
Okay.  I found the root of the problem in the OS I was trying the RPM. 
Fedora 30 has the problem installing.  CentOS 7, for example, works just
fine.   Not sure what has changed in Fedora (or if it ever worked on
it).  Can someone confirm that their cmake .rpm's work in Fedora 30
(thus, throwing my assumption out of the water)?

Thanks in advance.

--
Gonzalo Garramuño

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake