]> arthur.barton.de Git - netdata.git/blob - packaging/git-build
Add hooks and packaging scripts
[netdata.git] / packaging / git-build
1 #!/bin/sh
2
3 # When run from the top-level repository, performs a complete clean
4 # and maintainer-mode rebuild of the FireHOL package.
5
6 if [ ! -f .gitignore -o ! -f configure.ac -o ! -x autogen.sh ]
7 then
8   echo "Run as ./packaging/git-build from an autotools git repository"
9   exit 1
10 fi
11
12 # If we are genuinely in a git repo, try to clean it up, otherwise
13 # just make the assumption
14 if [ -d .git ]
15 then
16   clean=$(git status -s | grep "^?")
17
18   if [ "$clean" ]
19   then
20     if [ "$1" != "-ok" ]
21     then
22       echo "Warning: this script runs: git clean -d -f -x"
23       echo "         ensure all required ?? files are added, then re-run with '-ok'"
24       git status -s | grep '^?'
25       exit 1
26     fi
27   fi
28
29   set -e
30   git clean -d -f -x
31   set +e
32 fi
33
34 set -e
35 ./autogen.sh
36 ./configure --enable-maintainer-mode 
37 set +e
38 make dist
39 status=$?
40 exit $status