You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
3.1 KiB
129 lines
3.1 KiB
13 years ago
|
%global gem_name redcarpet
|
||
|
%global rubyabi 1.9.1
|
||
|
%global gem_extinstdir %{gem_extdir}/lib
|
||
|
|
||
|
%if 0%{?el6}
|
||
|
%global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
|
||
|
%global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem
|
||
|
%global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}
|
||
|
%global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}
|
||
|
%global gem_libdir %{gem_instdir}/lib
|
||
|
%global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec
|
||
|
%endif
|
||
|
|
||
|
%if 0%{?el6}%{?fc16}
|
||
|
%global rubyabi 1.8
|
||
|
%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')}
|
||
|
%global gem_extinstdir %{ruby_sitearch}
|
||
|
%endif
|
||
|
|
||
|
|
||
|
Summary: A fast, safe and extensible Markdown to (X)HTML parser
|
||
|
Name: rubygem-%{gem_name}
|
||
|
Version: 2.1.1
|
||
|
Release: 1%{?dist}
|
||
|
Group: Development/Languages
|
||
|
License: ISC
|
||
|
URL: http://github.com/tanoku/redcarpet
|
||
|
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
|
||
|
Patch0: remove_rake_extension.patch
|
||
|
Requires: ruby(abi) = %{rubyabi}
|
||
|
|
||
|
%if 0%{?el6}
|
||
|
BuildRequires: rubygems
|
||
|
%else
|
||
|
BuildRequires: rubygems-devel
|
||
|
%endif
|
||
|
|
||
|
BuildRequires: ruby-devel
|
||
|
BuildRequires: rubygem(minitest)
|
||
|
BuildRequires: rubygem(rake)
|
||
|
BuildRequires: rubygem(nokogiri)
|
||
|
|
||
|
Provides: rubygem(%{gem_name}) = %{version}
|
||
|
|
||
|
|
||
|
|
||
|
%description
|
||
|
A fast, safe and extensible Markdown to (X)HTML parser
|
||
|
|
||
|
|
||
|
%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}
|
||
|
%patch0 -p1
|
||
|
|
||
|
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
|
||
|
|
||
|
%build
|
||
|
mkdir -p .%{gem_dir}
|
||
|
gem build %{gem_name}.gemspec
|
||
|
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
|
||
|
|
||
|
# gem install compiles any C extensions and installs into a directory
|
||
|
# We set that to be a local directory so that we can move it into the
|
||
|
# buildroot in the install section
|
||
|
gem install -V \
|
||
|
--local \
|
||
|
--install-dir ./%{gem_dir} \
|
||
|
--bindir ./%{_bindir} \
|
||
|
--force \
|
||
|
--rdoc \
|
||
|
%{gem_name}-%{version}.gem
|
||
|
|
||
|
# Fix permissions
|
||
|
chmod 644 ./%{gem_dir}/gems/%{gem_name}-%{version}/COPYING
|
||
|
chmod 644 ./%{gem_dir}/gems/%{gem_name}-%{version}/ext/redcarpet/*
|
||
|
|
||
|
%install
|
||
|
mkdir -p %{buildroot}%{gem_dir}
|
||
|
cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
|
||
|
|
||
|
mkdir -p %{buildroot}%{_bindir}
|
||
|
cp -a ./%{_bindir}/* %{buildroot}%{_bindir}
|
||
|
chmod 755 %{buildroot}%{_bindir}/redcarpet
|
||
|
|
||
|
mkdir -p %{buildroot}%{gem_extinstdir}
|
||
|
mv %{buildroot}%{gem_instdir}/lib/redcarpet.so %{buildroot}%{gem_extinstdir}
|
||
|
|
||
|
# Clean up ext artifacts
|
||
|
rm %{buildroot}%{gem_instdir}/ext/redcarpet/*.o
|
||
|
rm %{buildroot}%{gem_instdir}/ext/redcarpet/*.so
|
||
|
|
||
|
%check
|
||
|
pushd .%{gem_instdir}
|
||
|
rake test:unit
|
||
|
popd
|
||
|
|
||
|
%files
|
||
|
%dir %{gem_instdir}
|
||
|
%{_bindir}/redcarpet
|
||
|
%{gem_instdir}/bin
|
||
|
%{gem_instdir}/ext
|
||
|
%{gem_libdir}
|
||
|
%{gem_extinstdir}
|
||
|
%{gem_cache}
|
||
|
%{gem_spec}
|
||
|
%doc %{gem_instdir}/COPYING
|
||
|
%doc %{gem_instdir}/README.markdown
|
||
|
|
||
|
%files doc
|
||
|
%{gem_instdir}/Rakefile
|
||
|
%{gem_instdir}/test
|
||
|
%{gem_instdir}/%{gem_name}.gemspec
|
||
|
%doc %{gem_docdir}
|
||
|
|
||
|
|
||
|
%changelog
|
||
|
* Thu Apr 26 2012 Matt Hicks <mhicks@redhat.com> - 2.1.1-1
|
||
|
- Initial package
|