[CMake] RPM package and relocation
Craig Scott
craig.scott at crascit.com
Wed May 10 08:20:27 EDT 2017
You probably need to show us the postinstall script for us to be able to
see the problem. Also, in case you haven't found it already, the MaximumRPM
manual may be helpful (although it seems you've already found the
essentials and that document could be getting a bit dated by now):
http://ftp.rpm.org/max-rpm/
specifically chapter 15: Making A Relocatable Package and chapter 13:
Scripts: RPM's Workhorse. You might also want to check you are not having
the problem described in this stackoverflow answer
<http://stackoverflow.com/a/18543423/1938798> regarding when variables get
substituted.
On Wed, May 10, 2017 at 9:26 PM, Kristian <kristianonline28 at gmail.com>
wrote:
> Hi,
>
> I am creating an RPM package, which on a standard installation should
> install the file into /opt/ssp-suite directory. But I want to give the
> user the opportunity, to install the package into another directory.
>
> I am doing this with these lines:
>
> > set(INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/ssp-suite)
> > install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ssp/" DESTINATION
> ${INSTALL_DIR})
>
> and by running cmake with
>
> > cmake -DCMAKE_INSTALL_PREFIX=/opt -V --debug .
>
> But I also need to execute a post script, which runs after installation. I
> added
>
> > set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/
> postinstall")
>
> to my CMakeLists.txt and in that script, I am using the RPM variable
> $RPM_INSTALL_PREFIX. But during installation, I get this error message
>
> > chmod: cannot access '/usr/usr/bin/startssp': No such file or directory
> > warning: %post(ssp-suite-7.1-1.x86_64) scriptlet failed, exit status 1
> > Non-fatal POSTIN scriptlet failure in rpm package ssp-suite-7.1-1.x86_64
>
> Can someone give me some hints, how to change / add lines to
> CMakeListst.txt and my postinstall script, so that script can be fully
> relocatable?
> --
>
> 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:
> http://public.kitware.com/mailman/listinfo/cmake
>
--
Craig Scott
Melbourne, Australia
https://crascit.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170510/94895c64/attachment.html>
More information about the CMake
mailing list