packages/net/ksmbd-tools/patches/010-meson.patch
Rosen Penev f95519ace3 ksmbd-tools: add meson build
Avoids iconv problems.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-06-12 16:31:55 -07:00

142 lines
3.8 KiB
Diff

From a8ed6b5a752bd7e50940c9e198af3edc3af0d5f7 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Sat, 2 Jan 2021 21:05:53 -0800
Subject: [PATCH] add meson build
meson compiles faster and is simpler than autotools.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
addshare/meson.build | 10 ++++++++++
adduser/meson.build | 12 ++++++++++++
control/meson.build | 8 ++++++++
lib/meson.build | 18 ++++++++++++++++++
meson.build | 29 +++++++++++++++++++++++++++++
meson_options.txt | 3 +++
mountd/meson.build | 16 ++++++++++++++++
7 files changed, 96 insertions(+)
create mode 100644 addshare/meson.build
create mode 100644 adduser/meson.build
create mode 100644 control/meson.build
create mode 100644 lib/meson.build
create mode 100644 meson.build
create mode 100644 meson_options.txt
create mode 100644 mountd/meson.build
--- /dev/null
+++ b/addshare/meson.build
@@ -0,0 +1,10 @@
+addshare = executable(
+ 'ksmbd.addshare',
+ 'share_admin.c',
+ 'addshare.c',
+ 'share_admin.h',
+ dependencies: [glib_dep, netlink_dep],
+ include_directories: tools_incdir,
+ link_with: libksmbdtools,
+ install: true,
+)
--- /dev/null
+++ b/adduser/meson.build
@@ -0,0 +1,12 @@
+adduser = executable(
+ 'ksmbd.adduser',
+ 'md4_hash.c',
+ 'user_admin.c',
+ 'adduser.c',
+ 'md4_hash.h',
+ 'user_admin.h',
+ dependencies: [glib_dep, netlink_dep],
+ include_directories: tools_incdir,
+ link_with: libksmbdtools,
+ install: true,
+)
--- /dev/null
+++ b/control/meson.build
@@ -0,0 +1,8 @@
+control = executable(
+ 'ksmbd.control',
+ 'control.c',
+ dependencies: [glib_dep, netlink_dep],
+ include_directories: tools_incdir,
+ link_with: libksmbdtools,
+ install: true,
+)
--- /dev/null
+++ b/lib/meson.build
@@ -0,0 +1,18 @@
+core_files = [
+ 'management/tree_conn.c',
+ 'management/user.c',
+ 'management/share.c',
+ 'management/session.c',
+ 'config_parser.c',
+ 'ksmbdtools.c',
+]
+
+if krb5_dep.found()
+ core_files += [
+ 'management/spnego.c',
+ 'asn1.c',
+ 'management/spnego_krb5.c',
+ ]
+endif
+
+libksmbdtools = static_library('ksmbdtools', core_files, include_directories: tools_incdir, dependencies: [glib_dep, krb5_dep])
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,29 @@
+project('ksmbsd-tools', 'c', version: '3.3.2', default_options: 'c_std=gnu99')
+
+tools_incdir = include_directories(['include', '.'])
+
+glib_dep = dependency('glib-2.0', static: true)
+netlink_dep = dependency('libnl-genl-3.0')
+krb5_dep = dependency('krb5', required: get_option('krb5'))
+
+cc = meson.get_compiler('c')
+
+cdata = configuration_data()
+add_project_arguments('-DHAVE_CONFIG_H', language: 'c')
+if krb5_dep.found()
+ cdata.set('CONFIG_KRB5', krb5_dep.found())
+ cdata.set('HAVE_KRB5_KEYBLOCK_KEYVALUE', cc.has_member('krb5_keyblock', 'keyvalue', prefix: '#include <krb5.h>'))
+ cdata.set('HAVE_KRB5_AUTHENTICATOR_CLIENT', cc.has_member('krb5_authenticator', 'client', prefix: '#include <krb5.h>'))
+ cdata.set('HAVE_KRB5_AUTH_CON_GETRECVSUBKEY', cc.has_header_symbol('krb5.h', 'krb5_auth_con_getrecvsubkey'))
+ cdata.set('HAVE_KRB5_AUTH_CON_GETAUTHENTICATOR_DOUBLE_POINTER', true)
+endif
+cfile = configure_file(
+ output: 'config.h',
+ configuration: cdata,
+)
+
+subdir('lib')
+subdir('addshare')
+subdir('adduser')
+subdir('control')
+subdir('mountd')
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,3 @@
+option('krb5', type : 'feature',
+ description : 'Build with Kerberos support',
+)
--- /dev/null
+++ b/mountd/meson.build
@@ -0,0 +1,16 @@
+mountd = executable(
+ 'ksmbd.mountd',
+ 'worker.c',
+ 'ipc.c',
+ 'rpc.c',
+ 'rpc_srvsvc.c',
+ 'rpc_wkssvc.c',
+ 'mountd.c',
+ 'smbacl.c',
+ 'rpc_samr.c',
+ 'rpc_lsarpc.c',
+ dependencies: [glib_dep, netlink_dep],
+ include_directories: tools_incdir,
+ link_with: libksmbdtools,
+ install: true,
+)