]>
Commit | Line | Data |
---|---|---|
efa9f70b ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
2f070126 | 5 | # TODO |
6 | # - rake doc | |
7 | # (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 | |
8 | # rake aborted! | |
efa9f70b | 9 | |
2f070126 | 10 | %define pkgname rdiscount |
11 | Summary: Discount Markdown Processor for Ruby | |
a8e89bcb ER |
12 | Name: ruby-%{pkgname} |
13 | Version: 2.1.8 | |
2f38e19b | 14 | Release: 1 |
a8e89bcb ER |
15 | License: BSD |
16 | Source0: https://github.com/davidfstr/rdiscount/archive/%{version}/%{pkgname}-%{version}.tar.gz | |
17 | # Source0-md5: 7c8076339ffcbc0be7a76ebd19750fb7 | |
2f070126 | 18 | Group: Development/Languages |
a8e89bcb | 19 | URL: https://github.com/davidfstr/rdiscount |
d87af65b ER |
20 | BuildRequires: rpm-rubyprov |
21 | BuildRequires: rpmbuild(macros) >= 1.665 | |
a83c7ea4 | 22 | BuildRequires: ruby >= 1:1.9 |
0336db61 | 23 | BuildRequires: ruby-devel |
2f070126 | 24 | BuildRequires: ruby-modules |
25 | BuildRequires: setup.rb | |
2f070126 | 26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
27 | ||
28 | %description | |
29 | Discount Markdown Processor for Ruby. | |
30 | ||
31 | %package -n rdiscount | |
32 | Summary: Markdown processor | |
33 | Group: Applications/Publishing | |
34 | Requires: %{name} = %{version}-%{release} | |
35 | ||
2f38e19b | 36 | %description -n rdiscount |
2f070126 | 37 | Markdown processor. |
38 | ||
39 | %package rdoc | |
40 | Summary: HTML documentation for %{pkgname} | |
41 | Summary(pl.UTF-8): Dokumentacja w formacie HTML dla %{pkgname} | |
42 | Group: Documentation | |
43 | Requires: ruby >= 1:1.8.7-4 | |
2f38e19b ER |
44 | %if "%{_rpmversion}" >= "5" |
45 | BuildArch: noarch | |
46 | %endif | |
2f070126 | 47 | |
48 | %description rdoc | |
49 | HTML documentation for %{pkgname}. | |
50 | ||
51 | %description rdoc -l pl.UTF-8 | |
52 | Dokumentacja w formacie HTML dla %{pkgname}. | |
53 | ||
54 | %package ri | |
55 | Summary: ri documentation for %{pkgname} | |
56 | Summary(pl.UTF-8): Dokumentacja w formacie ri dla %{pkgname} | |
57 | Group: Documentation | |
58 | Requires: ruby | |
2f38e19b ER |
59 | %if "%{_rpmversion}" >= "5" |
60 | BuildArch: noarch | |
61 | %endif | |
2f070126 | 62 | |
63 | %description ri | |
64 | ri documentation for %{pkgname}. | |
65 | ||
66 | %description ri -l pl.UTF-8 | |
67 | Dokumentacji w formacie ri dla %{pkgname}. | |
68 | ||
69 | %prep | |
a8e89bcb | 70 | %setup -qn %{pkgname}-%{version} |
2f070126 | 71 | |
72 | %build | |
a8e89bcb ER |
73 | # make gemspec self-contained |
74 | ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec")) | |
75 | File.open("%{pkgname}-%{version}.gemspec", "w") do |file| | |
76 | file.puts spec.to_ruby_for_cache | |
77 | end' | |
78 | ||
2f070126 | 79 | cp %{_datadir}/setup.rb . |
80 | ||
2f38e19b ER |
81 | %{__ruby} setup.rb config \ |
82 | --rbdir=%{ruby_vendorlibdir} \ | |
a8e89bcb | 83 | --mandir=%{_mandir}/man1 \ |
2f38e19b | 84 | --sodir=%{ruby_vendorarchdir} |
2f070126 | 85 | |
2f38e19b | 86 | %{__ruby} setup.rb setup |
2f070126 | 87 | |
efa9f70b ER |
88 | %if %{with tests} |
89 | %{__ruby} -r rubygems -Ilib:ext:. \ | |
90 | -e 'gem "test-unit"; Dir.glob("test/*_test.rb").sort.each {|f| require f}' | |
91 | %endif | |
92 | ||
2f070126 | 93 | rdoc --ri --op ri lib |
94 | rdoc --op rdoc lib | |
2f38e19b | 95 | rm -r ri/Object |
2f070126 | 96 | rm ri/created.rid |
2f38e19b | 97 | rm ri/cache.ri |
2f070126 | 98 | |
99 | %install | |
100 | rm -rf $RPM_BUILD_ROOT | |
a8e89bcb | 101 | install -d $RPM_BUILD_ROOT{%{ruby_specdir},%{ruby_ridir},%{ruby_rdocdir}} |
2f38e19b | 102 | %{__ruby} setup.rb install \ |
2f070126 | 103 | --prefix=$RPM_BUILD_ROOT |
a8e89bcb ER |
104 | cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} |
105 | ||
106 | # just does require rdiscount | |
107 | %{__rm} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/markdown.rb | |
108 | ||
109 | cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir} | |
110 | cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version} | |
111 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man*/*.ronn* | |
112 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man*/markdown.7* | |
2f070126 | 113 | |
114 | %clean | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | ||
117 | %files | |
118 | %defattr(644,root,root,755) | |
119 | %doc COPYING README.markdown | |
2f38e19b ER |
120 | %{ruby_vendorlibdir}/rdiscount.rb |
121 | %attr(755,root,root) %{ruby_vendorarchdir}/rdiscount.so | |
a8e89bcb | 122 | %{ruby_specdir}/%{pkgname}-%{version}.gemspec |
2f070126 | 123 | |
124 | %files -n rdiscount | |
125 | %defattr(644,root,root,755) | |
126 | %attr(755,root,root) %{_bindir}/rdiscount | |
a8e89bcb | 127 | %{_mandir}/man1/rdiscount.1* |
2f070126 | 128 | |
129 | %files rdoc | |
130 | %defattr(644,root,root,755) | |
131 | %{ruby_rdocdir}/%{name}-%{version} | |
132 | ||
133 | %files ri | |
134 | %defattr(644,root,root,755) | |
135 | %{ruby_ridir}/RDiscount |