-
Notifications
You must be signed in to change notification settings - Fork 9
/
ipa-fun-build.sh
executable file
·46 lines (34 loc) · 1.14 KB
/
ipa-fun-build.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/bash
##############################################################################
# Author: Tomas Babej <tbabej@redhat.com>
#
# Builds the FreeIPA rpms from sources.
# Removes everything from the $DIST_DIR and moves newly built RPMs there
#
# Usage: $0
# Returns: 0 on success, 1 on failure
##############################################################################
# If any command here fails, exit the script
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/config.sh
# Remove everything from the $DIST_DIR, so that collision with the new RPMS
# does not happen
if [[ -d $DIST_DIR ]]
then
sudo rm -rf $DIST_DIR/*
fi
# Make sure that the directory does exist, since rm -rf supresses errors
mkdir -p $DIST_DIR
# We checkout to the directory with the sources
pushd $IPA_DIR
# Build can fail if the logged user does not have access to some files
# This can happen if you played around with root in your home directory
sudo chown -R $USER .
# Make sure there is no garbage in the dist directory
sudo rm -rf dist/*
# Build ALL the rpms
make -s rpms 2>&1
# Copy the result into DIST_DIR
cp dist/rpms/* $DIST_DIR/
popd