]>
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 ER |
16 | Version: 2.2.0.1 |
17 | Release: 1 | |
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 |
f4fb3598 | 23 | BuildRequires: gmp-devel |
d87af65b ER |
24 | BuildRequires: rpm-rubyprov |
25 | BuildRequires: rpmbuild(macros) >= 1.665 | |
a83c7ea4 | 26 | BuildRequires: ruby >= 1:1.9 |
0336db61 | 27 | BuildRequires: ruby-devel |
2f070126 | 28 | BuildRequires: ruby-modules |
04d28e58 | 29 | BuildRequires: setup.rb >= 3.4.1-6 |
24895c5a ER |
30 | %if %{with tests} |
31 | BuildRequires: ruby-test-unit | |
32 | %endif | |
2f070126 | 33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
34 | ||
35 | %description | |
9ee55acc JB |
36 | Discount is a Markdown language Processor. This package contains |
37 | Discount for Ruby. | |
38 | ||
39 | %description -l pl.UTF-8 | |
40 | Discount to procesor języka znaczników Markdown. Ten pakiet zawiera | |
41 | procesor Discount dla języka Ruby. | |
2f070126 | 42 | |
43 | %package -n rdiscount | |
44 | Summary: Markdown processor | |
9ee55acc | 45 | Summary(pl.UTF-8): Procesor języka znaczników Markdown |
2f070126 | 46 | Group: Applications/Publishing |
47 | Requires: %{name} = %{version}-%{release} | |
48 | ||
2f38e19b | 49 | %description -n rdiscount |
2f070126 | 50 | Markdown processor. |
51 | ||
9ee55acc JB |
52 | %description -n rdiscount -l pl.UTF-8 |
53 | Procesor języka znaczników Markdown. | |
54 | ||
2f070126 | 55 | %package rdoc |
56 | Summary: HTML documentation for %{pkgname} | |
9ee55acc | 57 | Summary(pl.UTF-8): Dokumentacja w formacie HTML dla pakietu %{pkgname} |
2f070126 | 58 | Group: Documentation |
59 | Requires: ruby >= 1:1.8.7-4 | |
2f38e19b ER |
60 | %if "%{_rpmversion}" >= "5" |
61 | BuildArch: noarch | |
62 | %endif | |
2f070126 | 63 | |
64 | %description rdoc | |
65 | HTML documentation for %{pkgname}. | |
66 | ||
67 | %description rdoc -l pl.UTF-8 | |
9ee55acc | 68 | Dokumentacja w formacie HTML dla pakietu %{pkgname}. |
2f070126 | 69 | |
70 | %package ri | |
71 | Summary: ri documentation for %{pkgname} | |
9ee55acc | 72 | Summary(pl.UTF-8): Dokumentacja w formacie ri dla pakietu %{pkgname} |
2f070126 | 73 | Group: Documentation |
74 | Requires: ruby | |
2f38e19b ER |
75 | %if "%{_rpmversion}" >= "5" |
76 | BuildArch: noarch | |
77 | %endif | |
2f070126 | 78 | |
79 | %description ri | |
80 | ri documentation for %{pkgname}. | |
81 | ||
82 | %description ri -l pl.UTF-8 | |
9ee55acc | 83 | Dokumentacji w formacie ri dla pakietu %{pkgname}. |
2f070126 | 84 | |
85 | %prep | |
a8e89bcb | 86 | %setup -qn %{pkgname}-%{version} |
2f070126 | 87 | |
88 | %build | |
a8e89bcb ER |
89 | # make gemspec self-contained |
90 | ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec")) | |
91 | File.open("%{pkgname}-%{version}.gemspec", "w") do |file| | |
92 | file.puts spec.to_ruby_for_cache | |
93 | end' | |
94 | ||
2f070126 | 95 | cp %{_datadir}/setup.rb . |
96 | ||
2f38e19b ER |
97 | %{__ruby} setup.rb config \ |
98 | --rbdir=%{ruby_vendorlibdir} \ | |
a8e89bcb | 99 | --mandir=%{_mandir}/man1 \ |
2f38e19b | 100 | --sodir=%{ruby_vendorarchdir} |
2f070126 | 101 | |
2f38e19b | 102 | %{__ruby} setup.rb setup |
2f070126 | 103 | |
efa9f70b ER |
104 | %if %{with tests} |
105 | %{__ruby} -r rubygems -Ilib:ext:. \ | |
106 | -e 'gem "test-unit"; Dir.glob("test/*_test.rb").sort.each {|f| require f}' | |
107 | %endif | |
108 | ||
db5d4040 | 109 | %if %{with doc} |
2f070126 | 110 | rdoc --ri --op ri lib |
111 | rdoc --op rdoc lib | |
9ee55acc JB |
112 | %{__rm} -r ri/Object |
113 | %{__rm} ri/created.rid | |
114 | %{__rm} ri/cache.ri | |
db5d4040 | 115 | %endif |
2f070126 | 116 | |
117 | %install | |
118 | rm -rf $RPM_BUILD_ROOT | |
a8e89bcb | 119 | install -d $RPM_BUILD_ROOT{%{ruby_specdir},%{ruby_ridir},%{ruby_rdocdir}} |
2f38e19b | 120 | %{__ruby} setup.rb install \ |
2f070126 | 121 | --prefix=$RPM_BUILD_ROOT |
a8e89bcb ER |
122 | cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} |
123 | ||
124 | # just does require rdiscount | |
125 | %{__rm} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/markdown.rb | |
db5d4040 | 126 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/markdown.7 |
a8e89bcb | 127 | |
db5d4040 | 128 | %if %{with doc} |
a8e89bcb ER |
129 | cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir} |
130 | cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version} | |
9ee55acc | 131 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/rdiscount.1.ronn |
db5d4040 | 132 | %endif |
2f070126 | 133 | |
134 | %clean | |
135 | rm -rf $RPM_BUILD_ROOT | |
136 | ||
137 | %files | |
138 | %defattr(644,root,root,755) | |
9ee55acc | 139 | %doc CHANGELOG.md COPYING README.markdown |
2f38e19b ER |
140 | %{ruby_vendorlibdir}/rdiscount.rb |
141 | %attr(755,root,root) %{ruby_vendorarchdir}/rdiscount.so | |
a8e89bcb | 142 | %{ruby_specdir}/%{pkgname}-%{version}.gemspec |
2f070126 | 143 | |
144 | %files -n rdiscount | |
145 | %defattr(644,root,root,755) | |
146 | %attr(755,root,root) %{_bindir}/rdiscount | |
a8e89bcb | 147 | %{_mandir}/man1/rdiscount.1* |
2f070126 | 148 | |
db5d4040 | 149 | %if %{with doc} |
2f070126 | 150 | %files rdoc |
151 | %defattr(644,root,root,755) | |
152 | %{ruby_rdocdir}/%{name}-%{version} | |
153 | ||
154 | %files ri | |
155 | %defattr(644,root,root,755) | |
156 | %{ruby_ridir}/RDiscount | |
db5d4040 | 157 | %endif |