]>
Commit | Line | Data |
---|---|---|
0cc95b9e ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
5 | %define svnrev 249 | |
6 | %define svndate 20120626 | |
7 | Summary: API for manipulating JSON | |
8 | Name: jsoncpp | |
9 | Version: 0.6.0 | |
10 | Release: 0.1.%{svndate}svn%{svnrev} | |
11 | License: MIT or Public Domain | |
12 | Group: Libraries | |
13 | URL: http://jsoncpp.sourceforge.net/ | |
14 | # Need to use svn. | |
15 | # svn export https://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp jsoncpp | |
16 | # tar cfj jsoncpp-20120626svn249.tar.bz2 jsoncpp | |
17 | Source0: %{name}-%{svndate}svn%{svnrev}.tar.bz2 | |
18 | # Source0-md5: e42665aba92a48b1fa998e534d03b5d8 | |
19 | Source1: %{name}.pc | |
20 | Patch0: %{name}-optflags.patch | |
21 | BuildRequires: scons | |
22 | BuildRequires: sed >= 4.0 | |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
25 | %description | |
26 | JSONCPP provides a simple API to manipulate JSON values, and handle | |
27 | serialization and unserialization to strings. | |
28 | ||
29 | %package devel | |
30 | Summary: Headers and libraries for JSONCPP | |
31 | Requires: %{name} = %{version}-%{release} | |
32 | ||
33 | %description devel | |
34 | Headers and libraries for JSONCPP. | |
35 | ||
36 | %prep | |
37 | %setup -q -n %{name} | |
38 | %patch0 -p1 | |
39 | %{__sed} -i -e ' | |
40 | s|g++|%{__cxx}| # FIXME: still does not work | |
41 | s|@@OPTFLAGS@@|%{rpmcxxflags}| | |
42 | ' SConstruct | |
43 | ||
44 | %build | |
45 | %scons \ | |
46 | platform=linux-gcc | |
47 | ||
48 | # Now, lets make a proper shared lib. :P | |
49 | %{__cxx} -o libjsoncpp.so.0.0.0 -shared -Wl,-soname,libjsoncpp.so.0 buildscons/linux-gcc-*/src/lib_json/*.os -lpthread %{rpmldflags} | |
50 | ||
51 | %if %{with tests} | |
52 | scons platform=linux-gcc check | |
53 | %endif | |
54 | ||
55 | %install | |
56 | rm -rf $RPM_BUILD_ROOT | |
57 | install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/jsoncpp,%{_pkgconfigdir}} | |
58 | install -p libjsoncpp.so.*.*.* $RPM_BUILD_ROOT%{_libdir} | |
59 | cp -a include/json $RPM_BUILD_ROOT%{_includedir}/jsoncpp | |
60 | %{__sed} -e 's|@@LIBDIR@@|%{_libdir}|g' %{SOURCE1} > $RPM_BUILD_ROOT%{_pkgconfigdir}/jsoncpp.pc | |
61 | ||
62 | /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir} | |
63 | ln -s $(basename $RPM_BUILD_ROOT%{_libdir}/libjsoncpp.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libjsoncpp.so | |
64 | ||
65 | %clean | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | ||
68 | %post -p /sbin/ldconfig | |
69 | %postun -p /sbin/ldconfig | |
70 | ||
71 | %files | |
72 | %defattr(644,root,root,755) | |
73 | %doc AUTHORS NEWS.txt README.txt version | |
74 | %attr(755,root,root) %{_libdir}/libjsoncpp.so.0.0.0 | |
75 | %ghost %{_libdir}/libjsoncpp.so.0 | |
76 | ||
77 | %files devel | |
78 | %defattr(644,root,root,755) | |
79 | %doc doc/* | |
80 | %{_includedir}/jsoncpp | |
81 | %{_libdir}/libjsoncpp.so | |
82 | %{_pkgconfigdir}/jsoncpp.pc |