]> git.pld-linux.org Git - projects/template-specs.git/blob - ruby.spec
update
[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 # gem
62 %setup -q -n %{pkgname}-%{version}
63 # tgz
64 #%setup -q -n %{pkgname}-%{version}
65
66 # ext build
67 cp -p %{_datadir}/setup.rb .
68
69 # cleanup backups after patching
70 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
71
72 %build
73 # write .gemspec
74 %__gem_helper spec
75
76 %if old
77 cp %{_datadir}/setup.rb .
78 %{__ruby} setup.rb config \
79         --rbdir=%{ruby_vendorlibdir} \
80         --sodir=%{ruby_vendorarchdir}
81
82 ruby setup.rb config \
83         --site-ruby=%{ruby_vendorlibdir} \
84         --so-dir=%{ruby_vendorarchdir}
85
86 ruby extconf.rb --vendor --with-pgsql-include=%{_includedir}/pgsql/server
87
88 ruby setup.rb config \
89         --prefix=%{_prefix} \
90         --siterubyver=%{ruby_vendorlibdir} \
91         --siterubyverarch=%{ruby_vendorarchdir} \
92
93 ruby setup.rb config \
94         --prefix=%{_prefix} \
95         --site-ruby=%{ruby_vendorlibdir}
96
97 %{__ruby} install.rb \
98         --sitelibdir=%{ruby_vendorlibdir} \
99
100 %cmake \
101         -DCUSTOM_RUBY_SITE_ARCH_DIR:PATH=%{ruby_vendorarchdir} \
102         -DCUSTOM_RUBY_SITE_LIB_DIR:PATH=%{ruby_vendorlibdir} \
103         ..
104
105 ruby setup.rb setup
106
107 %{__ruby} setup.rb setup
108 %endif
109
110 # binary pkgs:
111 cd ext/%{pkgname}
112 %{__ruby} extconf.rb
113 %{__make} \
114         CC="%{__cc}" \
115         LDFLAGS="%{rpmldflags}" \
116         CFLAGS="%{rpmcflags} -fPIC"
117
118 # with rdoc/ri:
119 # optional locale force, see BR above as well
120 # UTF8 locale needed for doc generation
121 #export LC_ALL=en_US.UTF-8
122
123 rdoc --ri --op ri lib
124 rdoc --op rdoc lib
125 # rm -r ri/NOT_THIS_MODULE_RELATED_DIRS
126 rm ri/created.rid
127
128 %install
129 rm -rf $RPM_BUILD_ROOT
130 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_ridir},%{ruby_rdocdir}}
131 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_ridir},%{ruby_rdocdir},%{_bindir}}
132 %{__ruby} setup.rb install \
133         --prefix=$RPM_BUILD_ROOT
134
135 install -d $RPM_BUILD_ROOT%{ruby_vendorlibdir}
136 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
137
138 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
139 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
140
141 cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
142
143 # install ext
144 install -d $RPM_BUILD_ROOT%{ruby_vendorarchdir}
145 install -p ext/ruby_http_parser/ruby_http_parser.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
146
147 install -d $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
148 cp -a rdoc/* $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
149
150 # install gemspec
151 install -d $RPM_BUILD_ROOT%{ruby_specdir}
152 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir}}
153 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
154
155 %clean
156 rm -rf $RPM_BUILD_ROOT
157
158 %files
159 %defattr(644,root,root,755)
160 %doc CHANGELOG README
161 %{ruby_vendorlibdir}/%{pkgname}.rb
162 %{ruby_vendorlibdir}/%{pkgname}
163 %attr(755,root,root) %{ruby_vendorarchdir}/%{pkgname}_ext.so
164 %{ruby_specdir}/%{pkgname}-%{version}.gemspec
165
166 %if %{with doc}
167 %files rdoc
168 %defattr(644,root,root,755)
169 %{ruby_rdocdir}/%{name}-%{version}
170
171 %files ri
172 %defattr(644,root,root,755)
173 %{ruby_ridir}/%{pkgname}
174 %endif
This page took 0.091867 seconds and 4 git commands to generate.