]> git.pld-linux.org Git - projects/template-specs.git/blame - ruby.spec
ruby: update rubygems url to be https
[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)
623ca67d 15Source0: https://rubygems.org/downloads/%{pkgname}-%{version}.gem
d4eb3bf7
ER
16# Source0-md5: -
17Group: Development/Languages
18URL: http://rubyforge.org/projects/.../
f8e41d71 19BuildRequires: rpm-rubyprov
6d4ddd20
ER
20BuildRequires: rpmbuild(macros) >= 1.665
21#BuildRequires: setup.rb
22# optional locale BR, see ri/rdoc building below
23#%if %(locale -a | grep -q '^en_US$'; echo $?)
24#BuildRequires: glibc-localedb-all
25#%endif
77dfa72b
ER
26%if %{with tests}
27#BuildRequires: ruby-rspec
28%endif
d4eb3bf7
ER
29#BuildArch: noarch
30BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
d4eb3bf7
ER
32%description
33...
34
35%package rdoc
2bd7838d
JB
36Summary: HTML documentation for Ruby %{pkgname} module
37Summary(pl.UTF-8): Dokumentacja w formacie HTML dla modułu języka Ruby %{pkgname}
d4eb3bf7 38Group: Documentation
fd8a3aae 39Requires: ruby >= 1:1.8.7-4
d4eb3bf7
ER
40
41%description rdoc
2bd7838d 42HTML documentation for Ruby %{pkgname} module.
bc42e01e
JR
43
44%description rdoc -l pl.UTF-8
2bd7838d 45Dokumentacja w formacie HTML dla modułu języka Ruby %{pkgname}.
bc42e01e
JR
46
47%package ri
2bd7838d
JB
48Summary: ri documentation for Ruby %{pkgname} module
49Summary(pl.UTF-8): Dokumentacja w formacie ri dla modułu języka Ruby %{pkgname}
bc42e01e
JR
50Group: Documentation
51Requires: ruby
52
53%description ri
2bd7838d 54ri documentation for Ruby %{pkgname} module.
bc42e01e
JR
55
56%description ri -l pl.UTF-8
2bd7838d 57Dokumentacja w formacie ri dla modułu języka Ruby %{pkgname}.
d4eb3bf7
ER
58
59%prep
6d4ddd20 60%setup -q -n %{pkgname}-%{version}
316bafdd 61
8a3ed6d3 62%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
f8e41d71 63
fd8a3aae
ER
64# cleanup backups after patching
65find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
66
d4eb3bf7 67%build
de91f760
ER
68# write .gemspec
69%__gem_helper spec
70
76d858ef
ER
71# make gemspec self-contained
72ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec"))
73 File.open("%{pkgname}-%{version}.gemspec", "w") do |file|
74 file.puts spec.to_ruby_for_cache
75end'
76
b1e75c3c
ER
77#'
78
5f1d2bba 79# binary pkgs:
6d4ddd20 80cd ext/%{pkgname}
5f1d2bba
ER
81%{__ruby} extconf.rb
82%{__make} \
83 CC="%{__cc}" \
84 LDFLAGS="%{rpmldflags}" \
85 CFLAGS="%{rpmcflags} -fPIC"
86
8cb1efbe 87# with rdoc/ri:
6d4ddd20
ER
88# optional locale force, see BR above as well
89# UTF8 locale needed for doc generation
90#export LC_ALL=en_US.UTF-8
91
8cb1efbe
ER
92rdoc --ri --op ri lib
93rdoc --op rdoc lib
94# rm -r ri/NOT_THIS_MODULE_RELATED_DIRS
95rm ri/created.rid
623ca67d 96rm ri/cache.ri
8cb1efbe 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.6076 seconds and 4 git commands to generate.