summaryrefslogtreecommitdiffstats
path: root/afb-daemon.pc.in
blob: da2a740c96456498390c334a25fbd1e963f94b8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
##
## Copyright (C) 2016, 2017 "IoT.bzh"
## Author: José Bollo <jose.bollo@iot.bzh>
##
## This file is part of afb-daemon project.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
##   http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##

includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
binding_install_dir=@binding_install_dir@

Name: @PROJECT_PRETTY_NAME@
Description: @PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@
URL: @PROJECT_URL@

Requires: json-c
Cflags: -I${includedir}
ot; SCRIPT=$(basename $BASH_SOURCE) VERSION=$(grep '"version":' $(dirname $BASH_SOURCE)/book.json | cut -d'"' -f 4) [ "$VERSION" != "" ] && OUTFILENAME="${OUTFILENAME}_${VERSION}" function usage() { cat <<EOF >&2 Usage: $SCRIPT [options] [pdf|serve|doxygen] Options: --debug enable debug when generating pdf or html documentation -d|--dry dry run -h|--help get this help Example: $SCRIPT pdf EOF exit 1 } function info() { echo "$@" >&2 } #default values DEBUG_FLAG="" DRY="" DO_ACTION="" OUT_DIR=./build [[ $? != 0 ]] && usage while [ $# -gt 0 ]; do case "$1" in --debug) DEBUG_FLAG="--log=debug --debug";; -d|--dry) DRY=echo;; -h|--help) usage;; pdf | serve | doxygen) DO_ACTION=$1;; --) break;; esac shift done cd $(dirname $0) ROOTDIR=`pwd -P` # Create out dir if needed [ -d $OUT_DIR ] || mkdir -p $OUT_DIR if [ "$DO_ACTION" = "pdf" -o "$DO_ACTION" = "serve" ]; then GITBOOK=`which gitbook` [ "$?" = "1" ] && { echo "You must install gitbook first, using: sudo npm install -g gitbook-cli"; exit 1; } EBCONV=`which ebook-convert` [ "$?" = "1" ] && { echo "You must install calibre first, using: 'sudo apt install calibre' or refer to https://calibre-ebook.com/download"; exit 1; } if [ "$DO_ACTION" = "pdf" ]; then # Update cover when book.json has been changed [[ $ROOTDIR/book.json -nt $ROOTDIR/docs/cover.jpg ]] && { echo "Update cover files"; $ROOTDIR/docs/resources/make_cover.sh || exit 1; } OUTFILE=$OUT_DIR/$OUTFILENAME.pdf $DRY $GITBOOK pdf $ROOTDIR $OUTFILE $DEBUG_FLAG [ "$?" = "0" ] && echo "PDF has been successfully generated in $OUTFILE" else $DRY $GITBOOK serve $DEBUG_FLAG fi elif [ "$DO_ACTION" = "doxygen" ]; then $DRY cd $OUT_DIR && cmake .. && make doxygen $ROOTDIR/Doxyfile else echo "Unknown action !" usage fi