Skip to content

Commit

Permalink
initial autoconf support
Browse files Browse the repository at this point in the history
  • Loading branch information
oetiker committed Oct 5, 2011
1 parent 183acf0 commit c3e97ef
Show file tree
Hide file tree
Showing 23 changed files with 296 additions and 580 deletions.
22 changes: 22 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (C) 2011 Tobias Oetiker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

AUTOMAKE_OPTIONS = foreign

SUBDIRS = frontend backend

EXTRA_DIST = setup/build-perl-modules.sh setup/sdbs.inc

31 changes: 31 additions & 0 deletions backend/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (C) 2011 Tobias Oetiker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

AUTOMAKE_OPTIONS = foreign

SUBDIRS = bin etc lib

WEBAPP = $(exec find public -type f)

EXTRA_DIST = $(wildcard t/*.t) $(WEBAPP)

webappdir = $(prefix)/public
nobase_webapp_DATA = $(WEBAPP)


dist-hook:
$(PERL) -i -p -e '"$(PACKAGE_VERSION)" =~ /(\d+)\.(\d+)\.(\d+)/ and $$v = sprintf("%d.%03d%03d",$$1,$$2,$$3) and s/^\$$VERSION\s+=\s+".+?"/\$$VERSION = "$$d"/' $(distdir)/lib/remOcular.pm
$(PERL) -i -p -e "s/#VERSION#/$(PACKAGE_VERSION)/g;" $(distdir)/public/script/remocular.js
23 changes: 23 additions & 0 deletions backend/bin/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2011 Tobias Oetiker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.


dist_bin_SCRIPTS = remocular.pl

install-exec-hook:
[ x$PERL5LIB != x ] && cd "$(DESTDIR)$(bindir)" && $(PERL) -i -p -e 's{^#!.*}{#!$(PERL)}; s{.*# PERL5LIB}{use lib qw($(PERL5LIB)); # PERL5LIB}' $(dist_bin_SCRIPTS)

# EOF
4 changes: 2 additions & 2 deletions backend/bin/remocular.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use lib "$FindBin::Bin/../../thirdparty/lib/perl5";
use lib "$FindBin::Bin/../../thirdparty/lib/perl5"; # PERL5LIB
use Mojolicious::Commands;
use remOcular::MojoApp;

$ENV{MOJO_APP} = remOcular::MojoApp->new;
$ENV{MOJO_APP} = remOcular->new;

# Start commands
Mojolicious::Commands->start;
21 changes: 21 additions & 0 deletions backend/etc/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2011 Tobias Oetiker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.


EXTRA_DIST = remocular.cfg

etcdir = $(sysconfdir)
etc_DATA = $(EXTRA_DIST)
26 changes: 26 additions & 0 deletions backend/lib/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (C) 2011 Tobias Oetiker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

#
AUTOMAKE_OPTIONS = foreign


PM := $(wildcard *.pm remOcular/*.pm remOcular/plugins/*.pm)

EXTRA_DIST = $(PM)

perllibdir = $(prefix)/lib
nobase_perllib_DATA = $(EXTRA_DIST)
6 changes: 3 additions & 3 deletions backend/lib/remOcular/MojoApp.pm → backend/lib/remOcular.pm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package remOcular::MojoApp;
package remOcular;
use strict;
use warnings;

use remOcular::JsonRpcService;
use remOcular::Service;
use remOcular::Config;
use remOcular::Session;

Expand Down Expand Up @@ -46,7 +46,7 @@ sub startup {
my ($plugin_hand,$plugin_list) = $self->load_plugins();

my $services = {
remocular => new remOcular::JsonRpcService(
remocular => new remOcular::Service(
plugin_hand => $plugin_hand,
plugin_list => $plugin_list,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package remOcular::JsonRpcService;
package remOcular::Service;
use strict;
use POSIX qw(setsid sigprocmask);
use Fcntl ':flock'; # import LOCK_* constants
Expand Down
9 changes: 0 additions & 9 deletions backend/templates/example/welcome.html.ep

This file was deleted.

43 changes: 0 additions & 43 deletions backend/templates/exception.html.ep

This file was deleted.

4 changes: 0 additions & 4 deletions backend/templates/layouts/default.html.ep

This file was deleted.

8 changes: 0 additions & 8 deletions backend/templates/not_found.html.ep

This file was deleted.

120 changes: 120 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Copyright (C) 2011 Tobi Oetiker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

#


AC_INIT([remOcular],[0.9.0],[tobi@oetiker.ch])
AC_PREREQ([2.59])
AC_CONFIG_AUX_DIR(conftools)
AC_CANONICAL_TARGET
m4_version_prereq(2.60, [AC_USE_SYSTEM_EXTENSIONS], [#])
AM_INIT_AUTOMAKE(1.9)
AM_MAINTAINER_MODE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_PREFIX_DEFAULT(/opt/remocular-$PACKAGE_VERSION)

AC_ARG_VAR(PERL, [Path to local perl binary])
AC_PATH_PROG(PERL, perl, no)
AC_PATH_PROGS(NROFF, [gnroff nroff])

AC_ARG_VAR(GMAKE, [Path to local GNU Make binary])
AC_PATH_PROGS(GMAKE, [gnumake gmake make])

AC_MSG_CHECKING([checking for gnu make availablility])
if ( $GMAKE --version 2> /dev/null | $GREP GNU > /dev/null 2>&1 ); then
AC_MSG_RESULT([$GMAKE is GNU make])
else
AC_MSG_ERROR([GNU make not found. Try setting the GMAKE environment variable.])
fi

AC_ARG_ENABLE(pkgonly,
[AC_HELP_STRING([--enable-pkgonly],
[Skip all checking])])
AC_SUBST(enable_pkgonly)

HTDOCSDIR=${prefix}/htdocs
AC_ARG_WITH(htdocs-dir,[ --with-htdocs-dir=[DIR] Where to install htdocs [PREFIX/htdocs]], [HTDOCSDIR=$withval])
AC_SUBST(HTDOCSDIR)

#AC_ARG_WITH(perl5lib, [ --with-perl5lib=[A:B:C] Colon separated list of perl library directories], [PERL5LIB=$withval])

AC_ARG_VAR(PERL5LIB, [Colon separated list of perl library directories])

AC_SUBST(PERL5LIB)

# Check the necessary Perl modules

mod_ok=1
if test "$enable_pkgonly" != yes; then
prfx=$prefix
if test x$prfx = xNONE; then
prfx=$ac_default_prefix
fi
for module in Mojolicious Mojo::Server::FastCGI Config::Grammar IPC::Run; do
AC_MSG_CHECKING([checking for perl module '$module'])
if ${PERL} -I$prfx/thirdparty/lib/perl5 -e 'use '$module 2>/dev/null ; then
AC_MSG_RESULT([Ok])
else
AC_MSG_RESULT([Failed])
mod_ok=0
fi
done
if test x$mod_ok = x0; then
cat <<NOTES

** Aborting Configure ******************************

If you know where perl can find the missing modules, set
the PERL5LIB environment variable accordingly.

FIRST though, make sure that 'perl' starts the perl
binary you want to use for remOcular.

Now you can install local copies of the missing modules
by running

./install/build_missing_perlmodules.sh ${prfx}/thirdparty

NOTES
exit 1
fi

fi


AC_CONFIG_FILES([Makefile backend/Makefile backend/bin/Makefile backend/lib/Makefile backend/etc/Makefile])

AC_SUBST(VERSION)

AC_OUTPUT

cat <<NOTES

** Ready to install Smokeping ******************************

Settings:

PERL5LIB = ${PERL5LIB:-"not set"}
PERL = $PERL

The Smokeping Makefiles use GNU make functionality.
Continue installation with

$GMAKE install

NOTES
28 changes: 28 additions & 0 deletions frontend/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (C) 2011 Tobias Oetiker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

AUTOMAKE_OPTIONS = foreign

EXTRA_DIST = config.json generate.sh Manifest.json readme.txt source/index.html $(wildcard source/class/remocular/*.js source/class/remocular/util/*.js source/class/remocular/util/aggregator/*.js source/class/remocular/theme/*.js source/class/remocular/ui/table/*.js source/class/remocular/ui/table/model/*.js source/class/remocular/ui/form/*.js source/class/remocular/ui/form/renderer/*.js source/translation/*.po source/resource/remocular/*.png source/resource/remocular/*.gif)

source/script/remocular.js:
$(QOOXDOO_PATH)/tool/bin/generator.py -m QOOXDOO_PATH:$(QOOXDOO_PATH) -m CACHE:./cache source

dist-hook:
$(QOOXDOO_PATH)/tool/bin/generator.py -m QOOXDOO_PATH:$(QOOXDOO_PATH) -m CACHE:./cache -m BUILD_PATH:../backend/public build

clean-local:
test -d ./cache && rm -r ./cache
2 changes: 1 addition & 1 deletion frontend/Manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],

"version" : "#VERSION#",
"qooxdoo-versions": ["1.2.1"]
"qooxdoo-versions": ["1.5"]
},

"provides" :
Expand Down
Loading

0 comments on commit c3e97ef

Please sign in to comment.