[CMake] Stopping CPack from compiling python files

Domen Vrankar domen.vrankar at gmail.com
Thu Jan 28 08:07:25 EST 2016


> Not sure how we can disable such script call from CPackRPM unless adding the
> extra feature to call
> rpm/rpmbuild wiht appropriate option. May be you can try to fill the
> CPACK_RPM_SPEC_MORE_DEFINE variable
> with appropriate macro redefining "__os_install_post".
>
> This would be more like a hack than a solution.

As far as I can tell from links such as
https://www.redhat.com/archives/rpm-list/2007-November/msg00020.html
and
http://www.math-linux.com/linux/rpm/article/how-to-turn-off-avoid-brp-python-bytecompile-script-in-a-spec-file
there is no non hack solution for this so even if we'd put it in
CPackRPM it would be a hackish workaround.

Content from the second link might be the right candidate for
CPACK_RPM_SPEC_MORE_DEFINE (haven't tested it).

set(CPACK_RPM_SPEC_MORE_DEFINE "%global __os_install_post %(echo
'%{__os_install_post}' | sed -e
's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')")

Regards,
Domen


More information about the CMake mailing list