[vz-dev] vzlogger install script

Andre Bernemann andre.bernemann at gmail.com
Mon Mar 2 14:55:41 CET 2015


Hi,

gute Idee, Danke für das Skript. Ich habe es mal getestet, und prinzipiell
funktioniert es bis auf ein paar Kleinigkeiten:

1. ./install.sh libsml --> klappt einwandfrei

2. ./install.sh libjson:
Ich bekomme folgenden Fehler:

CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/pi/vz/vzlogger/libs/
json-c/missing aclocal-1.14
/home/pi/vz/vzlogger/libs/json-c/missing: line 81: aclocal-1.14: command
not found
WARNING: 'aclocal-1.14' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
Makefile:462: recipe for target 'aclocal.m4' failed
make: *** [aclocal.m4] Error 127

Wenn ich die Skripte (autogen.sh && ...) manuell direkt im Ordner
libs/json-c durchlaufen lasse klappt es. Möglicherweise gibt es ein Problem
mit pushd und autogen.sh?

3. ./install.sh vzlogger
Fehler:
Install the project...
/usr/bin/cmake -P cmake_install.cmake
-- Install configuration: ""
-- Installing: /usr/local/share/doc/vzlogger-0-4/README
CMake Error at cmake_install.cmake:36 (FILE):
  file INSTALL cannot find "/home/pi/vz/vzlogger/INSTALL".
Makefile:65: recipe for target 'install' failed
make: *** [install] Error 1

Neben INSTALL wird auch die Datei COPYING in cmake_install.cmake
referenziert. Lege ich die beiden Dateien an funktioniert es.

Gruß
André


Andreas Goetz <cpuidle at gmail.com> schrieb am So., 1. März 2015 um 13:49 Uhr:

