]> git.pld-linux.org Git - packages/rcsparse.git/blob - rcsparse.spec
- ruby 2.0 rebuild
[packages/rcsparse.git] / rcsparse.spec
1 # TODO
2 # - make ruby bindings use -base lib?
3 #
4 # Conditional build:
5 %bcond_without  python  # build python bindings
6 %bcond_without  ruby    # build ruby bindings
7
8 %define         snap    20090807
9 %define         rel             3
10 Summary:        Library for parsing RCS files
11 Summary(pl.UTF-8):      Moduł do analizy plików RCS
12 Name:           rcsparse
13 Version:        0.1
14 Release:        0.%{snap}.%{rel}
15 License:        BSD
16 Group:          Libraries
17 Source0:        http://ww2.fs.ei.tum.de/~corecode/hg/rcsparse/archive/tip.tar.bz2?/%{name}.tbz2
18 # Source0-md5:  360ad1d3e0410d30abea710ce758c396
19 Patch0:         ruby19.patch
20 URL:            http://ww2.fs.ei.tum.de/~corecode/hg/rcsparse/
21 BuildRequires:  libtool
22 %if %{with python}
23 BuildRequires:  python-devel
24 BuildRequires:  rpm-pythonprov
25 %endif
26 %if %{with ruby}
27 BuildRequires:  rpm-rubyprov
28 BuildRequires:  rpmbuild(macros) >= 1.665
29 BuildRequires:  ruby >= 1:1.8
30 BuildRequires:  ruby-devel
31 %endif
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 Library for parsing RCS files.
36
37 %package devel
38 Summary:        Header files and develpment documentation for rcsparse
39 Group:          Development/Libraries
40 Requires:       %{name} = %{epoch}:%{version}-%{release}
41
42 %description devel
43 Header files and develpment documentation for rcsparse.
44
45 %package -n python-rcsparse
46 Summary:        rcsparse Python bindings
47 Group:          Development/Languages/Python
48 Requires:       %{name} = %{epoch}:%{version}-%{release}
49 Requires:       python
50
51 %description -n python-rcsparse
52 rcsparse Python bindings.
53
54 %package -n ruby-rcsparse
55 Summary:        rcsparse Ruby bindings
56 Group:          Development/Languages
57 %{?ruby_mod_ver_requires_eq}
58 # does not link with base
59 #Requires:      %{name} = %{epoch}:%{version}-%{release}
60
61 %description -n ruby-rcsparse
62 rcsparse Ruby bindings.
63
64 %prep
65 %setup -qc
66 mv %{name}-*/* .
67 %patch0 -p1
68
69 %build
70 libtool --tag=CC --mode=compile %{__cc} %{rpmcppflags} %{rpmcflags} -fPIC -shared -c rcsparse.c
71 libtool --tag=CC --mode=link %{__cc} %{rpmldflags} %{rpmcflags} -shared -o librcsparse.la -rpath %{_libdir} rcsparse.lo
72
73 %if %{with python}
74 libtool --tag=CC --mode=compile %{__cc} %{rpmcppflags} %{rpmcflags} -I%{py_incdir} -shared -c py-rcsparse.c
75 libtool --tag=CC --mode=link %{__cc} %{rpmldflags} %{rpmcflags} -avoid-version -module -shared -o rcsparse.la -rpath %{py_sitedir} py-rcsparse.lo librcsparse.la
76 %endif
77
78 %if %{with ruby}
79 %{__ruby} extconf.rb \
80         --vendor
81 %{__make} -j1 \
82         CC="%{__cc}" \
83         CFLAGS="%{rpmcflags} -fPIC"
84 %endif
85
86 %install
87 rm -rf $RPM_BUILD_ROOT
88 install -d $RPM_BUILD_ROOT{%{_libdir},%{py_sitedir},%{_includedir}/%{name}}
89 libtool --mode=install install -p -c librcsparse.la $RPM_BUILD_ROOT%{_libdir}
90 rm -f $RPM_BUILD_ROOT%{_libdir}/librcsparse.a
91 cp -p *.h $RPM_BUILD_ROOT%{_includedir}/%{name}
92
93 %if %{with python}
94 libtool --mode=install install -p -c rcsparse.la $RPM_BUILD_ROOT%{py_sitedir}
95 rm -f $RPM_BUILD_ROOT%{py_sitedir}/rcsparse.la
96 rm -f $RPM_BUILD_ROOT%{py_sitedir}/rcsparse.a
97 %endif
98
99 %if %{with ruby}
100 %{__make} -j1 install \
101         DESTDIR=$RPM_BUILD_ROOT
102 %endif
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT
106
107 %post   -p /sbin/ldconfig
108 %postun -p /sbin/ldconfig
109
110 %files
111 %defattr(644,root,root,755)
112 %doc COPYRIGHT
113 %attr(755,root,root) %{_libdir}/librcsparse.so.*.*.*
114 %attr(755,root,root) %ghost %{_libdir}/librcsparse.so.0
115
116 %files devel
117 %defattr(644,root,root,755)
118 %attr(755,root,root) %{_libdir}/librcsparse.so
119 %{_libdir}/librcsparse.la
120 %{_includedir}/%{name}
121
122 %if %{with python}
123 %files -n python-rcsparse
124 %defattr(644,root,root,755)
125 %doc testmodule.py
126 %attr(755,root,root) %{py_sitedir}/rcsparse.so
127 %endif
128
129 %if %{with ruby}
130 %files -n ruby-rcsparse
131 %defattr(644,root,root,755)
132 %attr(755,root,root) %{ruby_vendorarchdir}/rcsfile.so
133 %endif
This page took 0.329156 seconds and 3 git commands to generate.