From 341f0c25a017a22a395d21aefa29049e2e3759ea Mon Sep 17 00:00:00 2001 From: Jostein Berntsen Date: Fri, 22 Sep 2017 23:29:40 +0100 Subject: ruby/rubygem-mime-types: Updated for version 3.1. Signed-off-by: David Spencer --- ruby/rubygem-mime-types/README | 11 ++ .../rubygem-mime-types.SlackBuild | 118 +++++++++++++++++++++ ruby/rubygem-mime-types/rubygem-mime-types.info | 10 ++ ruby/rubygem-mime-types/slack-desc | 19 ++++ 4 files changed, 158 insertions(+) create mode 100644 ruby/rubygem-mime-types/README create mode 100644 ruby/rubygem-mime-types/rubygem-mime-types.SlackBuild create mode 100644 ruby/rubygem-mime-types/rubygem-mime-types.info create mode 100644 ruby/rubygem-mime-types/slack-desc (limited to 'ruby') diff --git a/ruby/rubygem-mime-types/README b/ruby/rubygem-mime-types/README new file mode 100644 index 0000000000..66455ed0a4 --- /dev/null +++ b/ruby/rubygem-mime-types/README @@ -0,0 +1,11 @@ +The mime-types library provides a library and registry for information +about MIME content type definitions. It can be used to determine +defined filename extensions for MIME types, or to use filename +extensions to look up the likely MIME type definitions. Version 3.0 is +a major release that requires Ruby 2.0 compatibility and removes +deprecated functions. The columnar registry format introduced in 2.6 +has been made the primary format; the registry data has been extracted +from this library and put into the rubygem-mime-types-data package. +Additionally, mime-types is now licensed exclusively under the MIT +licence and there is a code of conduct in effect. There are a number of +other smaller changes described in the History file. diff --git a/ruby/rubygem-mime-types/rubygem-mime-types.SlackBuild b/ruby/rubygem-mime-types/rubygem-mime-types.SlackBuild new file mode 100644 index 0000000000..38f78eb23e --- /dev/null +++ b/ruby/rubygem-mime-types/rubygem-mime-types.SlackBuild @@ -0,0 +1,118 @@ +#!/bin/sh + +# Slackware build script for rubygem-mime-types + +# Copyright 2017 Jostein Berntsen +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=rubygem-mime-types +VERSION=${VERSION:-3.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +SRCNAM=mime-types + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP + +DESTDIR=$( ruby -r rbconfig -e ' +include RbConfig +printf("%s/%s/gems/%s\n", + CONFIG["libdir"], + CONFIG["RUBY_INSTALL_NAME"], + CONFIG["ruby_version"] + ) +') + +gem specification $CWD/$SRCNAM-$VERSION.gem | \ + ruby -r yaml -r rbconfig -e ' +c = RbConfig::CONFIG +path = sprintf("%s/%s/gems/%s", + c["libdir"], + c["RUBY_INSTALL_NAME"], + c["ruby_version"]) +sys_gemspecs = Dir.glob(path + "/specifications/**/*.gemspec").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/$SRCNAM-$VERSION.gem + +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 + +rm -rf $PKG/$DESTDIR/cache + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +tar -x -O --file=$CWD/$SRCNAM-$VERSION.gem data.tar.gz \ + | tar -xz -C $PKG/usr/doc/$PRGNAM-$VERSION --file=- \ + Code-of-Conduct.rdoc Contributing.rdoc History.rdoc README.rdoc Licence.rdoc +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/ruby/rubygem-mime-types/rubygem-mime-types.info b/ruby/rubygem-mime-types/rubygem-mime-types.info new file mode 100644 index 0000000000..f69e102ecc --- /dev/null +++ b/ruby/rubygem-mime-types/rubygem-mime-types.info @@ -0,0 +1,10 @@ +PRGNAM="rubygem-mime-types" +VERSION="3.1" +HOMEPAGE="https://github.com/mime-types/ruby-mime-types/" +DOWNLOAD="https://rubygems.org/downloads/mime-types-3.1.gem" +MD5SUM="d81cae43778c88988ee8b3cedc03bc84" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="rubygem-mime-types-data" +MAINTAINER="Jostein Berntsen" +EMAIL="jbernts@broadpark.no" diff --git a/ruby/rubygem-mime-types/slack-desc b/ruby/rubygem-mime-types/slack-desc new file mode 100644 index 0000000000..4917691a55 --- /dev/null +++ b/ruby/rubygem-mime-types/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +rubygem-mime-types: rubygem-mime-types (MIME content type library) +rubygem-mime-types: +rubygem-mime-types: The mime-types library provides a library and registry for +rubygem-mime-types: information about MIME content type definitions. +rubygem-mime-types: +rubygem-mime-types: +rubygem-mime-types: +rubygem-mime-types: +rubygem-mime-types: Home: https://github.com/mime-types/ruby-mime-types/ +rubygem-mime-types: +rubygem-mime-types: -- cgit v1.2.3