Hallo Zusammen,
>
> ich hab mal versucht ein Skript zu bauen das vzlogger installiert oder-
> sofern schon vorhanden- aktualisiert. Wäre schön wenn das jemand testen
> könnte bevor ich es im git einstelle (@Udo: das wäre auch was für Dich ;)
>
> Viele Grüße,
> Andreas
>
>
> #!/bin/bash
> #
> # Installer
> #
> # @copyright Copyright (c) 2015, The volkszaehler.org project
> # @license http://www.opensource.org/licenses/gpl-license.php GNU Public
> License
> # @author Andreas Goetz
> #
> ##
> # The installer will clone all required repositories or update them if
> necessary.
> # Then the modules are compiled and installed
> #
> # USAGE:
> #
> #   Run install.sh from vzlogger or parent folder
> #
> #       ./install.sh
> #
> #   To execute specific parts of the build select which ones to run:
> #
> #       ./install.sh <list of modules>
> #
> #   Modules:
> #     - vzlogger (libraries must be in place already)
> #     - libjson
> #     - libsml
> #     - clean (will clean the respektive make targets, requires explicitly
> naming the modules)
> #
> #     To run a clean build:
> #
> #       ./install.sh vzlogger libjson libsml clean
> #
> ##
> # This file is part of volkzaehler.org
> #
> # volkzaehler.org 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 3 of the License, or
> # any later version.
> #
> # volkzaehler.org 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 volkszaehler.org. If not, see <http://www.gnu.org/licenses/>.
> ##
>
> set -e
> shopt -s nocasematch
>
> ###############################
> # some defaults
> vzlogger_dir=vzlogger
> lib_dir=libs
> git_config=.git/config
>
> ###############################
> # functions
> ask() {
>     question="$1"
>     default="$2"
>     read -e -p "$question [$default] "
>     REPLY="${REPLY:-$default}"
> }
>
> contains() {
>     [[ $1 =~ $2 ]] && true || false
> }
>
> git_is_repo() {
>     folder="$1"
>     match="${2-$folder}"
>
>     if [ -e "$folder/$git_config" ] && grep -q "$match"
> "$folder/$git_config"; then
>         true
>     else
>         false
>     fi
> }
>
> git_update() {
>     folder="$1"
>     git_repo="$2"
>     match="${3-$folder}"
>     git_params="${4-}"
>
>     if git_is_repo $folder $match; then
>         echo "$folder folder: $(pwd)/$folder"
>         git_dirty=$(cd $folder; git fetch; git log HEAD.. --oneline)
>     else
>         echo "$folder not found"
>         echo "cloning $folder git repository"
>         git clone $git_params "$git_repo"
>     fi
>
>     if [ -n "$git_dirty" ]; then
>         echo "updating $folder git repository with remote changes"
>         pushd $folder
>             git pull
>         popd
>     fi
> }
>
>
> ###############################
> # header
> echo "vzlogger installation script"
>
> ###############################
> # check prerequisites
> echo
> echo -n "checking prerequisites:"
>
> deps=( grep pidof git cmake pkg-config autoreconf )
> for binary in "${deps[@]}"; do
>     if binpath="$(which $binary)" ; then
>         echo -n " $binary"
>     else
>         echo
>         echo " $binary: not found. Please install to use this script (e.g.
> sudo apt-get install $binary)."
>         exit 1
>     fi
> done
> echo
>
> ###############################
> echo
> echo "vzlogger setup..."
> if [ -n "$1" ]; then
>     echo "setup modules: $1"
> fi
>
> ###############################
> echo
> echo "checking for vzlogger folder"
>
> if git_is_repo . vzlogger; then
>     # move to parent folder
>     cd ..
> fi
>
> if [ -z "$1" ] || contains "$*" vzlogger; then
>     git_update "$vzlogger_dir" https://github.com/
> volkszaehler/vzlogger.git vzlogger
> fi
>
> pushd "$vzlogger_dir"
>
> ###############################
> echo
> echo "checking for libraries"
>
> if [ ! -d "$lib_dir" ]; then
>     echo "creating library folder $lib_dir"
>     mkdir "$lib_dir"
> fi
> pushd "$lib_dir"
>
>     ###############################
>     # libjson
>     if [ -z "$1" ] || contains "$*" libjson; then
>         echo
>         echo "checking for libjson"
>
>         git_update json-c https://github.com/json-c/json-c json-c "-b
> json-c-0.12"
>     fi
>
>     # libsml
>     if [ -z "$1" ] || contains "$*" libsml; then
>         echo
>         echo "checking for libsml"
>
>         git_update libsml https://github.com/volkszaehler/libsml.git
>     fi
>
>
>     ###############################
>     echo
>     echo "building and installing libraries"
>
>     # libjson
>     if [ -z "$1" ] || contains "$*" libjson; then
>         echo
>         echo "building and installing libjson"
>         pushd json-c
>             if [ ! -x ./configure ]; then
>                 sh autogen.sh
>             fi
>             if [ ! -e Makefile ]; then
>                 ./configure
>             else
>                 if contains "$*" clean; then make clean; fi
>             fi
>
>             make
>             sudo make install
>         popd
>     fi
>
>     # libsml
>     if [ -z "$1" ] || contains "$*" libsml; then
>         echo
>         echo "building and installing libsml"
>         pushd libsml
>             if contains "$*" clean; then make clean; fi
>
>             make
>             sudo cp sml/lib/libsml.* /usr/lib/
>             sudo cp -R sml/include/* /usr/include/
>             sudo cp sml.pc /usr/lib/pkgconfig/
>         popd
>     fi
>
> popd
>
> ###############################
> # vzlogger
> if [ -z "$1" ] || contains "$*" vzlogger; then
>     echo
>     echo "building and installing vzlogger"
>
>     if contains "$*" clean; then
>         echo "clearing cmake cache"
>         rm CMakeCache.txt
>     fi
>
>     echo "building vzlogger"
>     cmake .
>     make
>     echo "installing vzlogger"
>     sudo make install
>
>     if [ -n $(pidof vzlogger) ]; then
>         echo
>         echo "vzlogger is already running"
>         echo "make sure to restart vzlogger"
>     fi
> fi
>
> popd
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://demo.volkszaehler.org/pipermail/volkszaehler-dev/attachments/20150302/d4140252/attachment.html>


More information about the volkszaehler-dev mailing list