[MXS-305] Do not build packages into / with make package Created: 2015-08-10  Updated: 2015-09-17  Resolved: 2015-08-16

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 1.2.0
Fix Version/s: 1.2.1

Type: Bug Priority: Minor
Reporter: Simon J Mudd Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

Note: when building and trying to make a package I get this error:

[smudd@localhost build]$ make package
...
[ 98%] Built target hintfilter
[100%] Built target maxadmin
Run CPack packaging tool...
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: MaxScale
CPack: - Install project: MaxScale
CMake Error at /home/smudd/github.com/mariadb-corporation/MaxScale/build/cmake_install.cmake:60 (FILE):
file INSTALL cannot copy file
"/home/smudd/github.com/mariadb-corporation/MaxScale/server/maxscale_template.cnf"
to "/etc/maxscale.cnf".

CMake Error at /home/smudd/github.com/mariadb-corporation/MaxScale/build/cmake_install.cmake:76 (FILE):
file INSTALL cannot copy file "/usr/share/mysql/english/errmsg.sys" to
"/var/lib/maxscale/errmsg.sys".

CPack Error: Error when generating package: maxscale
make: *** [package] Error 1
[smudd@localhost build]$

Note: how this is trying to build into root. I'm running as a non-root user and therefore this fails. When building packages you should be able to build into a "buildroot" and then install files relative to that directory. I've not looked at the package build process but this is obviously not being done. It pushes people to change to the root user which then populates/overwrites data in real directories which should not be done.

Having build other rpm packages most other software allows for stuff to be built into a "buildroot" for package building and then the files are collected from there. The same process should happen here as otherwise doing make package is going to possibly destroy your running system. Given you've said you want to build this as a package the only way the files should be installed is with the package manager not via the cmake installer.



 Comments   
Comment by markus makela [ 2015-08-16 ]

Fixed by setting the CPACK_SET_DESTDIR variable to true. This disables relocation of RPM packages but allows for non-root users to do packaging and prevents file installation during packaging.

Generated at Thu Feb 08 03:58:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.