2016-03-12 19:21:04 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Initializing and settings:
|
2016-03-12 21:35:05 +00:00
|
|
|
READ_PEM=0644
|
2016-03-12 19:21:04 +00:00
|
|
|
EXEC_PEM=0755
|
|
|
|
|
|
|
|
SCRIPT_NAME="git-secret"
|
|
|
|
SCRIPT_DESCRIPTION="A bash-tool to store your private data inside a git repository."
|
|
|
|
SCRIPT_VERSION=$(bash ${PWD}/git-secret --version)
|
|
|
|
: ${SCRIPT_EPOCH:=0}
|
|
|
|
: ${SCRIPT_ITERATION:=1}
|
|
|
|
|
|
|
|
if [[ -z "$SCRIPT_BUILD_DIR" ]]; then
|
|
|
|
SCRIPT_BUILD_DIR="${HOME}/debbuild-${SCRIPT_NAME}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
SCRIPT_DEST_DIR="${SCRIPT_BUILD_DIR}/installroot"
|
|
|
|
|
|
|
|
# Preparing the files
|
|
|
|
rm -rf "$SCRIPT_BUILD_DIR"
|
|
|
|
mkdir -p "$SCRIPT_DEST_DIR"
|
|
|
|
|
|
|
|
# Coping the files inside the build folder:
|
2016-03-12 21:35:05 +00:00
|
|
|
install -D -T -b -m "$EXEC_PEM" -T "git-secret" "${SCRIPT_DEST_DIR}/usr/bin/git-secret"
|
|
|
|
install -m "$READ_PEM" -d "${SCRIPT_DEST_DIR}/usr/share/man/man1"
|
2016-03-13 09:14:28 +00:00
|
|
|
install -m "$READ_PEM" -d "${SCRIPT_DEST_DIR}/usr/share/man/man7"
|
2016-03-12 19:21:04 +00:00
|
|
|
for file in man/man1/* ; do
|
2016-03-12 21:35:05 +00:00
|
|
|
if [[ "$file" == *.ronn ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
2016-03-12 19:21:04 +00:00
|
|
|
|
2016-03-12 21:35:05 +00:00
|
|
|
install -D -T -b -m "$READ_PEM" -T "$file" "${SCRIPT_DEST_DIR}/usr/share/${file}"
|
2016-03-12 19:21:04 +00:00
|
|
|
done
|
2016-03-13 09:14:28 +00:00
|
|
|
install -D -T -b -m "$READ_PEM" -T "man/man7/git-secret.7" \
|
|
|
|
"${SCRIPT_DEST_DIR}/usr/share/man/man7/git-secret.7"
|
2016-03-12 19:21:04 +00:00
|
|
|
|
|
|
|
# Building .deb package:
|
|
|
|
cd "$SCRIPT_DEST_DIR" && fpm -s dir -t deb \
|
|
|
|
-a all \
|
|
|
|
-n "$SCRIPT_NAME" \
|
|
|
|
--epoch "$SCRIPT_EPOCH" \
|
|
|
|
--version "$SCRIPT_VERSION" \
|
|
|
|
--iteration "$SCRIPT_ITERATION" \
|
|
|
|
--description="$SCRIPT_DESCRIPTION" \
|
|
|
|
-C "$SCRIPT_DEST_DIR" \
|
|
|
|
.
|