]>
Commit | Line | Data |
---|---|---|
efa9f70b ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
db5d4040 | 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 |
ccae8d37 | 17 | Release: 3 |
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 |
55 | Summary: HTML documentation for %{pkgname} | |
9ee55acc | 56 | Summary(pl.UTF-8): Dokumentacja w formacie HTML dla pakietu %{pkgname} |
2f070126 | 57 | Group: Documentation |
58 | Requires: ruby >= 1:1.8.7-4 | |
2f38e19b ER |
59 | %if "%{_rpmversion}" >= "5" |
60 | BuildArch: noarch | |
61 | %endif | |
2f070126 | 62 | |
63 | %description rdoc | |
64 | HTML documentation for %{pkgname}. | |
65 | ||
66 | %description rdoc -l pl.UTF-8 | |
9ee55acc | 67 | Dokumentacja w formacie HTML dla pakietu %{pkgname}. |
2f070126 | 68 | |
69 | %package ri | |
70 | Summary: ri documentation for %{pkgname} | |
9ee55acc | 71 | Summary(pl.UTF-8): Dokumentacja w formacie ri dla pakietu %{pkgname} |
2f070126 | 72 | Group: Documentation |
73 | Requires: ruby | |
2f38e19b ER |
74 | %if "%{_rpmversion}" >= "5" |
75 | BuildArch: noarch | |
76 | %endif | |
2f070126 | 77 | |
78 | %description ri | |
79 | ri documentation for %{pkgname}. | |
80 | ||
81 | %description ri -l pl.UTF-8 | |
9ee55acc | 82 | Dokumentacji w formacie ri dla pakietu %{pkgname}. |
2f070126 | 83 | |
84 | %prep | |
a8e89bcb | 85 | %setup -qn %{pkgname}-%{version} |
2f070126 | 86 | |
87 | %build | |
a8e89bcb ER |
88 | # make gemspec self-contained |
89 | ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec")) | |
90 | File.open("%{pkgname}-%{version}.gemspec", "w") do |file| | |
91 | file.puts spec.to_ruby_for_cache | |
92 | end' | |
93 | ||
2f070126 | 94 | cp %{_datadir}/setup.rb . |
95 | ||
2f38e19b ER |
96 | %{__ruby} setup.rb config \ |
97 | --rbdir=%{ruby_vendorlibdir} \ | |
a8e89bcb | 98 | --mandir=%{_mandir}/man1 \ |
2f38e19b | 99 | --sodir=%{ruby_vendorarchdir} |
2f070126 | 100 | |
2f38e19b | 101 | %{__ruby} setup.rb setup |
2f070126 | 102 | |
efa9f70b ER |
103 | %if %{with tests} |
104 | %{__ruby} -r rubygems -Ilib:ext:. \ | |
105 | -e 'gem "test-unit"; Dir.glob("test/*_test.rb").sort.each {|f| require f}' | |
106 | %endif | |
107 | ||
db5d4040 | 108 | %if %{with doc} |
2f070126 | 109 | rdoc --ri --op ri lib |
110 | rdoc --op rdoc lib | |
9ee55acc JB |
111 | %{__rm} -r ri/Object |
112 | %{__rm} ri/created.rid | |
113 | %{__rm} ri/cache.ri | |
db5d4040 | 114 | %endif |
2f070126 | 115 | |
116 | %install | |
117 | rm -rf $RPM_BUILD_ROOT | |
a8e89bcb | 118 | install -d $RPM_BUILD_ROOT{%{ruby_specdir},%{ruby_ridir},%{ruby_rdocdir}} |
2f38e19b | 119 | %{__ruby} setup.rb install \ |
2f070126 | 120 | --prefix=$RPM_BUILD_ROOT |
a8e89bcb ER |
121 | cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} |
122 | ||
123 | # just does require rdiscount | |
124 | %{__rm} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/markdown.rb | |
db5d4040 | 125 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/markdown.7 |
a8e89bcb | 126 | |
db5d4040 | 127 | %if %{with doc} |
a8e89bcb ER |
128 | cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir} |
129 | cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version} | |
9ee55acc | 130 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/rdiscount.1.ronn |
db5d4040 | 131 | %endif |
2f070126 | 132 | |
133 | %clean | |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | ||
136 | %files | |
137 | %defattr(644,root,root,755) | |
9ee55acc | 138 | %doc CHANGELOG.md COPYING README.markdown |
2f38e19b ER |
139 | %{ruby_vendorlibdir}/rdiscount.rb |
140 | %attr(755,root,root) %{ruby_vendorarchdir}/rdiscount.so | |
a8e89bcb | 141 | %{ruby_specdir}/%{pkgname}-%{version}.gemspec |
2f070126 | 142 | |
143 | %files -n rdiscount | |
144 | %defattr(644,root,root,755) | |
145 | %attr(755,root,root) %{_bindir}/rdiscount | |
a8e89bcb | 146 | %{_mandir}/man1/rdiscount.1* |
2f070126 | 147 | |
db5d4040 | 148 | %if %{with doc} |
2f070126 | 149 | %files rdoc |
150 | %defattr(644,root,root,755) | |
151 | %{ruby_rdocdir}/%{name}-%{version} | |
152 | ||
153 | %files ri | |
154 | %defattr(644,root,root,755) | |
155 | %{ruby_ridir}/RDiscount | |
db5d4040 | 156 | %endif |