Skip to content

Commit

Permalink
Create meson build system
Browse files Browse the repository at this point in the history
  • Loading branch information
dgsga committed Mar 1, 2024
1 parent dda85ae commit c844948
Show file tree
Hide file tree
Showing 53 changed files with 5,931 additions and 160 deletions.
291 changes: 131 additions & 160 deletions .github/workflows/build.yml → .github/workflows/meson.yml

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions bin/ad/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ad_sources = [
'ad_cp.c',
'ad_find.c',
'ad_ls.c',
'ad_mv.c',
'ad_rm.c',
'ad_set.c',
'ad_util.c',
'ad.c',
'ad.h',
]

executable(
'ad',
ad_sources,
include_directories: root_includes,
dependencies: mysqlclient,
link_with: libatalk,
c_args: [ad, dversion],
install: true,
)
16 changes: 16 additions & 0 deletions bin/afppasswd/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
afppasswd_sources = [
'afppasswd.c',
]

executable(
'afppasswd',
afppasswd_sources,
include_directories: [ssl_includes, root_includes],
dependencies: [crypto, mysqlclient],
link_with: libatalk,
c_args: [
afpdpwfile,
dversion,
],
install: true,
)
1 change: 1 addition & 0 deletions bin/cnid/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
install_data('cnid2_create.in', rename: 'cnid2_create', install_dir: bindir)
4 changes: 4 additions & 0 deletions bin/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
subdir('ad')
subdir('afppasswd')
subdir('cnid')
subdir('misc')
44 changes: 44 additions & 0 deletions bin/misc/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
netacnv_sources = ['netacnv.c']

loggertest_sources = ['logger_test.c']

fce_sources = ['fce.c']

afpldaptest_sources = ['uuidtest.c']

executable(
'netacnv',
netacnv_sources,
include_directories: root_includes,
link_with: libatalk,
dependencies: mysqlclient,
install: false,
)

executable(
'logger_test',
loggertest_sources,
include_directories: root_includes,
link_with: libatalk,
dependencies: mysqlclient,
install: false,
)

executable(
'fce',
fce_sources,
include_directories: root_includes,
link_with: libatalk,
dependencies: mysqlclient,
install: false,
)

executable(
'afpldaptest',
afpldaptest_sources,
include_directories: root_includes,
link_with: libatalk,
dependencies: [mysqlclient, ldap],
c_args: confdir,
install: true,
)
10 changes: 10 additions & 0 deletions bin/uniconv/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
uniconv_sources = ['iso8859_1_adapted.c', 'uniconv.c']

executable(
'uniconv',
uniconv_sources,
include_directories: root_includes,
link_with: libatalk,
dependencies: mysqlclient,
install: true,
)
34 changes: 34 additions & 0 deletions config/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
conf_templates = ['afp.conf', 'dbus-session.conf']
conf_files = []
foreach template : conf_templates
conf_files += configure_file(
input: template + '.tmpl',
output: template,
configuration: cdata,
)
endforeach

installed_files = [pkgconfdir / 'afp.conf', pkgconfdir / 'dbus-session.conf']
foreach file : installed_files
if (
not fs.exists(file)
or (get_option('enable-overwrite')
and fs.exists(file))
)
install_data(conf_files, install_dir: pkgconfdir)
else
message('not overwriting', file)
endif
endforeach

install_data('extmap.conf', install_dir: pkgconfdir)

install_data('netatalk-dbus.conf', install_dir: prefix / 'etc/dbus-1/system.d')

install_data('README', install_dir: localstatedir / 'netatalk')

install_data('README', install_dir: localstatedir / 'netatalk/CNID')

if have_pam
subdir('pam')
endif
7 changes: 7 additions & 0 deletions config/pam/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
netatalk_pamd = configure_file(
input: 'netatalk.tmpl',
output: 'netatalk',
configuration: cdata,
)

install_data(netatalk_pamd, install_dir: pampath)
7 changes: 7 additions & 0 deletions contrib/macusers/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
macusers_script = configure_file(
input: 'macusers.in',
output: 'macusers',
configuration: cdata,
)

install_data(macusers_script, install_dir: bindir)
2 changes: 2 additions & 0 deletions contrib/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
subdir('macusers')
subdir('shell_utils')
23 changes: 23 additions & 0 deletions contrib/shell_utils/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
install_data('afpstats', install_dir: bindir)

appledump_script = configure_file(
input: 'apple_dump.in',
output: 'apple_dump',
configuration: cdata,
)

install_data(appledump_script, install_dir: bindir)

asipstatus_script = configure_file(
input: 'asip-status.in',
output: 'asip-status',
configuration: cdata,
)

install_data(asipstatus_script, install_dir: bindir)

install_data('fce_ev_script.sh', install_dir: bindir)

install_data('make-casetable.pl', install_dir: bindir)

install_data('make-precompose.h.pl', install_dir: bindir)
7 changes: 7 additions & 0 deletions distrib/config/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
netatalk_config = configure_file(
input: 'netatalk-config.in',
output: 'netatalk-config',
configuration: cdata,
)

