Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1336bc19d5 | ||
|
|
425a466108 | ||
|
|
c52dc57a76 | ||
|
|
5f8b2d53ea |
5 changed files with 206 additions and 21 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
json-1.1.7.gem
|
||||
21
Makefile
21
Makefile
|
|
@ -1,21 +0,0 @@
|
|||
# Makefile for source rpm: rubygem-json
|
||||
# $Id$
|
||||
NAME := rubygem-json
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attept a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
||||
204
rubygem-json.spec
Normal file
204
rubygem-json.spec
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
%{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
|
||||
%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
|
||||
|
||||
%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
|
||||
%global gemname json
|
||||
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
|
||||
%global installroot %{buildroot}%{geminstdir}
|
||||
|
||||
|
||||
Name: rubygem-%{gemname}
|
||||
Version: 1.1.7
|
||||
Release: 3%{?dist}
|
||||
Summary: A JSON implementation in Ruby
|
||||
|
||||
Group: Development/Languages
|
||||
|
||||
License: Ruby or GPLv2
|
||||
URL: http://json.rubyforge.org
|
||||
Source0: http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildRequires: ruby, ruby-devel
|
||||
BuildRequires: rubygem(rake)
|
||||
Requires: ruby(abi) = 1.8
|
||||
Requires: ruby(gtk2), rubygems
|
||||
Provides: rubygem(json) = %{version}
|
||||
|
||||
%description
|
||||
This is a implementation of the JSON specification according
|
||||
to RFC 4627 in Ruby.
|
||||
You can think of it as a low fat alternative to XML,
|
||||
if you want to store data to disk or transmit it over
|
||||
a network rather than use a verbose markup language.
|
||||
|
||||
%package doc
|
||||
Summary: Documentation for %{name}
|
||||
Group: Documentation
|
||||
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: ruby(rubygems)
|
||||
|
||||
%description doc
|
||||
This package contains documentation for %{name}.
|
||||
|
||||
%package -n ruby-%{gemname}
|
||||
Summary: Non-Gem support package for %{gemname}
|
||||
Group: Development/Languages
|
||||
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Provides: ruby(%{gemname}) = %{version}-%{release}
|
||||
|
||||
%description -n ruby-%{gemname}
|
||||
This package provides non-Gem support for %{gemname}.
|
||||
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -c -T
|
||||
|
||||
mkdir -p ./%{gemdir}
|
||||
|
||||
%build
|
||||
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
|
||||
#pushd ./%{gemdir}
|
||||
gem install --local --install-dir .%{gemdir} -V --force %{SOURCE0}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT%{gemdir}
|
||||
mkdir -p $RPM_BUILD_ROOT%{_bindir}
|
||||
mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}/%{gemname}/ext
|
||||
|
||||
cp -a .%{gemdir}/* %{buildroot}/%{gemdir}
|
||||
|
||||
# Let's move arch dependent files to %%ruby_sitearch
|
||||
mv .%{geminstdir}/ext/json/ext/*.so \
|
||||
$RPM_BUILD_ROOT%{ruby_sitearch}/%{gemname}/ext
|
||||
|
||||
mv $RPM_BUILD_ROOT%{gemdir}/bin/* $RPM_BUILD_ROOT%{_bindir}
|
||||
|
||||
chmod 0755 $RPM_BUILD_ROOT%{geminstdir}/install.rb
|
||||
chmod 0755 $RPM_BUILD_ROOT%{geminstdir}/bin/*.rb
|
||||
chmod 0755 $RPM_BUILD_ROOT%{geminstdir}/tests/*.rb
|
||||
chmod 0755 $RPM_BUILD_ROOT%{geminstdir}/tools/server.rb
|
||||
chmod 0644 $RPM_BUILD_ROOT%{geminstdir}/tools/fuzz.rb
|
||||
chmod 0755 $RPM_BUILD_ROOT%{geminstdir}/benchmarks/*.rb
|
||||
|
||||
# We don't need those files anymore.
|
||||
rm -rf $RPM_BUILD_ROOT%{geminstdir}/ext
|
||||
rm -rf $RPM_BUILD_ROOT%{geminstdir}/install.rb
|
||||
rm -rf $RPM_BUILD_ROOT%{geminstdir}/.require_paths
|
||||
rm -rf $RPM_BUILD_ROOT%{gemdir}/doc/%{gemname}-%{version}/rdoc/classes/.src
|
||||
rm -rf $RPM_BUILD_ROOT%{gemdir}/doc/%{gemname}-%{version}/rdoc/classes/.html
|
||||
|
||||
create_symlink_rec(){
|
||||
|
||||
ORIGBASEDIR=$1
|
||||
TARGETBASEDIR=$2
|
||||
|
||||
## First calculate relative path of ORIGBASEDIR
|
||||
## from TARGETBASEDIR
|
||||
TMPDIR=$TARGETBASEDIR
|
||||
BACKDIR=
|
||||
DOWNDIR=
|
||||
num=0
|
||||
nnum=0
|
||||
while true
|
||||
do
|
||||
num=$((num+1))
|
||||
TMPDIR=$(echo $TMPDIR | %{__sed} -e 's|/[^/][^/]*$||')
|
||||
DOWNDIR=$(echo $ORIGBASEDIR | %{__sed} -e "s|^$TMPDIR||")
|
||||
if [ x$DOWNDIR != x$ORIGBASEDIR ]
|
||||
then
|
||||
nnum=0
|
||||
while [ $nnum -lt $num ]
|
||||
do
|
||||
BACKDIR="../$BACKDIR"
|
||||
nnum=$((nnum+1))
|
||||
done
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
RELBASEDIR=$( echo $BACKDIR/$DOWNDIR | %{__sed} -e 's|//*|/|g' )
|
||||
|
||||
## Next actually create symlink
|
||||
pushd %{buildroot}/$ORIGBASEDIR
|
||||
find . -type f | while read f
|
||||
do
|
||||
DIRNAME=$(dirname $f)
|
||||
BACK2DIR=$(echo $DIRNAME | %{__sed} -e 's|/[^/][^/]*|/..|g')
|
||||
%{__mkdir_p} %{buildroot}${TARGETBASEDIR}/$DIRNAME
|
||||
LNNAME=$(echo $BACK2DIR/$RELBASEDIR/$f | \
|
||||
%{__sed} -e 's|^\./||' | %{__sed} -e 's|//|/|g' | \
|
||||
%{__sed} -e 's|/\./|/|' )
|
||||
%{__ln_s} -f $LNNAME %{buildroot}${TARGETBASEDIR}/$f
|
||||
done
|
||||
popd
|
||||
|
||||
}
|
||||
|
||||
create_symlink_rec %{geminstdir}/lib %{ruby_sitelib}
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%check
|
||||
pushd .%{geminstdir}
|
||||
rake test --trace
|
||||
popd
|
||||
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc %{geminstdir}/[A-Z]*
|
||||
%dir %{geminstdir}
|
||||
%{_bindir}/*.rb
|
||||
%{geminstdir}/bin
|
||||
%{geminstdir}/lib
|
||||
%{geminstdir}/tools
|
||||
%{ruby_sitearch}/%{gemname}
|
||||
%{gemdir}/cache/%{gemname}-%{version}.gem
|
||||
%{gemdir}/specifications/%{gemname}-%{version}.gemspec
|
||||
|
||||
%files doc
|
||||
%defattr(-,root,root,-)
|
||||
%{geminstdir}/Rakefile
|
||||
%{geminstdir}/data
|
||||
%{geminstdir}/tests
|
||||
%{geminstdir}/benchmarks
|
||||
%{geminstdir}/doc-templates
|
||||
%{gemdir}/doc/%{gemname}-%{version}
|
||||
|
||||
%files -n ruby-%{gemname}
|
||||
%defattr(-,root,root,-)
|
||||
%{ruby_sitelib}/%{gemname}
|
||||
%{ruby_sitelib}/%{gemname}.rb
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Aug 12 2009 Xavier Lamien <laxathom@fedoraproject.org> - 1.1.7-3
|
||||
- Fix gem scripts and install_dir.
|
||||
- Enable %%check stage.
|
||||
|
||||
* Wed Aug 05 2009 Xavier Lamien <laxathom@fedoraproject.org> - 1.1.7-2
|
||||
- Rebuild in correct buildir process.
|
||||
- Add sub packages.
|
||||
|
||||
* Mon Aug 03 2009 Xavier Lamien <laxathom@fedoraproject.org> - 1.1.7-1
|
||||
- Update release.
|
||||
|
||||
* Sat Jun 06 2009 Xavier Lamien <laxathom@fedoraproject.org> - 1.1.6-1
|
||||
- Update release.
|
||||
|
||||
* Tue May 12 2009 Xavier Lamien <laxathom@fedoraproject.org> - 1.1.5-1
|
||||
- Update release.
|
||||
|
||||
* Thu Apr 02 2009 Xavier Lamien <laxathom@fedoraproject.org> - 1.1.4-1
|
||||
- Update release.
|
||||
|
||||
* Sat Jul 12 2008 Xavier Lamien <laxathom@fedoraproject.org> - 1.1.3-1
|
||||
- Initial RPM release.
|
||||
1
sources
1
sources
|
|
@ -0,0 +1 @@
|
|||
f8e760e37e1b6230de7ef7bd828e79c4 json-1.1.7.gem
|
||||
Loading…
Add table
Add a link
Reference in a new issue