development/hub: Updated for version 2.2.0 (moved from ruby).

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Willy Sudiarto Raharjo 2015-02-24 07:00:13 +07:00
parent 21219b2025
commit 69459823cc
4 changed files with 27 additions and 42 deletions

View file

@ -2,7 +2,7 @@
# Slackware build script for hub # Slackware build script for hub
# Copyright 2014 Willy Sudiarto Raharjo <willysr@slackbuilds.org> # Copyright 2014-2015 Willy Sudiarto Raharjo <willysr@slackbuilds.org>
# All rights reserved. # All rights reserved.
# #
# Redistribution and use of this script, with or without modification, is # Redistribution and use of this script, with or without modification, is
@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=hub PRGNAM=hub
VERSION=${VERSION:-1.12.4} VERSION=${VERSION:-2.2.0}
BUILD=${BUILD:-1} BUILD=${BUILD:-1}
TAG=${TAG:-_SBo} TAG=${TAG:-_SBo}
@ -59,51 +59,36 @@ set -e
rm -rf $PKG rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT mkdir -p $TMP $PKG $OUTPUT
cd $TMP cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/v$VERSION.tar.gz || tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
DESTDIR=$( ruby -r rbconfig -e ' ./script/build
include RbConfig mkdir -p $PKG/usr/bin
printf("%s/%s/gems/%s\n", install -m755 $PRGNAM $PKG/usr/bin/$PRGNAM
CONFIG["libdir"],
CONFIG["RUBY_INSTALL_NAME"],
CONFIG["ruby_version"]
)
')
gem specification $CWD/$PRGNAM-$VERSION.gem | \ mkdir -p $PKG/usr/man/man1
ruby -r yaml -r rbconfig -e ' gzip -c man/hub.1 > $PKG/usr/man/man1/hub.1.gz
c = Config::CONFIG
path = sprintf("%s/%s/gems/%s",
c["libdir"],
c["RUBY_INSTALL_NAME"],
c["ruby_version"])
sys_gemspecs = Dir.glob(path + "/specifications/*").map {|g| gs = Gem::Specification.load(g); gs.name }
obj = Gem::Specification.from_yaml($stdin)
obj.dependencies.each {|dep|
if not(dep.type == :runtime)
next
end
if not(sys_gemspecs.include?(dep.name))
$stderr.write("WARNING: #{dep.name} gem not found\n")
sleep 0.5
end
}'
gem install \
--local \
--no-update-sources \
--ignore-dependencies \
--backtrace \
--install-dir $PKG/$DESTDIR \
--bindir $PKG/usr/bin \
$CWD/$PRGNAM-$VERSION.gem
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
install -m644 LICENSE CONTRIBUTING.md README.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/usr/share/bash-completion/completions/hub
install -m644 etc/hub.bash_completion.sh $PKG/usr/share/bash-completion/completions/hub
mkdir -p $PKG/usr/share/zsh/site-functions
install -m644 etc/hub.zsh_completion $PKG/usr/share/zsh/site-functions/_hub
mkdir -p $PKG/install mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/slack-desc > $PKG/install/slack-desc

View file

@ -1,10 +1,10 @@
PRGNAM="hub" PRGNAM="hub"
VERSION="1.12.4" VERSION="2.2.0"
HOMEPAGE="https://github.com/github/hub" HOMEPAGE="https://github.com/github/hub"
DOWNLOAD="https://rubygems.org/downloads/hub-1.12.4.gem" DOWNLOAD="https://github.com/github/hub/archive/v2.2.0.tar.gz"
MD5SUM="6a3dd795b50e462dc77b54972d29941a" MD5SUM="eddce830a079b8480f104aa7496f46fe"
DOWNLOAD_x86_64="" DOWNLOAD_x86_64=""
MD5SUM_x86_64="" MD5SUM_x86_64=""
REQUIRES="" REQUIRES="google-go-lang"
MAINTAINER="Willy Sudiarto Raharjo" MAINTAINER="Willy Sudiarto Raharjo"
EMAIL="willysr@slackbuilds.org" EMAIL="willysr@slackbuilds.org"