Skip to content

Commit

Permalink
Merge pull request #128 from garlick/build_cleanup
Browse files Browse the repository at this point in the history
drop TCP Wrappers support + misc. build system cleanup
  • Loading branch information
mergify[bot] authored Jan 18, 2025
2 parents bd0d3ac + cf4bfac commit a0569b5
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 186 deletions.
7 changes: 2 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
SUBDIRS = \
src \
man \
etc

if ENABLE_TESTS
SUBDIRS += tests
endif
etc \
tests

EXTRA_DIST = diod.spec

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#### On Debian
```
sudo apt-get install build-essential libpopt-dev ncurses-dev automake autoconf git pkgconf
sudo apt-get install lua5.1 liblua5.1-dev libmunge-dev libwrap0-dev libcap-dev libattr1-dev
sudo apt-get install build-essential ncurses-dev automake autoconf git pkgconf
sudo apt-get install lua5.1 liblua5.1-dev libmunge-dev libcap-dev libattr1-dev
./autogen.sh
./configure
make
Expand All @@ -19,7 +19,7 @@ make check

```
sudo yum install epel-release gperftools-devel ncurses-devel automake autoconf libattr-devel
sudo yum install lua lua-devel munge-devel tcp_wrappers-devel libcap-devel pkgconf
sudo yum install lua lua-devel munge-devel libcap-devel pkgconf
./autogen.sh
./configure
make
Expand Down
27 changes: 0 additions & 27 deletions config/x_ac_wrap.m4

This file was deleted.

53 changes: 3 additions & 50 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ PKG_CHECK_MODULES([ncurses], [ncurses])
# Checks for header files.
##
AC_CHECK_HEADERS( \
getopt.h \
pthread.h \
sys/prctl.h \
sys/statfs.h \
Expand All @@ -72,14 +71,10 @@ AC_C_CONST
# Checks for library functions
##
AC_CHECK_FUNCS( \
getopt_long \
vsnprintf \
vsscanf \
utimensat \
)
AC_FUNC_STRERROR_R
X_AC_CHECK_PTHREADS
X_AC_WRAP
X_AC_CHECK_COND_LIB(munge, munge_ctx_create)
X_AC_CHECK_COND_LIB(cap, cap_get_proc)
X_AC_TCMALLOC
Expand All @@ -98,13 +93,8 @@ AC_SYS_LARGEFILE
# Optional features
##
AC_ARG_ENABLE([diodmount],
[AS_HELP_STRING([--disable-diodmount], [do not build diodmount])],
[],
[enable_diodmount=auto])
AC_ARG_ENABLE([tests],
[AS_HELP_STRING([--disable-tests], [do not build tests])],
[],
[enable_tests=auto])
[AS_HELP_STRING([--disable-diodmount], [do not build diodmount])])

AC_ARG_ENABLE([impersonation],
[AS_HELP_STRING([--enable-impersonation], [allow access=user])],
[],
Expand All @@ -126,18 +116,6 @@ AS_IF([test "x$enable_config" != "xno"], [

case "${host_os}" in
linux*)
case "${enable_diodmount}" in
no)
;;
*)
enable_diodmount=yes;;
esac
case "${enable_tests}" in
no)
;;
*)
enable_tests=yes;;
esac
case "${enable_impersonation}" in
no)
;;
Expand All @@ -148,18 +126,6 @@ case "${host_os}" in
esac
;;
freebsd*)
case "${enable_diodmount}" in
yes)
;;
*)
enable_diodmount=no;;
esac
case "${enable_tests}" in
yes)
;;
*)
enable_tests=no;;
esac
case "${enable_impersonation}" in
no|auto)
enable_impersonation=no;;
Expand All @@ -170,18 +136,6 @@ case "${host_os}" in
esac
;;
*)
case "${enable_diodmount}" in
yes)
;;
*)
enable_diodmount=no;;
esac
case "${enable_tests}" in
yes)
;;
*)
enable_tests=no;;
esac
case "${enable_impersonation}" in
no|auto)
enable_impersonation=no;;
Expand All @@ -191,8 +145,7 @@ case "${host_os}" in
;;
esac

