]>
Commit | Line | Data |
---|---|---|
efa9f70b ER |
1 | # |
2 | # Conditional build: | |
e39f4006 JB |
3 | %bcond_without tests # build without tests |
4 | %bcond_without doc # don't build ri/rdoc | |
efa9f70b | 5 | |
2f070126 | 6 | # TODO |
db5d4040 | 7 | # - system libmarkdown (from discount.spec) >= 2.2.0 |
2f070126 | 8 | # - rake doc |
9 | # (in /home/users/z/rpm/BUILD/ruby-discount-1.2.7) hanna --charset utf8 --fmt html --inline-source --line-numbers --main RDiscount --op doc --title 'RDiscount API Documentation' lib/rdiscount.rb lib/markdown.rb sh: hanna: not found | |
10 | # rake aborted! | |
efa9f70b | 11 | |
2f070126 | 12 | %define pkgname rdiscount |
13 | Summary: Discount Markdown Processor for Ruby | |
9ee55acc | 14 | Summary(pl.UTF-8): Discount (procesor języka Markdown) dla języka Ruby |
a8e89bcb | 15 | Name: ruby-%{pkgname} |
db5d4040 | 16 | Version: 2.2.0.1 |
63081e8c | 17 | Release: 4 |
a8e89bcb ER |
18 | License: BSD |
19 | Source0: https://github.com/davidfstr/rdiscount/archive/%{version}/%{pkgname}-%{version}.tar.gz | |
db5d4040 | 20 | # Source0-md5: 11b5061786a57da45052e8d02ef77c5a |
2f070126 | 21 | Group: Development/Languages |
a8e89bcb | 22 | URL: https://github.com/davidfstr/rdiscount |
d87af65b ER |
23 | BuildRequires: rpm-rubyprov |
24 | BuildRequires: rpmbuild(macros) >= 1.665 | |
a83c7ea4 | 25 | BuildRequires: ruby >= 1:1.9 |
0336db61 | 26 | BuildRequires: ruby-devel |
2f070126 | 27 | BuildRequires: ruby-modules |
04d28e58 | 28 | BuildRequires: setup.rb >= 3.4.1-6 |
24895c5a ER |
29 | %if %{with tests} |
30 | BuildRequires: ruby-test-unit | |
31 | %endif | |
2f070126 | 32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
33 | ||
34 | %description | |
9ee55acc JB |
35 | Discount is a Markdown language Processor. This package contains |
36 | Discount for Ruby. | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | Discount to procesor języka znaczników Markdown. Ten pakiet zawiera | |
40 | procesor Discount dla języka Ruby. | |
2f070126 | 41 | |
42 | %package -n rdiscount | |
43 | Summary: Markdown processor | |
9ee55acc | 44 | Summary(pl.UTF-8): Procesor języka znaczników Markdown |
2f070126 | 45 | Group: Applications/Publishing |
46 | Requires: %{name} = %{version}-%{release} | |
47 | ||
2f38e19b | 48 | %description -n rdiscount |
2f070126 | 49 | Markdown processor. |
50 | ||
9ee55acc JB |
51 | %description -n rdiscount -l pl.UTF-8 |
52 | Procesor języka znaczników Markdown. | |
53 | ||
2f070126 | 54 | %package rdoc |
e39f4006 JB |
55 | Summary: HTML documentation for Ruby %{pkgname} module |
56 | Summary(pl.UTF-8): Dokumentacja w formacie HTML dla modułu %{pkgname} języka Ruby | |
2f070126 | 57 | Group: Documentation |
58 | Requires: ruby >= 1:1.8.7-4 | |
2f38e19b | 59 | BuildArch: noarch |
2f070126 | 60 | |
61 | %description rdoc | |
e39f4006 | 62 | HTML documentation for Ruby %{pkgname} module. |
2f070126 | 63 | |
64 | %description rdoc -l pl.UTF-8 | |
e39f4006 | 65 | Dokumentacja w formacie HTML dla modułu %{pkgname} języka Ruby. |
2f070126 | 66 | |
67 | %package ri | |
e39f4006 JB |
68 | Summary: ri documentation for Ruby %{pkgname} module |
69 | Summary(pl.UTF-8): Dokumentacja w formacie ri dla modułu %{pkgname} języka Ruby | |
2f070126 | 70 | Group: Documentation |
71 | Requires: ruby | |
2f38e19b | 72 | BuildArch: noarch |
2f070126 | 73 | |
74 | %description ri | |
e39f4006 | 75 | ri documentation for Ruby %{pkgname} module. |
2f070126 | 76 | |
77 | %description ri -l pl.UTF-8 | |
e39f4006 | 78 | Dokumentacji w formacie ri dla modułu %{pkgname} języka Ruby. |
2f070126 | 79 | |
80 | %prep | |
a8e89bcb | 81 | %setup -qn %{pkgname}-%{version} |
2f070126 | 82 | |
83 | %build | |
a8e89bcb ER |
84 | # make gemspec self-contained |
85 | ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec")) | |
86 | File.open("%{pkgname}-%{version}.gemspec", "w") do |file| | |
87 | file.puts spec.to_ruby_for_cache | |
88 | end' | |
89 | ||
2f070126 | 90 | cp %{_datadir}/setup.rb . |
91 | ||
2f38e19b ER |
92 | %{__ruby} setup.rb config \ |
93 | --rbdir=%{ruby_vendorlibdir} \ | |
a8e89bcb | 94 | --mandir=%{_mandir}/man1 \ |
2f38e19b | 95 | --sodir=%{ruby_vendorarchdir} |
2f070126 | 96 | |
2f38e19b | 97 | %{__ruby} setup.rb setup |
2f070126 | 98 | |
efa9f70b ER |
99 | %if %{with tests} |
100 | %{__ruby} -r rubygems -Ilib:ext:. \ | |
101 | -e 'gem "test-unit"; Dir.glob("test/*_test.rb").sort.each {|f| require f}' | |
102 | %endif | |
103 | ||
db5d4040 | 104 | %if %{with doc} |
2f070126 | 105 | rdoc --ri --op ri lib |
106 | rdoc --op rdoc lib | |
9ee55acc JB |
107 | %{__rm} -r ri/Object |
108 | %{__rm} ri/created.rid | |
109 | %{__rm} ri/cache.ri | |
db5d4040 | 110 | %endif |
2f070126 | 111 | |
112 | %install | |
113 | rm -rf $RPM_BUILD_ROOT | |
a8e89bcb | 114 | install -d $RPM_BUILD_ROOT{%{ruby_specdir},%{ruby_ridir},%{ruby_rdocdir}} |
e39f4006 | 115 | |
2f38e19b | 116 | %{__ruby} setup.rb install \ |
e39f4006 JB |
117 | --prefix=$RPM_BUILD_ROOT |
118 | ||
a8e89bcb ER |
119 | cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} |
120 | ||
121 | # just does require rdiscount | |
122 | %{__rm} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/markdown.rb | |
db5d4040 | 123 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/markdown.7 |
a8e89bcb | 124 | |
db5d4040 | 125 | %if %{with doc} |
a8e89bcb ER |
126 | cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir} |
127 | cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version} | |
9ee55acc | 128 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/rdiscount.1.ronn |
db5d4040 | 129 | %endif |
2f070126 | 130 | |
131 | %clean | |
132 | rm -rf $RPM_BUILD_ROOT | |
133 | ||
134 | %files | |
135 | %defattr(644,root,root,755) | |
9ee55acc | 136 | %doc CHANGELOG.md COPYING README.markdown |
2f38e19b ER |
137 | %{ruby_vendorlibdir}/rdiscount.rb |
138 | %attr(755,root,root) %{ruby_vendorarchdir}/rdiscount.so | |
a8e89bcb | 139 | %{ruby_specdir}/%{pkgname}-%{version}.gemspec |
2f070126 | 140 | |
141 | %files -n rdiscount | |
142 | %defattr(644,root,root,755) | |
143 | %attr(755,root,root) %{_bindir}/rdiscount | |
a8e89bcb | 144 | %{_mandir}/man1/rdiscount.1* |
2f070126 | 145 | |
db5d4040 | 146 | %if %{with doc} |
2f070126 | 147 | %files rdoc |
148 | %defattr(644,root,root,755) | |
149 | %{ruby_rdocdir}/%{name}-%{version} | |
150 | ||
151 | %files ri | |
152 | %defattr(644,root,root,755) | |
153 | %{ruby_ridir}/RDiscount | |
db5d4040 | 154 | %endif |