]> git.pld-linux.org Git - projects/template-specs.git/blob - ruby.spec
cosmetics
[projects/template-specs.git] / ruby.spec
1
2 # TODO
3 # - any policy what to package in %{ruby_ridir}?
4 #
5 # Conditional build:
6 %bcond_without  tests           # build without tests
7 %bcond_without  doc                     # don't build ri/rdoc
8
9 %define pkgname MODULE_NAME
10 Summary:        -
11 Name:           ruby-%{pkgname}
12 Version:        -
13 Release:        0.1
14 License:        - (enter GPL/GPL v2/GPL v3+/LGPL/MIT/Ruby License/other license name here)
15 #Source0:       http://rubyforge.org/frs/download.php/18699/%{pkgname}-%{version}.tgz
16 Source0:        http://rubygems.org/downloads/%{pkgname}-%{version}.gem
17 # Source0-md5:  -
18 Group:          Development/Languages
19 URL:            http://rubyforge.org/projects/.../
20 BuildRequires:  rpm-rubyprov
21 BuildRequires:  rpmbuild(macros) >= 1.665
22 #BuildRequires: setup.rb
23 # optional locale BR, see ri/rdoc building below
24 #%if %(locale -a | grep -q '^en_US$'; echo $?)
25 #BuildRequires: glibc-localedb-all
26 #%endif
27 %if %{with tests}
28 #BuildRequires: ruby-rspec
29 %endif
30 #BuildArch:     noarch
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 ...
35
36 %package rdoc
37 Summary:        HTML documentation for %{pkgname}
38 Summary(pl.UTF-8):      Dokumentacja w formacie HTML dla %{pkgname}
39 Group:          Documentation
40 Requires:       ruby >= 1:1.8.7-4
41
42 %description rdoc
43 HTML documentation for %{pkgname}.
44
45 %description rdoc -l pl.UTF-8
46 Dokumentacja w formacie HTML dla %{pkgname}.
47
48 %package ri
49 Summary:        ri documentation for %{pkgname}
50 Summary(pl.UTF-8):      Dokumentacja w formacie ri dla %{pkgname}
51 Group:          Documentation
52 Requires:       ruby
53
54 %description ri
55 ri documentation for %{pkgname}.
56
57 %description ri -l pl.UTF-8
58 Dokumentacji w formacie ri dla %{pkgname}.
59
60 %prep
61 %setup -q -n %{pkgname}-%{version}
62
63 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
64
65 # cleanup backups after patching
66 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
67
68 %build
69 # write .gemspec
70 %__gem_helper spec
71
72 # make gemspec self-contained
73 ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec"))
74         File.open("%{pkgname}-%{version}.gemspec", "w") do |file|
75         file.puts spec.to_ruby_for_cache
76 end'
77
78 #'
79
80 # binary pkgs:
81 cd ext/%{pkgname}
82 %{__ruby} extconf.rb
83 %{__make} \
84         CC="%{__cc}" \
85         LDFLAGS="%{rpmldflags}" \
86         CFLAGS="%{rpmcflags} -fPIC"
87
88 # with rdoc/ri:
89 # optional locale force, see BR above as well
90 # UTF8 locale needed for doc generation
91 #export LC_ALL=en_US.UTF-8
92
93 rdoc --ri --op ri lib
94 rdoc --op rdoc lib
95 # rm -r ri/NOT_THIS_MODULE_RELATED_DIRS
96 rm ri/created.rid
97
98 %install
99 rm -rf $RPM_BUILD_ROOT
100 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir}}
101 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
102 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
103
104 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir}}
105 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
106
107 %if %{with doc}
108 install -d $RPM_BUILD_ROOT{%{ruby_rdocdir}/%{name}-%{version},%{ruby_ridir}}
109 cp -a rdoc/* $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
110 cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
111 %endif
112
113 # install ext
114 install -d $RPM_BUILD_ROOT%{ruby_vendorarchdir}
115 install -p ext/%{pkgname}/*.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
116
117 # install examples
118 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
119 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
120
121 %clean
122 rm -rf $RPM_BUILD_ROOT
123
124 %files
125 %defattr(644,root,root,755)
126 %doc CHANGELOG README
127 %{ruby_vendorlibdir}/%{pkgname}.rb
128 %{ruby_vendorlibdir}/%{pkgname}
129 %attr(755,root,root) %{ruby_vendorarchdir}/%{pkgname}_ext.so
130 %{ruby_specdir}/%{pkgname}-%{version}.gemspec
131 %{_examplesdir}/%{name}-%{version}
132
133 %if %{with doc}
134 %files rdoc
135 %defattr(644,root,root,755)
136 %{ruby_rdocdir}/%{name}-%{version}
137
138 %files ri
139 %defattr(644,root,root,755)
140 %{ruby_ridir}/%{pkgname}
141 %endif
This page took 0.064403 seconds and 4 git commands to generate.