[cmake-developers] [PATCH] Preinstall requirements support for CPack RPM generator

Evgeny Kalishenko ydginster at gmail.com
Thu Oct 9 13:30:15 EDT 2014


Ok, thanks for the advise about STREQUAL. Explanation of s/_/(/ (from
http://www.rpm.org/max-rpm-snapshot/s1-rpm-depend-manual-dependencies.html):
"Recent versions of RPM support context marked dependencies. This is a
special type of a dependency that applies only in a specified *context*.
Using this feature, one can specify dependencies for pre- and
post(un)install scriptlets, ie. the context of a dependency is the
execution time of the specified scriptlet.

The syntax for specifying these dependencies is:

Requires(*X*): foo

 Here, *X* can be one of *pre*, *post*, *preun*, or *postun*, which tells
RPM that the package depends on package foo for running the corresponding
*%pre*, *%post*, *%preun*, or *%postun* script."

Modified patch attached.

2014-10-09 18:03 GMT+04:00 Brad King <brad.king at kitware.com>:

> On 10/08/2014 01:48 PM, Evgeny Kalishenko wrote:
> > I was interested in feature request
> > http://public.kitware.com/Bug/view.php?id=14769 and made a
> > simple patch for CPack RPM generator (attached).
>
> Thanks.
>
> In this hunk:
>
> > +    # The following keywords require braces around the "pre" or "post"
> suffix in the final RPM spec file.
> > +    if("${_RPM_SPEC_HEADER}" MATCHES "REQUIRES_PRE"  OR
> "${_RPM_SPEC_HEADER}" MATCHES "REQUIRES_POST")
> > +      string(REPLACE "_" "(" _PACKAGE_HEADER_NAME
> "${_PACKAGE_HEADER_NAME}")
> > +      set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME})")
> > +    endif()
>
> The MATCHES conditions can use simply STREQUAL instead.
> I'm not very familiar with the spec format, so please
> explain the purpose of the s/_/(/ subsitution in comments
> here.
>
> Thanks,
> -Brad
>
>


-- 
С уважением,
Евгений Калишенко
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20141009/87040bf7/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pre_post_rpm_install.patch
Type: text/x-patch
Size: 5997 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20141009/87040bf7/attachment-0002.bin>


More information about the cmake-developers mailing list