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