]> git.pld-linux.org Git - packages/jsoncpp.git/blob - jsoncpp.spec
01213690a185680f85210805f47629b674535ba3
[packages/jsoncpp.git] / jsoncpp.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define svnrev  251
6 %define svndate 20120626
7 Summary:        API for manipulating JSON
8 Name:           jsoncpp
9 Version:        0.6.0
10 Release:        0.2.%{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:  cc7964a0787959111ef3d9965287dd3e
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 Group:          Development/Libraries
32 Requires:       %{name} = %{version}-%{release}
33
34 %description devel
35 Headers and libraries for JSONCPP.
36
37 %prep
38 %setup -q -n %{name}
39 %patch0 -p1
40 %{__sed} -i -e '
41         s|g++|%{__cxx}| # FIXME: still does not work
42         s|@@OPTFLAGS@@|%{rpmcxxflags}|
43 ' SConstruct
44
45 %build
46 %scons \
47         platform=linux-gcc
48
49 # Now, lets make a proper shared lib. :P
50 %{__cxx} -o libjsoncpp.so.0.0.0 -shared -Wl,-soname,libjsoncpp.so.0 buildscons/linux-gcc-*/src/lib_json/*.os -lpthread %{rpmldflags}
51
52 %if %{with tests}
53 scons platform=linux-gcc check
54 %endif
55
56 %install
57 rm -rf $RPM_BUILD_ROOT
58 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/jsoncpp,%{_pkgconfigdir}}
59 install -p libjsoncpp.so.*.*.* $RPM_BUILD_ROOT%{_libdir}
60 cp -a include/json $RPM_BUILD_ROOT%{_includedir}/jsoncpp
61 %{__sed} -e 's|@@LIBDIR@@|%{_libdir}|g' %{SOURCE1} > $RPM_BUILD_ROOT%{_pkgconfigdir}/jsoncpp.pc
62
63 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
64 ln -s $(basename $RPM_BUILD_ROOT%{_libdir}/libjsoncpp.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libjsoncpp.so
65
66 %clean
67 rm -rf $RPM_BUILD_ROOT
68
69 %post -p /sbin/ldconfig
70 %postun -p /sbin/ldconfig
71
72 %files
73 %defattr(644,root,root,755)
74 %doc AUTHORS NEWS.txt README.txt version
75 %attr(755,root,root) %{_libdir}/libjsoncpp.so.0.0.0
76 %ghost %{_libdir}/libjsoncpp.so.0
77
78 %files devel
79 %defattr(644,root,root,755)
80 %doc doc/*
81 %{_includedir}/jsoncpp
82 %{_libdir}/libjsoncpp.so
83 %{_pkgconfigdir}/jsoncpp.pc
This page took 0.081227 seconds and 2 git commands to generate.