0
0
Fork 0
mirror of https://github.com/boltgolt/howdy.git synced 2024-09-12 09:41:18 +02:00

Turn subproject as fallback (#1)

Use system-wide INIReader if available or fallback to use subproject
This commit is contained in:
supdrewin 2022-01-20 03:42:11 +08:00 committed by musikid
parent ab4a492c37
commit 827f638be6
No known key found for this signature in database
GPG key ID: 7567D43648C6E2F4
3 changed files with 37 additions and 12 deletions

View file

@ -1,20 +1,34 @@
# Howdy PAM module
## Prepare
Howdy PAM module depends on `INIReader`.
If you are building a distro package,
there is a list for it below:
```
Arch Linux - libinih
Debian - libinih-dev
Fedora - inih-devel
OpenSUSE - inih
```
## Build
```sh
meson setup build -Dinih:with_INIReader=true
``` sh
meson setup build
meson compile -C build
```
## Install
```sh
sudo mv build/libpam_howdy.so /lib/security/pam_howdy.so
``` sh
sudo meson install -C build
```
Change PAM config line to:
```pam
auth sufficient pam_howdy.so
``` pam
auth sufficient pam_howdy.so
```

View file

@ -1,9 +1,20 @@
project('pam_howdy', 'cpp', version: '0.1.0', default_options: ['cpp_std=c++14'])
inih = subproject('inih')
inih_cpp = inih.get_variable('INIReader_dep')
libpam = meson.get_compiler('c').find_library('pam')
boost = dependency('boost', modules: ['locale'])
inih_cpp = dependency('INIReader', fallback: ['inih', 'INIReader_dep'])
libpam = meson.get_compiler('cpp').find_library('pam')
threads = dependency('threads')
shared_library('pam_howdy', 'main.cc', dependencies: [boost, libpam, inih_cpp, threads], install: true, install_dir: '/lib/security/')
shared_library(
'pam_howdy',
'main.cc',
dependencies: [
boost,
libpam,
inih_cpp,
threads
],
install: true,
install_dir: '/lib/security',
name_prefix: ''
)

View file

@ -1,3 +1,3 @@
[wrap-git]
url = https://github.com/benhoyt/inih.git
revision = r52
revision = head