On 10/09/2014 07:30 PM, Evgeny Kalishenko wrote:
> 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.k...@kitware.com
> <mailto:brad.k...@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
>
>
>
>
> -- 
> С уважением,
> Евгений Калишенко
>
>
In this hunk:
+#  May be used to set RPM postinstall dependencies (requires(post)). 
Note that you must enclose
+#  the complete requires string between quotes, for example::
+#
+#   set(CPACK_RPM_PACKAGE_REQUIRES_PRE "shadow-utils, initscripts")
+#
+#

The variable name CPACK_RPM_PACKAGE_REQUIRES_PRE should be
CPACK_RPM_PACKAGE_REQUIRES_POST.

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()

Shouldn't braces be called parentheses here ( i.e '(' versus '{' )?

I have checked with a minimal project on a ubuntu 14.04 box (using rpm
4.11.1) and the generated package seems good. So, no further comments.

With kind regards,
Micha Hergarden

Attachment: signature.asc
Description: OpenPGP digital signature

-- 

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-developers

Reply via email to