AM_CONDITIONAL([ENABLE_DIODMOUNT], [test "x${enable_diodmount}" = "xyes"])
AM_CONDITIONAL([ENABLE_TESTS], [test "x${enable_tests}" = "xyes"])
AM_CONDITIONAL([ENABLE_DIODMOUNT], [test "x${enable_diodmount}" != "xno"])
AM_CONDITIONAL([USE_IMPERSONATION_LINUX], [test "x${enable_impersonation}" = "xlinux"])
AM_CONDITIONAL([USE_IMPERSONATION_GANESHA], [test "x${enable_impersonation}" = "xganesha"])

Expand Down
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Standards-Version: 4.1.2
Build-Depends:
debhelper (>= 10),
libncurses-dev,
libpopt-dev,
lua5.1,
liblua5.1-dev

Expand Down
1 change: 0 additions & 1 deletion diod.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ URL: http://github.com/chaos/diod
Source0: %{name}-%{version}.tar.gz
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: tcp_wrappers-devel
BuildRequires: lua-devel
BuildRequires: munge-devel
BuildRequires: ncurses-devel
Expand Down
1 change: 0 additions & 1 deletion scripts/install-deps-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ apt install \
make \
pkg-config \
libc6-dev \
libpopt-dev \
libncurses-dev \
libcap2-dev \
lua5.1 \
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ common_ldadd = \
$(top_builddir)/src/libnpfs/libnpfs.a \
$(top_builddir)/src/liblsd/liblsd.a \
$(top_builddir)/src/libdiod/libdiod.a \
$(LIBWRAP) $(LIBPTHREAD) $(LUA_LIB) $(LIBMUNGE) $(LIBCAP) \
$(LIBPTHREAD) $(LUA_LIB) $(LIBMUNGE) $(LIBCAP) \
$(LIBIBVERBS) $(LIBRDMACM) $(LIBTCMALLOC) $(ncurses_LIBS)

common_sources = \
Expand Down
13 changes: 3 additions & 10 deletions src/cmd/diod.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
#include <sys/syscall.h>
#endif
#include <stdio.h>
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
#include <errno.h>
#include <pwd.h>
#include <grp.h>
Expand Down Expand Up @@ -68,10 +66,8 @@ static void _service_run (srvmode_t mode, int rfdno, int wfdno);
#define NR_OPEN 1048576 /* works on RHEL 5 x86_64 arch */
#endif

#define OPTIONS "fr:w:d:l:t:e:Eo:u:SL:nHpc:NU:s"
static const char *options = "fr:w:d:l:t:e:Eo:u:SL:nHpc:NU:s";

