diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index e69de29..0000000 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fb109f6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +htmlentities-4.2.0.gem diff --git a/Makefile b/Makefile deleted file mode 100644 index e29c289..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: rubygem-htmlentities -# $Id$ -NAME := rubygem-htmlentities -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) diff --git a/rubygem-htmlentities.spec b/rubygem-htmlentities.spec new file mode 100644 index 0000000..4459bf5 --- /dev/null +++ b/rubygem-htmlentities.spec @@ -0,0 +1,157 @@ +# Generated from htmlentities-4.0.0.gem by gem2rpm -*- rpm-spec -*- +%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']") + +%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) +%global gemname htmlentities +%global geminstdir %{gemdir}/gems/%{gemname}-%{version} + +%global rubyabi 1.8 + +Summary: A module for encoding and decoding (X)HTML entities +Name: rubygem-%{gemname} +Version: 4.2.0 +Release: 1%{?dist} +Group: Development/Languages +License: MIT +URL: http://htmlentities.rubyforge.org/ +Source0: http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: ruby(abi) = %{rubyabi} +BuildRequires: ruby(rubygems) +Requires: ruby(abi) = %{rubyabi} +Requires: ruby(rubygems) +BuildArch: noarch +Provides: rubygem(%{gemname}) = %{version}-%{release} + +%description +HTMLEntities is a simple library to facilitate encoding and +decoding of named (ý and so on) or numerical ({ or Ī) +entities in HTML and XHTML documents. + +%package -n ruby-%{gemname} +Summary: Non-Gem support 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 +# First install rubygems under %%_builddir to execute some +# tests +%setup -q -c -T + +mkdir -p ./%{geminstdir} +gem install \ + -V \ + --local --install-dir ./%{gemdir} \ + --force \ + --rdoc \ + %{SOURCE0} + +%build + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{gemdir} +cp -a ./%{gemdir}/* %{buildroot}%{gemdir}/ + +# Cleanups +rm -f %{buildroot}%{geminstdir}/setup.rb + +# Create symlinks for ruby-%%{gemname} +# Copied from rubygem-gettext.spec + +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} + + +%check +pushd ./%{geminstdir}/test/ +ruby test_all.rb + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%doc %{gemdir}/doc/%{gemname}-%{version}/ + +%dir %{geminstdir} +%doc %{geminstdir}/[A-Z]* +%{geminstdir}/lib/ +%doc %{geminstdir}/perf/ +%doc %{geminstdir}/test/ + +%{gemdir}/cache/%{gemname}-%{version}.gem +%{gemdir}/specifications/%{gemname}-%{version}.gemspec + +%files -n ruby-%{gemname} +%defattr(-,root,root,-) +%{ruby_sitelib}/%{gemname}.rb +%{ruby_sitelib}/%{gemname}/ + + +%changelog +* Thu Aug 27 2009 Mamoru Tasaka - 4.2.0-1 +- 4.2.0 + +* Fri Aug 21 2009 Mamoru Tasaka - 4.1.0-1 +- 4.1.0 + +* Sat Jul 25 2009 Mamoru Tasaka - 4.0.0-3 +- F-12: Mass rebuild + +* Fri Mar 6 2009 Mamoru Tasaka +- Cleanups + +* Tue Mar 03 2009 Mamoru Tasaka - 4.0.0-1 +- Initial package diff --git a/sources b/sources index e69de29..73ca85b 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +ad78c92451862e54fa608539d7c1bccd htmlentities-4.2.0.gem