diff options
author | an9wer | 2020-05-30 23:05:44 +0800 |
---|---|---|
committer | an9wer | 2020-05-30 23:05:44 +0800 |
commit | bd9f5dd2c28ce83ba748cf7ebecc2901cc8c43da (patch) | |
tree | 19e4dca08675b0d321d400da43a224561a71d3d9 | |
parent | d50a47b9fd461888a3c4e3fe70fc108313276fc6 (diff) | |
download | aur-bd9f5dd2c28ce83ba748cf7ebecc2901cc8c43da.tar.gz |
[0.1.1-1] Add rebuild for slstatus
-rw-r--r-- | PKGBUILD | 8 | ||||
-rwxr-xr-x | suckless-rebuild | 29 |
2 files changed, 18 insertions, 19 deletions
@@ -1,15 +1,15 @@ # Maintainer: Runney Wu <an9wer@gmail.com> pkgname=an9wer-suckless-rebuild -pkgver=0.1.0 -pkgrel=2 -pkgdesc="A script to rebuild suckless tools" +pkgver=0.1.1 +pkgrel=1 +pkgdesc="A script to rebuild suckless softwares" url="https://github.com/an9wer/pkg/tree/master/arch/suckless-rebuild" arch=('x86_64') license=('MIT') depends=('bash') source=("suckless-rebuild") -md5sums=('52dd209ab552f2134dc129d5860eda91') +md5sums=('3bca355a7976136bc77c5421d9e7c59d') package() { install -m755 -D suckless-rebuild "$pkgdir/usr/bin/suckless-rebuild" diff --git a/suckless-rebuild b/suckless-rebuild index 213a9a743aeb..dac11721fc77 100755 --- a/suckless-rebuild +++ b/suckless-rebuild @@ -4,24 +4,23 @@ DESTDIR=~/.suckless BUILDDIR=~/.suckless-build usage() { - echo "Usage: suckless-rebuild st <config.h>" + echo "Usage: suckless-rebuild st|slstatus <config.h>" exit 1 } if [[ ${#@} != 2 || $1 =~ ^-h$|^--help$ || $2 =~ ^-h$|^--help$ ]]; then - echo "Usage: suckless-rebuild st <config.h>" - exit 1 + usage fi -tool=$1 +software=$1 config=$2 -if [[ ! $tool =~ ^st$ ]]; then - echo "Unknown suckless tool '$tool'." +if [[ ! $software =~ ^st$|^slstatus$ ]]; then + echo "Unknown suckless software '$software'." exit 1 fi -if [[ ! -d /usr/src/$tool ]]; then - echo "'an9wer-$tool' may not be installed." +if [[ ! -d /usr/src/$software ]]; then + echo "'an9wer-$software' may not be installed." exit 1 fi if [[ ! -f $config ]]; then @@ -29,20 +28,20 @@ if [[ ! -f $config ]]; then exit 1 fi -if [[ -e $BUILDDIR/$tool ]]; then - temp=$(mktemp -u -d /tmp/$tool.XXXXX) - mv "$BUILDDIR/$tool" "$temp" +if [[ -e $BUILDDIR/$software ]]; then + temp=$(mktemp -u -d /tmp/$software.XXXXX) + mv "$BUILDDIR/$software" "$temp" fi mkdir -p "$BUILDDIR" -cp -r /usr/src/st "$BUILDDIR/$tool" -cp -f "$config" "$BUILDDIR/$tool" +cp -r /usr/src/$software "$BUILDDIR/$software" +cp -f "$config" "$BUILDDIR/$software" -cd "$BUILDDIR/$tool" +cd "$BUILDDIR/$software" if make &> build.log && make PREFIX="$DESTDIR" install &> build.log; then echo "Done! Recommend to add '~/.suckless/bin' to \$PATH to use new builded st." else - echo "Some error occurred, check '$BUILDDIR/$tool/build.log' to find more." + echo "Some error occurred, check '$BUILDDIR/$software/build.log' to find more." fi if [[ -v temp ]]; then sed -i "1i The last built directory was moved to $temp\n" build.log |