I'm creating an RPM file using CMake's RPM support. I have found that the permissions of directories created on installation of the RPM depend on the umask of the user who created the RPM. I have tried setting CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS but that does not seem to help.
How to set directory permission bits in an RPM file built by CMake?
168 Views Asked by Greg Hewgill At
1
There are 1 best solutions below
Related Questions in CMAKE
- Build issue in my STM32-NUCLEO project using the Eclipse IDE
- CMake: "dereference" INCLUDE commands to create a single CMakeLists.txt
- Conda CMAKE CXX Compiler error while compiling Pytorch
- How to setup nist nbis in raspbian raspberry pi 4
- Compiling c++ code by VS Code is always blocked by clang-tidy error 'Error running 'clang-tidy'
- library X11_Xmu_LIB is not found
- Cannot build a basic project with curl on Mac (M2) for Raspberry Pi Pico
- How to install spdlog library?
- How to generate vulkan project so it is cross-platform? (Using CMake)
- If target A depends on B, are B's POST_BUILD commands guaranteed to be executed before A starting to build?
- i have installed qt version 6.0.3 and this error QMYSQL driver not loaded displaying again and again
- Configure CmakeLists.txt to avoid manually copying dlls
- Cmake is not building an executable
- How to use "wx_dpi_aware.manifest" of wxWidgets wxMSW with MinGW and CMake?
- Try to Install GLFW on Steam Deck
Related Questions in FILE-PERMISSIONS
- Change file permsission on Android app programmatically
- Connecting to SQL Server and performing BULK INSERT from Linux Container
- File says permission denied, despite the fact that I have run 'chmod 777' on the file
- elasticsearch cannot read certificate file
- Simple and basic python csv file opening
- How to choose Dev devices Permissions
- Set permissions to "DENY" file and folder deletion in Windows 2016 Server
- Compressing a Picture in flutter returns null
- SOLVED -- Saving an image from Photo Picker in app folder for permanent access
- Cannot display a file in an expo react-native mobile app project using react-native-webview dependency's WebView component
- How can I get permission to save file for flet app on android?
- Making file manager app in Android Studio and can't write to storage
- Windows service not able to delete a file
- how to create SharePoint document-level permissions by copying the permissions at a file level to a field in the index?
- How to Change the UNIX File Ownership and Permission for a File Copied to the Azure Blob Container?
Related Questions in RPM
- RPM package signature verification in Ubuntu
- CentOS/RHEL download dependencies
- JFrog Xray SBOM: Why are there rpm packages with multiple versions that doesn't show up on my docker container?
- Stopping Jenkins from Incrementing Job Numbers When Restarting from a Stage
- building ruby 3.3.0 rpm on amazonlinux2023 is linking to hard coded directories
- RPM fails to install because of a directory conflict even though permissions are the same
- RPM Specfile wrong dependancy version resolved during dnf install
- Generated RPM has requirement on files it contains but doesn't provide them
- Testing installation and deployment of RPM
- RPM Require installs wrong dependency
- How does one tell yum to ignore a repo file with a parsing error?
- Install Multiple Tomcat9 Instance using RHEL RPM Package
- How to use "zypper info" with a specific version of a package
- How to add custom metadata using fpm for rpm/deb pacakges
- rpmbuild -bs fails for Illegal character
Related Questions in CPACK
- create an uninstaller for CPack package on MacOS
- Remove extra files added after installation when uninstall with a Wix package generated by cpack
- How can I allow my Wix package generated by CPack to upgrade the installed software which is an older version?
- How to define the target (apt install -t") of a built package to distinguish when with the same name
- MariaDB 10.9.* for Fedora 39 - CPack Error
- How to set environment before running custom action?
- Run executable during setup process with 3rd party dependencies
- How to use WIX V4 within CMAKE to build an installation package for Windows
- Using a NuGet Package Created with CPack in Visual Studio
- cpack -B build/ fails in parent directory
- How to enable language selection display using cpack, cmake and NSIS?
- CMake : how to have CPack put all component files into a single directory?
- Install 3rd party macOS installer package
- How to set directory permission bits in an RPM file built by CMake?
- Cpack + NSIS - Not using custom NSIS configuration template
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The creation of RPM files in CMake/CPack follows two steps. First, a temporary directory structure is created under subdirectories of
_CPack_Packages/. Then, this temporary directory structure is used to create the RPM file.When CPack implicitly creates temporary directories, it uses the
CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONSvariable to request particular permissions. Under normal operation ofmkdir(), this is modified by the processumask. For example, underumask 022and the following statement in theCMakeLists.txtfile:the directory permissions will be
Under
umask 027, the permissions will beWhen the second step of the RPM build is performed, the generated RPM
.specfile contains:and the permissions embedded in the RPM file are copied from the actual temporary directories created by CMake. If the software installed by the RPM expects to be able to read the installed files by any user, then the installation would fail to work correctly.
The solution is to use CPACK_RPM_DEFAULT_DIR_PERMISSIONS instead, like this:
When using this setting, the generated
.specfile contains:where
755is the specific permissions applied upon installation of the RPM. In this situation, the permission bits of the temporary files created by CMake (which would still be subject toumaskadjustment) are no longer relevant.When RPM
.specfiles are crafted by hand, it would of course be good practice to explicitly set the installed file and directory permissions as needed. The above shows how to accomplish this using CMake's RPM creation support.