install_data(netatalk_config, install_dir: bindir)
116 changes: 116 additions & 0 deletions distrib/initscripts/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
if get_option('with-init-style') == 'redhat-sysv'
init_script = configure_file(
input: 'rc.redhat.tmpl',
output: 'netatalk',
configuration: cdata,
)
install_data(
init_script,
install_dir: '/etc/rc.d/init.d',
install_mode: 'rwxr-xr-x',
)
run_command('chkconfig', '--add', '/etc/rc.d/init.d/netatalk', check: true)
endif
if get_option('with-init-style') == 'service.systemd'
init_script = configure_file(
input: 'service.systemd.tmpl',
output: 'netatalk.service',
configuration: cdata,
)
install_data(init_script, install_dir: '/usr/lib/systemd/system')
run_command('systemctl', 'daemon-reload', check: true)
endif
if get_option('with-init-style') == 'debian-systemd'
init_script = configure_file(
input: 'service.systemd.tmpl',
output: 'netatalk.service',
configuration: cdata,
)
install_data(init_script, install_dir: '/lib/systemd/system')
run_command('systemctl', 'daemon-reload', check: true)
endif
if get_option('with-init-style') == 'suse-sysv'
init_script = configure_file(
input: 'rc.suse.tmpl',
output: 'netatalk',
configuration: cdata,
)
install_data(
init_script,
install_dir: '/etc/init.d',
install_mode: 'rwxr-xr-x',
)
run_command('insserv', '/etc/init.d/netatalk', check: true)
endif
if get_option('with-init-style') == 'netbsd'
init_script = configure_file(
input: 'rc.netbsd.tmpl',
output: 'netatalk',
configuration: cdata,
)
install_data(
init_script,
install_dir: '/etc/rc.d',
install_mode: 'rwxr-xr-x',
)
endif
if get_option('with-init-style') == 'solaris'
init_script = configure_file(
input: 'netatalk.xml.tmpl',
output: 'netatalk.xml',
configuration: cdata,
)
install_data(init_script, install_dir: '/lib/svc/manifest/network')
run_command(
'svccfg',
'import',
'/lib/svc/manifest/network/netatalk.xml',
check: true,
)
endif
if get_option('with-init-style') == 'openrc'
init_script = configure_file(
input: 'rc.gentoo.tmpl',
output: 'netatalk',
configuration: cdata,
)
install_data(
init_script,
install_dir: '/etc/init.d',
install_mode: 'rwxr-xr-x',
)
endif
if get_option('with-init-style') == 'debian-sysv'
init_script = configure_file(
input: 'rc.debian.tmpl',
output: 'netatalk',
configuration: cdata,
)
install_data(
init_script,
install_dir: '/etc/init.d',
install_mode: 'rwxr-xr-x',
)
endif
if get_option('with-init-style') == 'macos-launchd'
daemon = configure_file(
input: 'netatalkd.tmpl',
output: 'netatalkd',
configuration: cdata,
)
install_data(daemon, install_dir: bindir, install_mode: 'rwxr-xr-x')
plist = configure_file(
input: 'com.netatalk.daemon.plist.in',
output: 'com.netatalk.daemon.plist',
configuration: cdata,
)
install_data(plist, install_dir: '/Library/LaunchDaemons')
run_command(
'launchctl',
'load',
'-w',
'/Library/LaunchDaemons/com.netatalk.daemon.plist',
check: false,
)
endif

2 changes: 2 additions & 0 deletions distrib/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
subdir('config')
subdir('initscripts')
28 changes: 28 additions & 0 deletions doc/manpages/man1/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
manxml = [
'ad',
'afpldaptest',
'afppasswd',
'afpstats',
'apple_dump',
'asip-status',
'dbd',
'macusers',
'netatalk-config',
]

foreach man : manxml
man_xmlfile = configure_file(
input: man + '.1.xml',
output: man + '.1.xml',
configuration: cdata,
)

man_gen = custom_target(
man + '1',
input: man_xmlfile,
output: man + '.1',
command: manpages_command,
install: true,
install_dir: meson.project_source_root() / 'man/man1',
)
endforeach
18 changes: 18 additions & 0 deletions doc/manpages/man5/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
manxml = ['afp_signature.conf', 'afp_voluuid.conf', 'afp.conf', 'extmap.conf']

foreach man : manxml
man_xmlfile = configure_file(
input: man + '.5.xml',
output: man + '.5.xml',
configuration: cdata,
)

man_gen = custom_target(
man + '5',
input: man_xmlfile,
output: man + '.5',
command: manpages_command,
install: true,
install_dir: meson.project_source_root() / 'man/man5',
)
endforeach
18 changes: 18 additions & 0 deletions doc/manpages/man8/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
manxml = ['afpd', 'cnid_dbd', 'cnid_metad', 'netatalk']

foreach man : manxml
man_xmlfile = configure_file(
input: man + '.8.xml',
output: man + '.8.xml',
configuration: cdata,
)

man_gen = custom_target(
man + '8',
input: man_xmlfile,
output: man + '.8',
command: manpages_command,
install: true,
install_dir: meson.project_source_root() / 'man/man8',
)
endforeach
14 changes: 14 additions & 0 deletions doc/manpages/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
manpages_command = [
xsltproc,
'--stringparam',
'man.output.quietly',
'1',
'-o',
'@OUTPUT@',
manpages_stylesheet,
'@INPUT@',
]

subdir('man1')
subdir('man5')
subdir('man8')
Loading

0 comments on commit c844948

Please sign in to comment.