summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Dreyer <ktdreyer@ktdreyer.com>2013-12-27 12:35:22 -0700
committerKen Dreyer <ktdreyer@ktdreyer.com>2013-12-27 21:32:06 -0700
commitfc4cc722173020a489dccb875d95382e467d3e56 (patch)
treef040cb789656df52aa2014012aaabea23d91b834
downloadrubygem-github-linguist-fc4cc722173020a489dccb875d95382e467d3e56.tar.gz
rubygem-github-linguist-fc4cc722173020a489dccb875d95382e467d3e56.tar.xz
rubygem-github-linguist-fc4cc722173020a489dccb875d95382e467d3e56.zip
initial package import
-rw-r--r--.gitignore2
-rwxr-xr-xrubygem-github-linguist-generate-test-tarball.sh39
-rw-r--r--rubygem-github-linguist.spec98
-rw-r--r--sources2
4 files changed, 141 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..60e66b8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/github-linguist-2.10.7.gem
+/github-linguist-2.10.7-tests.tar.xz
diff --git a/rubygem-github-linguist-generate-test-tarball.sh b/rubygem-github-linguist-generate-test-tarball.sh
new file mode 100755
index 0000000..183b151
--- /dev/null
+++ b/rubygem-github-linguist-generate-test-tarball.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+set -e
+
+VERSION=2.10.7
+
+# GitHub has not pushed a tag for 2.10.7.
+# https://github.com/github/linguist/issues/869
+GITSHA=3ece15b3984191e5b0f5656173d7cd8575a2b6c7
+
+# If you are using a public tag, then comment out the GITSHA definition above.
+if [ -z "$GITSHA" ]; then
+ # Upstream has pushed a public tag for $VERSION.
+ GITHUBURL=https://github.com/github/linguist/archive/v${VERSION}.zip
+ DIRNAME=linguist-${VERSION}
+else
+ # We don't have a public tag, so we have to go off a SHA instead.
+ GITHUBURL=https://github.com/github/linguist/archive/${GITSHA}.zip
+ DIRNAME=linguist-${GITSHA}
+fi
+
+# download zipball
+if [[ ! -f github-linguist-$VERSION.zip ]]; then
+ curl -o github-linguist-$VERSION.zip -L $GITHUBURL
+fi
+
+# extract zipball
+[ -d $DIRNAME ] && rm -r $DIRNAME
+unzip github-linguist-$VERSION.zip
+
+pushd $DIRNAME
+ # repack
+ tar -cJvf github-linguist-$VERSION-tests.tar.xz test samples
+ mv github-linguist-$VERSION-tests.tar.xz ..
+popd
+
+# Clean up
+rm github-linguist-$VERSION.zip
+rm -r $DIRNAME
diff --git a/rubygem-github-linguist.spec b/rubygem-github-linguist.spec
new file mode 100644
index 0000000..e2c28fb
--- /dev/null
+++ b/rubygem-github-linguist.spec
@@ -0,0 +1,98 @@
+%global gem_name github-linguist
+
+Name: rubygem-%{gem_name}
+Version: 2.10.7
+Release: 1%{?dist}
+Summary: GitHub Language detection
+Group: Development/Languages
+License: MIT
+URL: https://github.com/github/linguist
+Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
+# Upstream does not ship the test suite in the gem.
+Source1: %{name}-generate-test-tarball.sh
+Source2: %{gem_name}-%{version}-tests.tar.xz
+Requires: ruby(release)
+Requires: ruby(rubygems)
+Requires: rubygem(charlock_holmes) => 0.6.6
+Requires: rubygem(charlock_holmes) < 0.7
+Requires: rubygem(escape_utils) >= 0.3.1
+Requires: rubygem(mime-types) => 1.19
+Requires: rubygem(mime-types) < 2
+Requires: rubygem(pygments.rb) => 0.5.4
+Requires: rubygem(pygments.rb) < 0.6
+BuildRequires: ruby(release)
+BuildRequires: rubygems-devel
+BuildRequires: rubygem(minitest)
+BuildRequires: rubygem(mocha)
+BuildRequires: rubygem(charlock_holmes) => 0.6.6
+BuildRequires: rubygem(charlock_holmes) < 0.7
+BuildRequires: rubygem(escape_utils) >= 0.3.1
+BuildRequires: rubygem(mime-types) => 1.19
+BuildRequires: rubygem(mime-types) < 2
+BuildRequires: rubygem(pygments.rb) => 0.5.4
+BuildRequires: rubygem(pygments.rb) < 0.6
+BuildArch: noarch
+Provides: rubygem(%{gem_name}) = %{version}
+
+%description
+Use this library to detect blob languages, highlight code, ignore binary
+files, suppress generated files in diffs, and generate language breakdown
+graphs.
+
+%package doc
+Summary: Documentation for %{name}
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+BuildArch: noarch
+
+%description doc
+Documentation for %{name}
+
+%prep
+gem unpack %{SOURCE0}
+
+%setup -q -D -T -n %{gem_name}-%{version} -a 2
+
+gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
+
+%build
+# Create the gem as gem install only works on a gem file
+gem build %{gem_name}.gemspec
+
+%gem_install
+
+%install
+mkdir -p %{buildroot}%{gem_dir}
+cp -pa .%{gem_dir}/* \
+ %{buildroot}%{gem_dir}/
+
+mkdir -p %{buildroot}%{_bindir}
+cp -pa .%{_bindir}/* \
+ %{buildroot}%{_bindir}/
+
+find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
+
+%check
+export LANG=en_US.UTF-8
+cp -pr test .%{gem_instdir}
+cp -pr samples .%{gem_instdir}
+pushd .%{gem_instdir}
+ ruby -Ilib test/test_*.rb
+ rm -rf test samples
+popd
+
+
+%files
+%dir %{gem_instdir}
+%{_bindir}/linguist
+%{gem_instdir}/bin
+%{gem_libdir}
+%exclude %{gem_cache}
+%{gem_spec}
+
+%files doc
+%doc %{gem_docdir}
+
+%changelog
+* Fri Dec 27 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 2.10.7-1
+- Initial package
diff --git a/sources b/sources
new file mode 100644
index 0000000..7505c4b
--- /dev/null
+++ b/sources
@@ -0,0 +1,2 @@
+78ad92c0d2bc3fff45b71f1392a39c0b github-linguist-2.10.7.gem
+51348140bc427edb56adf19777c67991 github-linguist-2.10.7-tests.tar.xz