Skip to content

Commit

Permalink
Clean up build system and integrate npfs. Add make rpm target.
Browse files Browse the repository at this point in the history
  • Loading branch information
garlick committed Dec 13, 2010
1 parent 4995db7 commit dd37f10
Show file tree
Hide file tree
Showing 129 changed files with 694 additions and 14,475 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2010-12-13 Jim Garlick <garlick@llnl.gov>

* libnpfs : Renamed from npfs/libnpfs. Integrated with automake.
Removed unused parts of npfs.

* libdiod : Renamed from common.

2010-09-01 Jim Garlick <garlick@llnl.gov>

* : tag 1.0-pre10
Expand Down
14 changes: 13 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
SUBDIRS = liblsd npfs common diod diodctl diodmount man scripts test
SUBDIRS = liblsd libnpfs libdiod diod diodctl diodmount man scripts test

rpmdirs:
mkdir -p $(top_builddir)/rpm/SPECS
mkdir -p $(top_builddir)/rpm/SOURCES
mkdir -p $(top_builddir)/rpm/BUILD
mkdir -p $(top_builddir)/rpm/RPMS
mkdir -p $(top_builddir)/rpm/SRPMS

rpm: dist rpmdirs
rpmbuild -ta --define "_topdir $(realpath $(top_builddir)/rpm)" $(DIST_ARCHIVES)

EXTRA_DIST = META diod.spec
30 changes: 22 additions & 8 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/config/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
config/config.guess config/config.sub config/depcomp \
config/install-sh config/ltmain.sh config/missing
$(srcdir)/Makefile.in $(srcdir)/diod.spec.in \
$(top_srcdir)/config/config.h.in $(top_srcdir)/configure \
AUTHORS COPYING ChangeLog INSTALL NEWS config/config.guess \
config/config.sub config/depcomp config/install-sh \
config/ltmain.sh config/missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/x_ac_check_cond_lib.m4 \
Expand All @@ -54,7 +55,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_FILES = diod.spec
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
Expand Down Expand Up @@ -195,7 +196,8 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
SUBDIRS = liblsd npfs common diod diodctl diodmount man scripts test
SUBDIRS = liblsd libnpfs libdiod diod diodctl diodmount man scripts test
EXTRA_DIST = META diod.spec
all: all-recursive

.SUFFIXES:
Expand Down Expand Up @@ -249,6 +251,8 @@ $(top_srcdir)/config/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)

distclean-hdr:
-rm -f config/config.h config/stamp-h1
diod.spec: $(top_builddir)/config.status $(srcdir)/diod.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
uninstall-info-am:

# This directory's subdirectories are mostly independent; you can cd
Expand Down Expand Up @@ -386,7 +390,7 @@ distclean-tags:
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
$(mkdir_p) $(distdir)/config $(distdir)/man $(distdir)/scripts
$(mkdir_p) $(distdir)/. $(distdir)/config $(distdir)/man $(distdir)/scripts
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
Expand Down Expand Up @@ -428,7 +432,7 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
-find $(distdir) -type d ! -perm -755 -exec chmod a+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
Expand Down Expand Up @@ -620,6 +624,16 @@ uninstall-info: uninstall-info-recursive
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
uninstall-info-am


rpmdirs:
mkdir -p $(top_builddir)/rpm/SPECS
mkdir -p $(top_builddir)/rpm/SOURCES
mkdir -p $(top_builddir)/rpm/BUILD
mkdir -p $(top_builddir)/rpm/RPMS
mkdir -p $(top_builddir)/rpm/SRPMS

rpm: dist rpmdirs
rpmbuild -ta --define "_topdir $(realpath $(top_builddir)/rpm)" $(DIST_ARCHIVES)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
48 changes: 31 additions & 17 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
# Generated by GNU Autoconf 2.59 for diod 1.0.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
Expand Down Expand Up @@ -265,13 +265,12 @@ SHELL=${CONFIG_SHELL-/bin/sh}
: ${ac_max_here_lines=38}

# Identity of this package.
PACKAGE_NAME=
PACKAGE_TARNAME=
PACKAGE_VERSION=
PACKAGE_STRING=
PACKAGE_BUGREPORT=
PACKAGE_NAME='diod'
PACKAGE_TARNAME='diod'
PACKAGE_VERSION='1.0'
PACKAGE_STRING='diod 1.0'
PACKAGE_BUGREPORT=''

