]> git.pld-linux.org Git - projects/template-specs.git/blob - ruby.spec
ruby: update rubygems url to be https
[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:        https://rubygems.org/downloads/%{pkgname}-%{version}.gem
16 # Source0-md5:  -
17 Group:          Development/Languages
18 URL:            http://rubyforge.org/projects/.../
19 BuildRequires:  rpm-rubyprov
20 BuildRequires:  rpmbuild(macros) >= 1.665
21 #BuildRequires: setup.rb
22 # optional locale BR, see ri/rdoc building below
23 #%if %(locale -a | grep -q '^en_US$'; echo $?)
24 #BuildRequires: glibc-localedb-all
25 #%endif
26 %if %{with tests}
27 #BuildRequires: ruby-rspec
28 %endif
29 #BuildArch:     noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 ...
34
35 %package rdoc
36 Summary:        HTML documentation for Ruby %{pkgname} module
37 Summary(pl.UTF-8):      Dokumentacja w formacie HTML dla modułu języka Ruby %{pkgname}
38 Group:          Documentation
39 Requires:       ruby >= 1:1.8.7-4
40
41 %description rdoc
42 HTML documentation for Ruby %{pkgname} module.
43
44 %description rdoc -l pl.UTF-8
45 Dokumentacja w formacie HTML dla modułu języka Ruby %{pkgname}.
46
47 %package ri
48 Summary:        ri documentation for Ruby %{pkgname} module
49 Summary(pl.UTF-8):      Dokumentacja w formacie ri dla modułu języka Ruby %{pkgname}
50 Group:          Documentation
51 Requires:       ruby
52
53 %description ri
54 ri documentation for Ruby %{pkgname} module.
55
56 %description ri -l pl.UTF-8
57 Dokumentacja w formacie ri dla modułu języka Ruby %{pkgname}.
58
59 %prep
60 %setup -q -n %{pkgname}-%{version}
61
62 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
63
64 # cleanup backups after patching
65 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
66
67 %build
68 # write .gemspec
69 %__gem_helper spec
70
71 # make gemspec self-contained
72 ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec"))
73         File.open("%{pkgname}-%{version}.gemspec", "w") do |file|
74         file.puts spec.to_ruby_for_cache
75 end'
76
77 #'
78
79 # binary pkgs:
80 cd ext/%{pkgname}
81 %{__ruby} extconf.rb
82 %{__make} \
83         CC="%{__cc}" \
84         LDFLAGS="%{rpmldflags}" \
85         CFLAGS="%{rpmcflags} -fPIC"
86
87 # with rdoc/ri:
88 # optional locale force, see BR above as well
89 # UTF8 locale needed for doc generation
90 #export LC_ALL=en_US.UTF-8
91
92 rdoc --ri --op ri lib
93 rdoc --op rdoc lib
94 # rm -r ri/NOT_THIS_MODULE_RELATED_DIRS
95 rm ri/created.rid
96 rm ri/cache.ri
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.177606 seconds and 3 git commands to generate.