-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also install asciidoc package in CI, so that it will build the man pages as well.
- Loading branch information
1 parent
00fc856
commit fed9020
Showing
10 changed files
with
186 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,47 @@ | ||
#!/bin/bash -ex | ||
|
||
findexe() { | ||
while [ ${#} -gt 0 ]; do | ||
while read -r -d: path; do | ||
[ -f "${path}/${1}" ] \ | ||
&& [ -x "${path}/${1}" ] \ | ||
&& echo "${path}/${1}" && return 0 | ||
done <<< "${PATH}:" | ||
shift | ||
done | ||
return 1 | ||
} | ||
|
||
PM=dnf | ||
|
||
case "$1" in | ||
centos:7) | ||
PM=yum | ||
yum install -y yum-utils | ||
yum -y install epel-release | ||
;; | ||
fedora:*) | ||
rt=compiler-rt | ||
;; | ||
esac | ||
|
||
BUILDENV="automake autoconf libtool pkgconfig git gcc make file clang $rt" | ||
BUILDDEP="openssl-devel zlib-devel jansson-devel jose libjose*devel http-parser-devel wget systemd which" | ||
BUILDENV="meson pkgconfig git gcc make file clang $rt" | ||
BUILDDEP="openssl-devel zlib-devel jansson-devel jose libjose*devel http-parser-devel wget systemd which asciidoc" | ||
|
||
$PM -y --nogpgcheck install $BUILDENV $BUILDDEP | ||
|
||
autoreconf -if | ||
mkdir build | ||
cd build | ||
|
||
if ! CFLAGS=-coverage LDFLAGS=-lgcov ./configure --prefix=/usr; then | ||
cat ./config.log | ||
exit 1 | ||
fi | ||
export CFLAGS="-g -coverage" | ||
|
||
make -j8 -k check V=1 TESTS= | ||
|
||
if ! make -j8 check; then | ||
cat ./test-suite.log | ||
if ! meson ..; then | ||
cat meson-logs/meson-log.txt >&2 | ||
exit 1 | ||
fi | ||
|
||
ninja=$(findexe ninja ninja-build) | ||
"${ninja}" test | ||
|
||
bash <(curl -s https://codecov.io/bash) | ||
# vim: set ts=8 shiftwidth=4 softtabstop=4 expandtab smarttab colorcolumn=80: |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
mans += join_paths(meson.current_source_dir(), 'tang-show-keys.1') | ||
mans += join_paths(meson.current_source_dir(), 'tang.8') | ||
|
||
# vim:set ts=2 sw=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
project('tang', 'c', | ||
version: '7', | ||
license: 'GPL3+', | ||
default_options: [ | ||
'c_std=c99', | ||
'prefix=/usr', | ||
'sysconfdir=/etc', | ||
'localstatedir=/var', | ||
'warning_level=3', | ||
'werror=true' | ||
] | ||
) | ||
|
||
libexecdir = join_paths(get_option('prefix'), get_option('libexecdir')) | ||
sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir')) | ||
bindir = join_paths(get_option('prefix'), get_option('bindir')) | ||
systemunitdir = join_paths(get_option('prefix'), 'lib/systemd/system') | ||
licensedir = join_paths(get_option('prefix'), 'share', 'licenses', meson.project_name()) | ||
cachedir = join_paths(get_option('localstatedir'), 'cache', meson.project_name()) | ||
jwkdir = join_paths(get_option('localstatedir'), 'db', meson.project_name()) | ||
|
||
data = configuration_data() | ||
data.set('libexecdir', libexecdir) | ||
data.set('sysconfdir', sysconfdir) | ||
data.set('systemunitdir', systemunitdir) | ||
data.set('cachedir', cachedir) | ||
data.set('jwkdir', jwkdir) | ||
|
||
add_project_arguments( | ||
'-D_POSIX_C_SOURCE=200809L', | ||
'-Wstrict-aliasing', | ||
'-Wchar-subscripts', | ||
'-Wformat-security', | ||
'-Wmissing-declarations', | ||
'-Wmissing-prototypes', | ||
'-Wnested-externs', | ||
'-Wpointer-arith', | ||
'-Wshadow', | ||
'-Wsign-compare', | ||
'-Wstrict-prototypes', | ||
'-Wtype-limits', | ||
'-Wunused-function', | ||
'-Wno-missing-field-initializers', | ||
'-Wno-unused-parameter', | ||
'-Wno-pedantic', | ||
language: 'c' | ||
) | ||
|
||
jose = dependency('jose', version: '>=8') | ||
a2x = find_program('a2x', required: false) | ||
compiler = meson.get_compiler('c') | ||
if not compiler.has_header('http_parser.h') | ||
error('http-parser devel files not found.') | ||
endif | ||
http_parser = compiler.find_library('http_parser') | ||
|
||
licenses = ['COPYING'] | ||
libexecbins = [] | ||
bins = [] | ||
mans = [] | ||
units = [] | ||
|
||
subdir('doc') | ||
subdir('src') | ||
subdir('units') | ||
subdir('tests') | ||
|
||
install_data(libexecbins, install_dir: libexecdir) | ||
install_data(bins, install_dir: bindir) | ||
install_data(units, install_dir: systemunitdir) | ||
install_data(licenses, install_dir: licensedir) | ||
|
||
if a2x.found() | ||
foreach m : mans | ||
custom_target(m.split('/')[-1], input: m + '.adoc', output: m.split('/')[-1], | ||
command: [a2x, '-f', 'manpage', '-D', meson.current_build_dir(), '@INPUT@'], | ||
install_dir: join_paths(get_option('mandir'), 'man' + m.split('.')[-1]), | ||
install: true | ||
) | ||
endforeach | ||
else | ||
warning('Will not build man pages due to missing a2x (asciidoc) dependency!') | ||
endif | ||
|
||
# vim:set ts=2 sw=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
tangd = executable('tangd', | ||
'http.h', | ||
'http.c', | ||
'tangd.c', | ||
dependencies: [jose, http_parser], | ||
install: true, | ||
install_dir: libexecdir | ||
) | ||
|
||
bins += join_paths(meson.current_source_dir(), 'tang-show-keys') | ||
libexecbins += join_paths(meson.current_source_dir(), 'tangd-keygen') | ||
libexecbins += join_paths(meson.current_source_dir(), 'tangd-update') | ||
|
||
# vim:set ts=2 sw=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
sd_activate = find_program( | ||
'systemd-socket-activate', | ||
'systemd-activate', | ||
required: false | ||
) | ||
|
||
if sd_activate.found() | ||
env = environment() | ||
env.prepend('PATH', | ||
join_paths(meson.source_root(), 'src'), | ||
join_paths(meson.build_root(), 'src'), | ||
separator: ':' | ||
) | ||
env.set('SD_ACTIVATE', sd_activate.path() + ' --inetd') | ||
|
||
test('adv', find_program('adv'), env: env) | ||
test('rec', find_program('rec'), env: env) | ||
else | ||
warning('Will not run the tests due to missing dependencies!') | ||
endif | ||
|
||
# vim:set ts=2 sw=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
tangd_keygen_service = configure_file( | ||
input: 'tangd-keygen.service.in', | ||
output: 'tangd-keygen.service', | ||
configuration: data | ||
) | ||
|
||
tangd_service = configure_file( | ||
input: 'tangd@.service.in', | ||
output: 'tangd@.service', | ||
configuration: data | ||
) | ||
|
||
tangd_update_path = configure_file( | ||
input: 'tangd-update.path.in', | ||
output: 'tangd-update.path', | ||
configuration: data | ||
) | ||
|
||
tangd_update_service = configure_file( | ||
input: 'tangd-update.service.in', | ||
output: 'tangd-update.service', | ||
configuration: data | ||
) | ||
|
||
units += join_paths(meson.current_source_dir(), 'tangd.socket') | ||
units += tangd_keygen_service | ||
units += tangd_service | ||
units += tangd_update_path | ||
units += tangd_update_service | ||
|
||
# vim:set ts=2 sw=2 et: |
File renamed without changes.