Initial code check in
[people/jschlag/pbs-docker.git] / src / pbs-web / setup-org.sh
1 #!/bin/bash
2 #
3 #settings
4 #
5 #="database"
6
7 log() {
8 echo "#######################################"
9 echo ""
10 echo "$@"
11 echo ""
12 echo "#######################################"
13 }
14
15 # build the pbs from master branch
16 log "Update all packages"
17 yum update -y
18 log "Installing epel"
19 yum install -y epel-release
20 log "Installing packages for build"
21 yum install -y git gcc make intltool autoconf libtool libtool-devel libcap-devel libsolv-devel python-devel xz-devel
22 log "Installing dependencies"
23 yum install -y python-daemon python-tornado libcap libsolv xz
24
25 # add a user
26 groupadd -g 2000 pbs
27 useradd --system --no-create-home --shell /bin/bash --uid 2000 --gid 2000 pbs
28
29 mkdir -p /opt/dev
30 log "Building pakfire"
31 cd /opt/dev
32 git clone -b master http://git.ipfire.org/pub/git/pakfire.git
33 cd pakfire
34 ./autogen.sh
35 ./configure --prefix=/usr
36 make
37 make install
38
39 log "Installing the pbs"
40 cd /opt/
41 git clone -b master http://git.ipfire.org/pub/git/pbs.git
42 cd pbs
43 chmod +x pakfire-web
44
45 # cleanup
46 yum remove -y git gcc make intltool autoconf libtool libtool-devel
47 yum autoremove -y
48 yum clean all
49 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /opt/dev/*
50
51 # set permissions