Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions booth.spec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
%bcond_with html_man

%if 0%{?suse_version}
%global booth_docdir %{_defaultdocdir}/%{name}
%else
Expand Down Expand Up @@ -26,7 +28,11 @@
Name: booth
Url: https://github.com/ClusterLabs/booth
Summary: Ticket Manager for Multi-site Clusters
%if 0%{?suse_version}
License: GPL-2.0+
%else
License: GPLv2+
%endif
Group: %{pkg_group}
Version: 1.0
Release: 0
Expand All @@ -36,7 +42,12 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: asciidoc
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: pkgconfig
%if 0%{?suse_version}
BuildRequires: glib2-devel
%else
BuildRequires: pkgconfig(glib-2.0)
%endif
BuildRequires: libgcrypt-devel
%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
BuildRequires: cluster-glue-libs-devel
Expand All @@ -46,7 +57,7 @@ BuildRequires: libglue-devel
BuildRequires: libpacemaker-devel
%endif
BuildRequires: libxml2-devel
BuildRequires: pkgconfig
BuildRequires: zlib-devel
%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
Requires: pacemaker >= 1.1.8
Requires: cluster-glue-libs >= 1.0.6
Expand All @@ -67,14 +78,11 @@ Pacemaker.
./autogen.sh
%configure \
--with-initddir=%{_initrddir} \
--docdir=%{booth_docdir}
--docdir=%{booth_docdir} \
%{!?with_html_man:--without-html_man}

make

#except check
#%check
#make check

%install
make DESTDIR=$RPM_BUILD_ROOT install docdir=%{booth_docdir}

Expand Down Expand Up @@ -118,9 +126,6 @@ make check
echo "%%run_build_tests set to %run_build_tests; skipping tests"
%endif

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_sbindir}/booth
Expand Down
30 changes: 10 additions & 20 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,8 @@ AC_PATH_PROGS(ASCIIDOC, asciidoc)
AC_PATH_PROGS(XML2CONFIG, xml2-config)

AM_CONDITIONAL(BUILD_ASCIIDOC, test x"${ASCIIDOC}" != x"")

# Checks for libraries.
AC_CHECK_LIB([socket], [socket])
AC_CHECK_LIB([nsl], [t_open])
AC_CHECK_LIB([gpl], [cl_log])
AM_CONDITIONAL(BUILD_ASCIIDOC_HTML_MAN,
test "x${ASCIIDOC}" != "x" && test "x$with_html_man" = "xyes")

# libgcrypt or mhash for hmac
libgcrypt_installed="yes"
Expand Down Expand Up @@ -107,6 +104,9 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdint.h \
sys/sockio.h utmpx.h])
AC_CHECK_HEADERS(heartbeat/glue_config.h)
AC_CHECK_HEADERS(mhash.h)
AC_CHECK_HEADER([zlib.h],
[AC_SUBST(ZLIB_LIBS, ["-lz"])],
[AC_MSG_ERROR([zlib development files required])])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
Expand Down Expand Up @@ -197,26 +197,21 @@ AC_ARG_ENABLE([coverage],
[ --enable-coverage : coverage analysis of the codebase. ],
[ default="no" ])

AC_ARG_ENABLE([small-memory-footprint],
[ --enable-small-memory-footprint : Use small message queues and small messages sizes. ],
[ default="no" ])

AC_ARG_WITH([initddir],
[ --with-initddir=DIR : path to init script directory. ],
[ --with-initddir=DIR : path to init script directory. ],
[ INITDDIR="$withval" ],
[ INITDDIR="$sysconfdir/init.d" ])

test -s .git_info &&
GIT_VER="`cat .git_info`"

AC_ARG_WITH([build-version],
[ --with-build-version=STR : build version ],
[ --with-build-version=STR : build version ],
[ BOOTH_BUILD_VERSION="$withval" ],
[ BOOTH_BUILD_VERSION="${GIT_VER:-$PACKAGE_VERSION}" ])

