Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install_dir is hard coded to '/lib/security' #80

Closed
spike77453 opened this issue Oct 31, 2021 · 1 comment · Fixed by #82
Closed

install_dir is hard coded to '/lib/security' #80

spike77453 opened this issue Oct 31, 2021 · 1 comment · Fixed by #82

Comments

@spike77453
Copy link
Contributor

spike77453 commented Oct 31, 2021

It seems that install_dir is hard coded to /lib/security: https://github.com/NigelCunningham/pam-MySQL/blob/master/meson.build#L270

This is a problem on Fedora (and by extension also on RHEL/CentOS etc.) since the correct directory is platform dependent (e.g. /lib/security on 32bit platforms and /lib64/security on 64bit platforms, see: https://docs.fedoraproject.org/en-US/packaging-guidelines/RPMMacros/, technically /usr/lib/security and /usr/lib64/security since https://fedoraproject.org/wiki/Features/UsrMove)

I couldn't find any (reasonably easy) way to set install_dir during build time, but this might be me knowing little to nothing about meson. It'd be nice if this could be configurable so it can be set to %{_libdir}

There's also https://github.com/NigelCunningham/pam-MySQL/blob/master/install.sh which tries to address this. But that of course doesn't work in an rpm build environment:

+ /usr/bin/meson install -C x86_64-redhat-linux-gnu --no-rebuild
Installing libpam_mysql.so to /builddir/build/BUILDROOT/pam_mysql-1.0.0~beta1-1.fc34.x86_64/lib/security
Running custom install script '/builddir/build/BUILD/pam-MySQL-1.0.0-beta1/install.sh'
--- stdout ---

--- stderr ---
mv: cannot stat '/lib/security/libpam_mysql.so': No such file or directory
strip: '/lib/security/pam_mysql.so': No such file

FAILED: install script '/builddir/build/BUILD/pam-MySQL-1.0.0-beta1/install.sh' exit code 1, stopped

The current expansion of the %meson macro on Fedora 34 looks something like this:

/usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload --auto-features=enabled . x86_64-redhat-linux-gnu

So the right directory to use is probably libdir: https://mesonbuild.com/Builtin-options.html

@spike77453
Copy link
Contributor Author

Here's a working scratch build: https://copr.fedorainfracloud.org/coprs/spike/pam-MySQL/build/2915175/

I did:

sed -i "s#install_dir: '/lib/security'#install_dir: join_paths(get_option('libdir'), 'security')#" meson.build

Please take it with a grain of salt though since I have no idea if that's how things are done with meson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant