]> git.pld-linux.org Git - projects/template-specs.git/blame - ruby.spec
pecl: add example how to make failed tests as XFAIL
[projects/template-specs.git] / ruby.spec
CommitLineData
de91f760 1
0b08143e 2# TODO
0b08143e 3# - any policy what to package in %{ruby_ridir}?
3b2fbb03 4#
de91f760
ER
5# Conditional build:
6%bcond_without tests # build without tests
d2252ce8 7%bcond_without doc # don't build ri/rdoc
de91f760 8
7911ee90 9%define pkgname MODULE_NAME
d4eb3bf7 10Summary: -
50446ee9 11Name: ruby-%{pkgname}
d4eb3bf7
ER
12Version: -
13Release: 0.1
14License: - (enter GPL/GPL v2/GPL v3+/LGPL/MIT/Ruby License/other license name here)
316bafdd
JR
15#Source0: http://rubyforge.org/frs/download.php/18699/%{pkgname}-%{version}.tgz
16Source0: http://rubygems.org/downloads/%{pkgname}-%{version}.gem
d4eb3bf7
ER
17# Source0-md5: -
18Group: Development/Languages
19URL: http://rubyforge.org/projects/.../
f8e41d71 20BuildRequires: rpm-rubyprov
6d4ddd20
ER
21BuildRequires: rpmbuild(macros) >= 1.665
22#BuildRequires: setup.rb
23# optional locale BR, see ri/rdoc building below
24#%if %(locale -a | grep -q '^en_US$'; echo $?)
25#BuildRequires: glibc-localedb-all
26#%endif
77dfa72b
ER
27%if %{with tests}
28#BuildRequires: ruby-rspec
29%endif
d4eb3bf7
ER
30#BuildArch: noarch
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
d4eb3bf7
ER
33%description
34...
35
36%package rdoc
2bd7838d
JB
37Summary: HTML documentation for Ruby %{pkgname} module
38Summary(pl.UTF-8): Dokumentacja w formacie HTML dla modułu języka Ruby %{pkgname}
d4eb3bf7 39Group: Documentation
fd8a3aae 40Requires: ruby >= 1:1.8.7-4
d4eb3bf7
ER
41
42%description rdoc
2bd7838d 43HTML documentation for Ruby %{pkgname} module.
bc42e01e
JR
44
45%description rdoc -l pl.UTF-8
2bd7838d 46Dokumentacja w formacie HTML dla modułu języka Ruby %{pkgname}.
bc42e01e
JR
47
48%package ri
2bd7838d
JB
49Summary: ri documentation for Ruby %{pkgname} module
50Summary(pl.UTF-8): Dokumentacja w formacie ri dla modułu języka Ruby %{pkgname}
bc42e01e
JR
51Group: Documentation
52Requires: ruby
53
54%description ri
2bd7838d 55ri documentation for Ruby %{pkgname} module.
bc42e01e
JR
56
57%description ri -l pl.UTF-8
2bd7838d 58Dokumentacja w formacie ri dla modułu języka Ruby %{pkgname}.
d4eb3bf7
ER
59
60%prep
6d4ddd20 61%setup -q -n %{pkgname}-%{version}
316bafdd 62
8a3ed6d3 63%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
f8e41d71 64
fd8a3aae
ER
65# cleanup backups after patching
66find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
67
d4eb3bf7 68%build
de91f760
ER
69# write .gemspec
70%__gem_helper spec
71
76d858ef
ER
72# make gemspec self-contained
73ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec"))
74 File.open("%{pkgname}-%{version}.gemspec", "w") do |file|
75 file.puts spec.to_ruby_for_cache
76end'
77
b1e75c3c
ER
78#'
79
5f1d2bba 80# binary pkgs:
6d4ddd20 81cd ext/%{pkgname}
5f1d2bba
ER
82%{__ruby} extconf.rb
83%{__make} \
84 CC="%{__cc}" \
85 LDFLAGS="%{rpmldflags}" \
86 CFLAGS="%{rpmcflags} -fPIC"
87
8cb1efbe 88# with rdoc/ri:
6d4ddd20
ER
89# optional locale force, see BR above as well
90# UTF8 locale needed for doc generation
91#export LC_ALL=en_US.UTF-8
92
8cb1efbe
ER
93rdoc --ri --op ri lib
94rdoc --op rdoc lib
95# rm -r ri/NOT_THIS_MODULE_RELATED_DIRS
96rm ri/created.rid
97
d4eb3bf7
ER
98%install
99rm -rf $RPM_BUILD_ROOT
8a3ed6d3 100install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir}}
f8e41d71 101cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
8a3ed6d3 102cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
f8e41d71 103
8a3ed6d3 104install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir}}
f8e41d71 105cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
f8e41d71 106
8a3ed6d3
ER
107%if %{with doc}
108install -d $RPM_BUILD_ROOT{%{ruby_rdocdir}/%{name}-%{version},%{ruby_ridir}}
109cp -a rdoc/* $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
d4eb3bf7 110cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
8a3ed6d3 111%endif
f8e41d71 112
8cb1efbe
ER
113# install ext
114install -d $RPM_BUILD_ROOT%{ruby_vendorarchdir}
4b3a552a 115install -p ext/%{pkgname}/*.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
8cb1efbe 116
42f9fffd
ER
117# install examples
118install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
119cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
120
d4eb3bf7
ER
121%clean
122rm -rf $RPM_BUILD_ROOT
123
124%files
125%defattr(644,root,root,755)
126%doc CHANGELOG README
6d4ddd20
ER
127%{ruby_vendorlibdir}/%{pkgname}.rb
128%{ruby_vendorlibdir}/%{pkgname}
129%attr(755,root,root) %{ruby_vendorarchdir}/%{pkgname}_ext.so
de91f760 130%{ruby_specdir}/%{pkgname}-%{version}.gemspec
42f9fffd 131%{_examplesdir}/%{name}-%{version}
d4eb3bf7 132
d2252ce8 133%if %{with doc}
d4eb3bf7
ER
134%files rdoc
135%defattr(644,root,root,755)
fd8a3aae 136%{ruby_rdocdir}/%{name}-%{version}
bc42e01e
JR
137
138%files ri
139%defattr(644,root,root,755)
316bafdd 140%{ruby_ridir}/%{pkgname}
d2252ce8 141%endif
This page took 1.410894 seconds and 4 git commands to generate.