#if HAVE_GETOPT_LONG
#define GETOPT(ac,av,opt,lopt) getopt_long (ac,av,opt,lopt,NULL)
static const struct option longopts[] = {
{"foreground", no_argument, 0, 'f'},
{"rfdno", required_argument, 0, 'r'},
Expand All @@ -94,9 +90,6 @@ static const struct option longopts[] = {
{"socktest", no_argument, 0, 's'},
{0, 0, 0, 0},
};
#else
#define GETOPT(ac,av,opt,lopt) getopt (ac,av,opt)
#endif

static void
usage()
Expand Down Expand Up @@ -139,7 +132,7 @@ main(int argc, char **argv)

/* config file overrides defaults */
opterr = 0;
while ((c = GETOPT (argc, argv, OPTIONS, longopts)) != -1) {
while ((c = getopt_long (argc, argv, options, longopts, NULL)) != -1) {
switch (c) {
case 'c': /* --config-file PATH */
copt = optarg;
Expand All @@ -154,7 +147,7 @@ main(int argc, char **argv)
*/
optind = 0;
opterr = 0;
while ((c = GETOPT (argc, argv, OPTIONS, longopts)) != -1) {
while ((c = getopt_long (argc, argv, options, longopts, NULL)) != -1) {
switch (c) {
case 'f': /* --foreground */
diod_conf_set_foreground (1);
Expand Down
12 changes: 3 additions & 9 deletions src/cmd/diodcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
#include <stdint.h>
#include <stdarg.h>
#include <stdio.h>
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
#include <string.h>
#include <errno.h>
#include <ctype.h>
Expand All @@ -38,9 +36,8 @@
#include "src/libdiod/diod_sock.h"
#include "src/libdiod/diod_auth.h"

#define OPTIONS "a:s:m:u:t:p"
#if HAVE_GETOPT_LONG
#define GETOPT(ac,av,opt,lopt) getopt_long (ac,av,opt,lopt,NULL)
static const char *options = "a:s:m:u:t:p";

static const struct option longopts[] = {
{"aname", required_argument, 0, 'a'},
{"server", required_argument, 0, 's'},
Expand All @@ -50,9 +47,6 @@ static const struct option longopts[] = {
{"privport",no_argument, 0, 'p'},
{0, 0, 0, 0},
};
#else
#define GETOPT(ac,av,opt,lopt) getopt (ac,av,opt)
#endif

static int catfiles (int fd, uid_t uid, int msize, char *aname,
char **av, int ac);
Expand Down Expand Up @@ -87,7 +81,7 @@ main (int argc, char *argv[])
diod_log_init (argv[0]);

opterr = 0;
while ((c = GETOPT (argc, argv, OPTIONS, longopts)) != -1) {
while ((c = getopt_long (argc, argv, options, longopts, NULL)) != -1) {
switch (c) {
case 'a': /* --aname NAME */
aname = optarg;
Expand Down
12 changes: 3 additions & 9 deletions src/cmd/dioddate.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
#include <string.h>
#include <errno.h>
#include <ctype.h>
Expand All @@ -41,9 +39,8 @@
#include "src/libdiod/diod_sock.h"
#include "src/libdiod/diod_auth.h"

#define OPTIONS "s:m:u:t:S"
#if HAVE_GETOPT_LONG
#define GETOPT(ac,av,opt,lopt) getopt_long (ac,av,opt,lopt,NULL)
static const char *options = "s:m:u:t:S";

static const struct option longopts[] = {
{"server", required_argument, 0, 's'},
{"msize", required_argument, 0, 'm'},
Expand All @@ -52,9 +49,6 @@ static const struct option longopts[] = {
{"set-time",no_argument, 0, 'S'},
{0, 0, 0, 0},
};
#else
#define GETOPT(ac,av,opt,lopt) getopt (ac,av,opt)
#endif

static void sigalarm (int arg);

Expand Down Expand Up @@ -92,7 +86,7 @@ main (int argc, char *argv[])
diod_log_init (argv[0]);

opterr = 0;
while ((c = GETOPT (argc, argv, OPTIONS, longopts)) != -1) {
while ((c = getopt_long (argc, argv, options, longopts, NULL)) != -1) {
switch (c) {
case 's': /* --server HOST[:PORT] or /path/to/socket */
server = optarg;
Expand Down
12 changes: 3 additions & 9 deletions src/cmd/diodload.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
#include <string.h>
#include <errno.h>
#include <ctype.h>
Expand All @@ -41,9 +39,8 @@
#include "src/libdiod/diod_sock.h"
#include "src/libdiod/diod_auth.h"

#define OPTIONS "s:m:n:r:g"
#if HAVE_GETOPT_LONG
#define GETOPT(ac,av,opt,lopt) getopt_long (ac,av,opt,lopt,NULL)
static const char *options = "s:m:n:r:g";

static const struct option longopts[] = {
{"server", required_argument, 0, 's'},
{"msize", required_argument, 0, 'm'},
Expand All @@ -52,9 +49,6 @@ static const struct option longopts[] = {
{"getattr", no_argument, 0, 'g'},
{0, 0, 0, 0},
};
#else
#define GETOPT(ac,av,opt,lopt) getopt (ac,av,opt)
#endif

typedef enum { LOAD_IO, LOAD_GETATTR } load_t;

Expand Down Expand Up @@ -109,7 +103,7 @@ main (int argc, char *argv[])
diod_log_init (argv[0]);

opterr = 0;
while ((c = GETOPT (argc, argv, OPTIONS, longopts)) != -1) {
while ((c = getopt_long (argc, argv, options, longopts, NULL)) != -1) {
switch (c) {
case 's': /* --server HOST[:PORT] or /path/to/socket */
server = optarg;
Expand Down
Loading

0 comments on commit a0569b5

Please sign in to comment.