neithernut / pam_e4crypt

PAM module for unlocking transparently encrypted directories on ext4
GNU General Public License v2.0
19 stars 8 forks source link

Changing LIBDIR to /usr/lib #7

Closed seebaclo closed 7 years ago

seebaclo commented 7 years ago

Hello, I'm trying build your module and I have to set install path as /usr/lib but it's falling to /usr/lib64 instead. Here is relevant part from https://github.com/neithernut/pam_e4crypt/blob/e026ffe267b42f774a04358a9f55d7dd86d4ec80/CMakeLists.txt

# install the module in the same place where all the other modules should be
# NOTE: we actually disrespect the install prefix here
get_filename_component(LIBDIR ${PAM_LIBRARY} DIRECTORY)
install(TARGETS pam_e4crypt
LIBRARY DESTINATION "${LIBDIR}/security/

Could you guide me how to fix this?

Thank you for this great work!

neithernut commented 7 years ago

The PAM modules are usually installed in a directory security, which resides in the directory where the PAM library is stored.

The path of the PAM library is located in line 9 of the file. In the snippet you quoted, this path is used as the base path under which the modules are installed. I did not pay much attention to the search order used by CMake. This might lead to non-ideal results. On my system, for example, both /lib64 and /usr/lib64 contain a libpam.so (both installed by the same package). However, all modules are installed in /lib64/security.

I should probably come up with a better detection technique (e.g. look for the security folder). Also, I'll probably add a CMake option for setting LIBDIR directly. As a quick fix, you could change "${LIBDIR}/security/" in line 29 to the desired path, manually.

Still, I find the situation strange. Normally, on amd64, libraries are installed in the lib64 and lib32 directories and lib is just a symlink to lib64. Is this not the case on your platform? If not, could it be that you have a libpam.so in both /usr/lib and /usr/lib64? Maybe one of those is just a symlink to the other?


TL;DR: for now, change ${LIBDIR}/security/" in line 29 to "/usr/lib/security/". The situation may improve soonish.

seebaclo commented 7 years ago

Sorry, I didn't clarified my situation. I'm using archlinux. My/lib, /lib64 and /usr/lib64 are symlinks to /usr/lib. It's the same as if you install usrmerge package in Debian.