AC_ARG_ENABLE([resource-monitor],
[ --enable-resource-monitor : Enabling Resource Monitor ],
[ default="no" ])
AC_ARG_WITH([html_man],
[ --without-html_man : Avoid generating man pages in HTML.])

# OS detection
# THIS SECTION MUST DIE!
Expand Down Expand Up @@ -361,12 +356,10 @@ if test "x${enable_coverage}" = xyes && \
OPT_CFLAGS="-O0"
COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
COVERAGE_LCRSO_EXTRA_LDFLAGS="-rdynamic"
PACKAGE_FEATURES="$PACKAGE_FEATURES coverage"
else
COVERAGE_CFLAGS=""
COVERAGE_LDFLAGS=""
COVERAGE_LCRSO_EXTRA_LDFLAGS=""
fi


Expand Down Expand Up @@ -404,7 +397,6 @@ LDFLAGS="$ENV_LDFLAGS $COVERAGE_LDFLAGS $OS_LDFLAGS"
# substitute what we need:
AC_SUBST([INITDDIR])

AC_SUBST([COVERAGE_LCRSO_EXTRA_LDFLAGS])
AC_SUBST([OS_DYFLAGS])

AC_SUBST([OS_LDL])
Expand All @@ -418,9 +410,7 @@ AM_CONDITIONAL(BUILD_HTML_DOCS, test -n "${GROFF}")

AC_SUBST([LINT_FLAGS])

AC_DEFINE_UNQUOTED([LCRSODIR], "$(eval echo ${LCRSODIR})", [LCRSO directory])
AC_DEFINE_UNQUOTED([SOCKETDIR], "$(eval echo ${SOCKETDIR})", [Socket directory])
AC_DEFINE_UNQUOTED([LOCALSTATEDIR], "$(eval echo ${localstatedir})", [localstate directory])

BOOTHSYSCONFDIR=${sysconfdir}/booth
AC_SUBST([HAVE_LOG_CIB_DIFF])
Expand Down Expand Up @@ -450,7 +440,7 @@ AC_MSG_RESULT([ System configuration = ${sysconfdir}])
AC_MSG_RESULT([ System init.d directory = ${INITDDIR}])
AC_MSG_RESULT([ booth config dir = ${BOOTHSYSCONFDIR}])
AC_MSG_RESULT([ SOCKETDIR = ${SOCKETDIR}])
AC_MSG_RESULT([ Features =${PACKAGE_FEATURES}])
AC_MSG_RESULT([ Features = ${PACKAGE_FEATURES}])
AC_MSG_RESULT([])
AC_MSG_RESULT([$PACKAGE build info:])
AC_MSG_RESULT([ Library SONAME = ${SONAME}])
Expand Down
4 changes: 3 additions & 1 deletion docs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ doc_DATA = $(generated_docs)
generated_docs =
generated_mans =

if BUILD_ASCIIDOC
if BUILD_ASCIIDOC_HTML_MAN
generated_docs += $(ascii:%.txt=%.html) $(asciiman:%.txt=%.html)
endif
if BUILD_ASCIIDOC
generated_mans += $(asciiman:%.8.txt=%.8)
$(generated_mans): $(asciiman)
man8_MANS = $(generated_mans)
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ boothd_SOURCES += auth.c
endif

boothd_LDFLAGS = $(OS_DYFLAGS) -L./
boothd_LDADD = -lplumb -lplumbgpl -lz -lm -lglib-2.0
boothd_CPPFLAGS = $(GLIB_CFLAGS)
boothd_LDADD = -lplumb -lplumbgpl -lm $(GLIB_LIBS) $(ZLIB_LIBS)
boothd_CFLAGS = $(GLIB_CFLAGS)

noinst_HEADERS = booth.h pacemaker.h \
config.h log.h raft.h ticket.h transport.h handler.h request.h attr.h
Expand Down