ac_unique_file="diod"
ac_unique_file="NEWS"
# Factoring default headers for most tests.
ac_includes_default="\
Expand Down Expand Up @@ -779,7 +778,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures this package to adapt to many kinds of systems.
\`configure' configures diod 1.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -845,7 +844,9 @@ _ACEOF
fi

if test -n "$ac_init_help"; then

case $ac_init_help in
short | recursive ) echo "Configuration of diod 1.0:";;
esac
cat <<\_ACEOF
Optional Features:
Expand Down Expand Up @@ -963,6 +964,8 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
diod configure 1.0
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
Expand All @@ -975,7 +978,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
It was created by diod $as_me 1.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -1296,6 +1299,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
Expand Down Expand Up @@ -3972,9 +3983,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists. ##
## ------------------------------------------ ##
## ------------------------------- ##
## Report this to the diod lists. ##
## ------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
Expand Down Expand Up @@ -5084,7 +5095,8 @@ _ACEOF
##
# Epilogue
##
ac_config_files="$ac_config_files Makefile common/Makefile liblsd/Makefile man/Makefile man/diod.8 man/diodctl.8 man/diodmount.8 man/diodctl.conf.5 man/9p-attach.5 man/9p-flush.5 man/9p-flock.5 man/9p-lock.5 man/9p-read.5 man/9p-version.5 man/9p-clunk.5 man/9p-intro.5 man/9p-remove.5 man/9p-walk.5 man/9p-error.5 man/9p-open.5 man/9p-rename.5 man/9p-stat.5 man/9p-statfs.5 scripts/Makefile scripts/diodctl.init test/Makefile diod/Makefile diodctl/Makefile diodmount/Makefile"
ac_config_files="$ac_config_files Makefile diod.spec libdiod/Makefile liblsd/Makefile libnpfs/Makefile man/Makefile man/diod.8 man/diodctl.8 man/diodmount.8 man/diodctl.conf.5 man/9p-attach.5 man/9p-flush.5 man/9p-flock.5 man/9p-lock.5 man/9p-read.5 man/9p-version.5 man/9p-clunk.5 man/9p-intro.5 man/9p-remove.5 man/9p-walk.5 man/9p-error.5 man/9p-open.5 man/9p-rename.5 man/9p-stat.5 man/9p-statfs.5 scripts/Makefile scripts/diodctl.init test/Makefile diod/Makefile diodctl/Makefile diodmount/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
Expand Down Expand Up @@ -5469,7 +5481,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by $as_me, which was
This file was extended by diod $as_me 1.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -5532,7 +5544,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
diod config.status 1.0
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
Expand Down Expand Up @@ -5643,8 +5655,10 @@ do
case "$ac_config_target" in
# Handling of arguments.
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"common/Makefile" ) CONFIG_FILES="$CONFIG_FILES common/Makefile" ;;
"diod.spec" ) CONFIG_FILES="$CONFIG_FILES diod.spec" ;;
"libdiod/Makefile" ) CONFIG_FILES="$CONFIG_FILES libdiod/Makefile" ;;
"liblsd/Makefile" ) CONFIG_FILES="$CONFIG_FILES liblsd/Makefile" ;;
"libnpfs/Makefile" ) CONFIG_FILES="$CONFIG_FILES libnpfs/Makefile" ;;
"man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
"man/diod.8" ) CONFIG_FILES="$CONFIG_FILES man/diod.8" ;;
"man/diodctl.8" ) CONFIG_FILES="$CONFIG_FILES man/diodctl.8" ;;
Expand Down
8 changes: 6 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
##
# Prologue
##
AC_INIT([diod])
AC_INIT(m4_esyscmd([awk '/Name:/ {printf "%s",$2; exit}' META]),
m4_esyscmd([awk '/Version:/ {printf "%s",$2; exit}' META]))
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_SRCDIR([NEWS])
AC_CANONICAL_SYSTEM
Expand Down Expand Up @@ -67,8 +68,10 @@ AC_DEFINE(WITH_LSD_NOMEM_ERROR_FUNC, 1, [Define lsd_fatal_error])
##
AC_CONFIG_FILES( \
Makefile \
common/Makefile \
diod.spec \
libdiod/Makefile \
liblsd/Makefile \
libnpfs/Makefile \
man/Makefile \
man/diod.8 \
man/diodctl.8 \
Expand Down Expand Up @@ -96,4 +99,5 @@ AC_CONFIG_FILES( \
diodctl/Makefile \
diodmount/Makefile \
)

AC_OUTPUT
52 changes: 52 additions & 0 deletions diod.spec.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Name: @META_NAME@
Version: @META_VERSION@
Release: @META_RELEASE@

Summary: I/O forwarding server for 9P.
License: GPL
Group: Applications/System
# URL: http://sourceforge.net/projects/npfs
Source0: %{name}-%{version}.tar.gz
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# tcp_wrappers-devel on rhel6
BuildRequires: tcp_wrappers
BuildRequires: zlib-devel
BuildRequires: lua-devel
BuildRequires: munge-devel

%description
diod is a 9P server used in combination with the kernel v9fs file
system for I/O forwarding on Linux clusters.

%prep
%setup -q

%build
%configure
make

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

%clean
rm -rf ${RPM_BUILD_ROOT}

# %post
# if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --add diodctl; fi

# %preun
# if [ "$1" = 0 ]; then
# %{_sysconfdir}/init.d/diodctl stop >/dev/null 2>&1 || :
# if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --del diodctl; fi
# fi

%files
%defattr(-,root,root)
%doc AUTHORS COPYING README INSTALL ChangeLog
%{_sbindir}/*
%{_mandir}/man8/*
%{_mandir}/man5/*
%attr(0755,root,root) %{_sysconfdir}/init.d/diodctl
9 changes: 5 additions & 4 deletions diod/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
AM_CFLAGS = @GCCWARN@

AM_CPPFLAGS = \
-I../npfs/include -I../liblsd -I../common
-I../libnpfs -I../liblsd -I../libdiod

sbin_PROGRAMS = diod

diod_LDADD = \
$(top_builddir)/common/libdiod.a \
$(top_builddir)/npfs/libnpfs/libnpfs.a \
$(top_builddir)/libdiod/libdiod.a \
$(top_builddir)/libnpfs/libnpfs.a \
$(top_builddir)/liblsd/liblsd.a \
$(LIBWRAP) $(LIBPTHREAD) $(LIBZ) $(LIBLUA) $(LIBMUNGE)

diod_SOURCES = \
diod.c \
ops.c
ops.c \
ops.h
13 changes: 7 additions & 6 deletions diod/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ PROGRAMS = $(sbin_PROGRAMS)
am_diod_OBJECTS = diod.$(OBJEXT) ops.$(OBJEXT)
diod_OBJECTS = $(am_diod_OBJECTS)
am__DEPENDENCIES_1 =
diod_DEPENDENCIES = $(top_builddir)/common/libdiod.a \
$(top_builddir)/npfs/libnpfs/libnpfs.a \
diod_DEPENDENCIES = $(top_builddir)/libdiod/libdiod.a \
$(top_builddir)/libnpfs/libnpfs.a \
$(top_builddir)/liblsd/liblsd.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
Expand Down Expand Up @@ -194,17 +194,18 @@ target_os = @target_os@
target_vendor = @target_vendor@
AM_CFLAGS = @GCCWARN@
AM_CPPFLAGS = \
-I../npfs/include -I../liblsd -I../common
-I../libnpfs -I../liblsd -I../libdiod

diod_LDADD = \
$(top_builddir)/common/libdiod.a \
$(top_builddir)/npfs/libnpfs/libnpfs.a \
$(top_builddir)/libdiod/libdiod.a \
$(top_builddir)/libnpfs/libnpfs.a \
$(top_builddir)/liblsd/liblsd.a \
$(LIBWRAP) $(LIBPTHREAD) $(LIBZ) $(LIBLUA) $(LIBMUNGE)

diod_SOURCES = \
diod.c \
ops.c
ops.c \
ops.h

all: all-am

Expand Down
11 changes: 7 additions & 4 deletions diodctl/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
AM_CFLAGS = @GCCWARN@

AM_CPPFLAGS = \
-I../npfs/include -I../liblsd -I../common
-I../libnpfs -I../liblsd -I../libdiod

sbin_PROGRAMS = diodctl

diodctl_LDADD = \
$(top_builddir)/common/libdiod.a \
$(top_builddir)/npfs/libnpfs/libnpfs.a \
$(top_builddir)/libdiod/libdiod.a \
$(top_builddir)/libnpfs/libnpfs.a \
$(top_builddir)/liblsd/liblsd.a \
$(LIBWRAP) $(LIBPTHREAD) $(LIBZ) $(LIBLUA) $(LIBMUNGE)

diodctl_SOURCES = \
diodctl.c \
ops.c \
serv.c
ops.h \
serv.c \
serv.h

Loading

0 comments on commit dd37f10

Please sign in to comment.