rpms/rubygem-gettext/F-9 rubygem-gettext.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Mamoru Tasaka mtasaka at fedoraproject.org
Wed Oct 8 10:39:29 UTC 2008


Author: mtasaka

Update of /cvs/extras/rpms/rubygem-gettext/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5240/F-9

Modified Files:
	.cvsignore sources 
Added Files:
	rubygem-gettext.spec 
Log Message:
Initial import of rubygem-gettext


--- NEW FILE rubygem-gettext.spec ---
%{!?ruby_sitelib:	%define ruby_sitelib	%(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}

%define		gemdir		%(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%define		gemname		gettext
%define		geminstdir	%{gemdir}/gems/%{gemname}-%{version}

%define		rubyabi		1.8

Name:		rubygem-%{gemname}
Version:	1.93.0
Release:	6%{?dist}
Summary:	RubyGem of Localization Library and Tools for Ruby
Group:		Development/Languages

License:	Ruby
URL:		http://www.yotabanana.com/hiki/ruby-gettext.html?ruby-gettext
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)
BuildRequires:  rubygem(rake)
Requires:	ruby(abi) = %{rubyabi}
Requires:	ruby(rubygems)
Requires:	irb
Provides:	rubygem(%{gemname}) = %{version}-%{release}

BuildArch:	noarch

%description
Ruby-GetText-Package is a GNU GetText-like program for Ruby. 
The catalog file(po-file) is same format with GNU GetText. 
So you can use GNU GetText tools for maintaining.

This package provides gem for Ruby-Gettext-Package.

%package	doc
Summary:	Documentation for %{name}
Group:		Documentation
# Directory ownership issue
Requires:	ruby(rubygems)

%description	doc
This package contains documentation for %{name}.


%package -n	ruby-gettext-package
Summary:	Localization Library and Tools for Ruby
Group:		Development/Languages
Requires:	%{name} = %{version}-%{release}
Provides:	ruby(gettext-package) = %{version}-%{release}

%description -n	ruby-gettext-package
Ruby-GetText-Package is a Localization(L10n) Library and Tools 
which is modeled after GNU gettext package.

The library converts the messages to localized messages properly 
using client-side locale information. And the tools for developers 
support to create, use, and modify localized message files
(message catalogs) easily.

%prep 
%setup -q -T -c

# Unpack source to recreate stripped gem file
%{__mkdir} Repackage
pushd Repackage

tar xf %{SOURCE0}
%{__mkdir} DATA
cd DATA/
tar xzf ../data.tar.gz
popd

# ... and unpack source again for documentation
tar xf %{SOURCE0}

%{__mkdir} DATA
cd DATA/
tar xzf ../data.tar.gz
find \
	samples/ \
	test/ \
	-type f | xargs %{__chmod} 0644
cd ..

# fix timestamps
find . -type f -print0 | xargs -0 touch -r %{SOURCE0}

%build
TOPDIR=$(pwd)

# Recreate gem with unneeded files stripped
pushd Repackage/DATA/

## Recreate gettext .mo file
find data/locale/ -name \*.mo -print0 | xargs -0 %{__rm} -f
ruby post-setup.rb

# Cleanups for rpmlint
find lib -name \*.rb | while read f
	do
	%{__sed} -i -e '/^#!/d' $f
done

## Strip out unneeded files and create gem
%{__rm} -rf \
	*setup.rb \
	doc/ \
	samples/ \
	test/ \
	po/

rake gem
%{__mv} pkg/*gem ${TOPDIR}/

popd

%install
%{__rm} -rf %{buildroot}
%{__mkdir_p} %{buildroot}%{gemdir}

gem install \
	--local \
	--install-dir %{buildroot}%{gemdir}/ \
	--force \
	--rdoc \
	*.gem

# Cleanups..
%{__chmod} 0755 %{buildroot}%{geminstdir}/bin/*
%{__rm} -rf %{buildroot}%{gemdir}/bin/
%{__chmod} 0644 %{buildroot}%{gemdir}/cache/*.gem

# Create symlinks
##
## Note that before switching to gem %%{ruby_sitelib}/%%{gemname}
## already existed as a directory, so this cannot be replaced
## by symlink (cpio fails)
## Similarly, all directories under %%{ruby_sitelib} cannot be
## replaced by symlink
#

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}
create_symlink_rec %{geminstdir}/bin %{_bindir}
create_symlink_rec %{geminstdir}/data/locale %{_datadir}/locale

%find_lang rails
%find_lang rgettext
%{__cat} *.lang >> %{name}.lang

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_bindir}/rgettext
%{_bindir}/rmsgfmt
%{_bindir}/rmsgmerge

%{geminstdir}/
%{gemdir}/cache/%{gemname}-%{version}.gem
%{gemdir}/specifications/%{gemname}-%{version}.gemspec

%files		doc
%defattr(-,root,root,-)
%doc	DATA/samples/
%doc	DATA/test/
%{gemdir}/doc/%{gemname}-%{version}/

%files -n	ruby-gettext-package	-f %{name}.lang
%defattr(-,root,root,-)
%{ruby_sitelib}/%{gemname}.rb
%{ruby_sitelib}/%{gemname}/
%{ruby_sitelib}/locale.rb
%{ruby_sitelib}/locale/


%changelog
* Tue Oct  7 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.93.0-6
- Move sed edit section for lib/ files from %%install to %%build
  stage for cached gem file

* Tue Oct  7 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.93.0-5
- Recreate gettext .mo files (by using this itself)

* Mon Oct  6 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.93.0-3
- Some modification for spec file by Scott

* Tue Sep 23 2008 Scott Seago <sseago at redhat.com> - 1.93.0-2
- Initial package (of rubygem-gettext)
  Set at release 2 to supercede ruby-gettext-package-1.93.0-1

* Thu Sep 18 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.93.0-1
- 1.93.0

* Sat Aug  9 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.92.0-1
- 1.92.0

* Thu May 22 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.91.0-1
- 1.91.0

* Sun Feb  3 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.90.0-1
- 1.90.0
- Arch changed to noarch

* Wed Aug 29 2007 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.10.0-1
- 1.10.0

* Wed Aug 22 2007 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.9.0-2.dist.2
- Mass rebuild (buildID or binutils issue)

* Fri Aug  3 2007 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.9.0-2.dist.1
- License update

* Mon May  7 2007 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.9.0-2
- Create -doc subpackage

* Sat Apr 21 2007 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.9.0-1
- Initial packaging


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/rubygem-gettext/F-9/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	8 Oct 2008 09:23:35 -0000	1.1
+++ .cvsignore	8 Oct 2008 10:38:59 -0000	1.2
@@ -0,0 +1 @@
+gettext-1.93.0.gem


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/rubygem-gettext/F-9/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	8 Oct 2008 09:23:35 -0000	1.1
+++ sources	8 Oct 2008 10:38:59 -0000	1.2
@@ -0,0 +1 @@
+bda59913062bad008ff92b61506a148d  gettext-1.93.0.gem




More information about the fedora-extras-commits mailing list