Initial commit.
This commit is contained in:
parent
f8a0e29320
commit
3a364ba046
|
|
@ -0,0 +1,116 @@
|
|||
#/usr/bin/env bash
|
||||
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
if [[ ${ARCH} == "armhf" ]]; then ARCH="arm-v7"; fi
|
||||
USER="zunit-zsh"
|
||||
PROJECT="zunit"
|
||||
PACKAGE="zsh-zunit"
|
||||
VERSION=$(curl "https://api.github.com/repos/${USER}/${PROJECT}/tags?per_page=5" | jq '[ .[] | select(.name|test("v[[:digit:].]+$"))]|.[0] | .name')
|
||||
DEB_VERSION=$(echo "${VERSION}" | tr -d "\"" | tr -d "v") # strip the preceding 'v'
|
||||
#VERSION="1.0.0"
|
||||
#ARCH=$(dpkg --print-architecture)
|
||||
MACHINE=$(uname -m)
|
||||
OS=$(uname -s)
|
||||
# DEBEMAIL="person@company.tld"
|
||||
# DEBFULLNAME="Testy McTester"
|
||||
# DESCRIPTION="."
|
||||
# LONG_DESCRIPTION=" ."
|
||||
|
||||
RSS_FEED="https://github.com/${USER}/${PROJECT}/releases.atom"
|
||||
# xdg-open ${RSS_FEED}
|
||||
echo ${RSS_FEED}
|
||||
|
||||
EXCLUDES="/root/.wget-hsts"
|
||||
|
||||
REQUIRES="zsh"
|
||||
BUILD_DIR=/var/tmp/build_zunit
|
||||
|
||||
## Checkinstall variables - see defaults in /etc/checkinstallrc
|
||||
# DOC_DIR=/usr/share/doc
|
||||
|
||||
# make a new temporary directory for this use to avoid permission issues.
|
||||
BASE_TMP_DIR=~/tmptmp/checkinstall_tmp
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
## Create and populate the install scripts and documentation for checkinstall
|
||||
cat >${BUILD_DIR}/description-pak <<EOF
|
||||
ZUnit is a powerful unit testing framework for ZSH
|
||||
EOF
|
||||
|
||||
# | preinstall-pak | Run BEFORE the package is INSTALLED |
|
||||
cat >${BUILD_DIR}/preinstall-pak <<EOF
|
||||
#!/usr/bin/env bash
|
||||
EOF
|
||||
|
||||
# | postinstall-pak | Run AFTER the package is INSTALLED |
|
||||
cat >${BUILD_DIR}/postinstall-pak <<EOF
|
||||
#!/usr/bin/env bash
|
||||
EOF
|
||||
|
||||
# | preremove-pak | Run BEFORE the package is REMOVED |
|
||||
cat >${BUILD_DIR}/preremove-pak <<EOF
|
||||
#!/usr/bin/env bash
|
||||
EOF
|
||||
|
||||
# | postremove-pak | Run AFTER the package is REMOVED
|
||||
cat >${BUILD_DIR}/postremove-pak <<EOF
|
||||
#!/usr/bin/env bash
|
||||
EOF
|
||||
|
||||
## Make the doc-pak directory for README, INSTALL, COPYING, Changelog, TODO, CREDITS
|
||||
mkdir -p ${BUILD_DIR}/doc-pak
|
||||
#cp README INSTALL COPYING Changelog TODO CREDITS doc-pak
|
||||
|
||||
cat >${BUILD_DIR}/doc-pak/README <<EOF
|
||||
EOF
|
||||
|
||||
cat >${BUILD_DIR}/checkinstall_it.sh <<FOE
|
||||
|
||||
## Checkinstall variables - see defaults in /etc/checkinstallrc
|
||||
DOC_DIR=/usr/share/doc
|
||||
|
||||
# make a new temporary directory for this use to avoid permission issues.
|
||||
BASE_TMP_DIR=~/tmptmp/checkinstall_tmp
|
||||
mkdir -p '${BASE_TMP_DIR}'
|
||||
|
||||
|
||||
# do your work
|
||||
checkinstall -y --fstrans \
|
||||
--pkgname=${PACKAGE} \
|
||||
--pkgversion=${DEB_VERSION}\
|
||||
--pkgrelease=${RELEASE} \
|
||||
--pkgarch=${ARCH} \
|
||||
--pkggroup=admin \
|
||||
--pkglicense=LICENSE \
|
||||
--pkgsource=${LATEST_URL} \
|
||||
--maintainer=cyteen@ring-zero.co.uk \
|
||||
--requires=${REQUIRES} \
|
||||
--recommends=${RECOMENDS} \
|
||||
--suggests=${SUGGESTS} \
|
||||
--exclude=${EXCLUDES} \
|
||||
-D \
|
||||
bash ${BUILD_DIR}/install.sh
|
||||
FOE
|
||||
|
||||
echo "Writing install.sh to: ${BUILD_DIR}/install.sh"
|
||||
cat >${BUILD_DIR}/install.sh <<FOE
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
#set -x
|
||||
|
||||
# Install revolver
|
||||
curl -L https://raw.githubusercontent.com/molovo/revolver/master/revolver > /usr/local/bin/revolver
|
||||
|
||||
# Build ZUnit from source
|
||||
git clone https://github.com/zunit-zsh/zunit $BUILD_DIR/zunit
|
||||
cd $BUILD_DIR/zunit
|
||||
./build.zsh
|
||||
|
||||
# Copy zunit into $path
|
||||
cp zunit /usr/local/bin
|
||||
|
||||
# Optional, copy ZUnit ZSH completion into $fpath
|
||||
cp zunit.zsh-completion "${fpath[1]}/_zunit"
|
||||
FOE
|
||||
|
||||
bash ${BUILD_DIR}/checkinstall_it.sh
|
||||
Loading…
Reference in New Issue