[vz-dev] vzlogger install script

Andreas Goetz cpuidle at gmail.com
Tue Mar 3 09:20:39 CET 2015


Moin Andre,

aktuelle Version im git sollte jetzt durchlaufen. Wenn noch etwas fehlt
melde Dich gerne.

Viele Grüße,
Andreas

PS.: Nicht github sondern KDG hatte das Problem die Verbindung in die USA
gekappt zu haben. Sachen gibts...


2015-03-02 20:14 GMT+01:00 Andreas Goetz <cpuidle at gmail.com>:

> OK, ich habe beide Fehler gefunden. Einmal in meinem Skript etwas zuviel
> optimiert, einmal liegt der Fehler im letzten Commit bzw. den
> Abhängigkeiten. Leider ist github down, sobald das wieder da ist korrigier
> ichs.
>
> Viele Grüße,
> Andreas
>
>
> 2015-03-02 17:37 GMT+01:00 Andre Bernemann <andre.bernemann at gmail.com>:
>
>>
>> Hallo Andreas,
>>
>> Andreas Goetz <cpuidle at gmail.com> schrieb am Mo., 2. März 2015 um
>> 16:23 Uhr:
>>
>>> Hallo Andre,
>>>
>>> On Mon, Mar 2, 2015 at 2:55 PM, Andre Bernemann <
>>> andre.bernemann at gmail.com> wrote:
>>>
>>>> gute Idee, Danke für das Skript. Ich habe es mal getestet, und
>>>> prinzipiell funktioniert es bis auf ein paar Kleinigkeiten:
>>>>
>>>
>>> Das wäre ja schön, aber die Mängelliste ist ja doch etwas länger.
>>>
>>
>>>
>>>> 1. ./install.sh libsml --> klappt einwandfrei
>>>>
>>>
>>> Der vollständigkeit halber: was hast Du vorher gemacht? git clone? wget?
>>> Hattest Du install.sh auch mal ohne Parameter aufgerufen? Gelten die
>>> Ergebnisse unten für einen frischen git clone? Wann hattest Du das getestet?
>>>
>>
>> Vorher hatte ich einen git reset durchgeführt. Ich habe libsml schon
>> woanders liegen, der Installer hat es aber innerhalb des vzlogger Ordners
>> (unter libs wie geplant) neu angelegt. Damit ist libsml ein frischer git
>> clone, obwohl mein pi libsml grundsätzlich schon mal kompiliert hat.
>> Dependencies sind demnach alle vorhanden. Durchgeführt habe ich es nach den
>> letzten Änderungen im git (efd38e9).
>>
>> Ich habe es nun wie folgt nochmal auf 2 rPi's durchgeführt:
>>
>> - wget install.sh
>> - chmod +x
>> - ./install ohne Parameter aufgerufen: Alles wird heruntergeladen, erster
>> Fehler tritt beim make von libjson auf (s.u.).
>> - manuell autogen.sh in ./vzlogger/libs/json-c aufgerufen
>> - touch INSTALL im vzlogger Verzeichnis
>> - nochmals ./install.sh ohne Parameter aufgerufen
>> --> läuft dann fast komplett durch, zuletzt kommt noch ein kleiner Fehler
>> aus Z249: ./install.sh: line 247: [: too many arguments, aber das ist ja
>> eine Kleinigkeit.
>>
>>
>>>
>>>> 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?
>>>>
>>>
>>> Ich passe. Überhaupt keine Idee. Kann das nur nochmal vom Start weg
>>> versuchen nachzuvollziehen.
>>>
>>>
>>>> 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.
>>>>
>>>
>>> Kommt der Fehler auch wenn Du einfach nur
>>>
>>> cmake .
>>> make
>>> sudo make install
>>>
>>> aufrufst?
>>>
>>
>> Ja.
>>
>>
>>>
>>>
>> Bei mir gibt es COPYING, im git ist sie ebenfalls- warum existiert die
>>> Datei bei Dir nicht standardmäßig?
>>>
>>> @root, @mbehr: kann es sein dass das Aufräumen der Automake Umgebung
>>> etwas damit zu tun hat (mindestens bzgl. INSTALL)?
>>>
>>
>> Ok, COPYING war da, hatte ich übersehen, mein Fehler. INSTALL fehlt
>> allerdings.
>>
>>
>>>
>>>> Gruß
>>>> André
>>>>
>>>
>>> Viele Grüße,
>>> Andreas
>>>
>>
>> Ich hoffe das hilft weiter.
>>
>> Gruß
>> André
>>
>> P.S.: Komplett OT, aber ich wäre ein großer Fan des raw Kontextes in der
>> Middleware.
>>
>>
>>>>
>>>> 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/20150303/bb03dd93/attachment-0001.html>


More information about the volkszaehler-dev mailing list