# # spec file for package libyajl # # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: libyajl Version: 2.1.0 Release: 0 # # NB, upstream does not provide pre-built tar.gz downloads. Instead # they make you use the 'on the fly' generated tar.gz from GITHub's # web interface # # The Source for any version is obtained by a URL # # http://github.com/lloyd/yajl/tarball/1.0.7 # # Which causes a download of a archive named after # the GIT hash corresponding to the version tag # # eg lloyd-yajl-45a1bdb.tar.gz # # NB even though the tar.gz is generated on the fly by GITHub it # will always have identical md5sum # # So for new versions, update 'githash' to match the hash of the # GIT tag associated with updated 'Version:' field just above %global githash 66cb08c %define soname 2 Summary: Yet Another JSON Library License: ISC Group: System/Libraries # http://download.github.com/lloyd-yajl-%{version}-0-g%{githash}.tar.gz Source: lloyd-yajl-%{version}-0-g%{githash}.tar.gz Source1: baselibs.conf Source2: json_reformat.1 Source3: json_verify.1 Patch1: libyajl-optflags.patch Patch2: libyajl-lib_suffix.patch Source99: %{name}-rpmlintrc Url: http://lloyd.github.com/yajl/ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison BuildRequires: cmake BuildRequires: flex BuildRequires: gcc-c++ BuildRequires: glibc-devel BuildRequires: libstdc++-devel BuildRequires: make BuildRequires: pkg-config %description YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C, and a small validating JSON generator. %package -n %{name}%{soname} Summary: Yet Another JSON Library Group: System/Libraries %description -n %{name}%{soname} YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C, and a small validating JSON generator. %package -n %{name}-devel Summary: Yet Another JSON Library (Development Environment) Group: Development/Libraries/C and C++ Requires: %{name}%{soname} = %{version} %description -n %{name}-devel YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C, and a small validating JSON generator. This package provides the necessary environment for compiling and linking against %{name}. %package -n %{name}-devel-static Summary: Yet Another JSON Library (Static Library) Group: Development/Libraries/C and C++ Requires: %{name}-devel = %{version} %description -n %{name}-devel-static YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C, and a small validating JSON generator. This package provides the necessary environment for linking statically against %{name}. %package -n yajl Summary: Yet Another JSON Library Tools Group: Productivity/Text/Utilities Requires: %{name}%{soname} = %{version} %description -n yajl YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C, and a small validating JSON generator. This package provides a few command-line utilities for processing JSON files. %prep %setup -q -n "lloyd-yajl-%{githash}" %patch1 -p1 -b .optflags %patch2 -p1 -b .lib_suffix %build %cmake %{__make} %{_smp_mflags} %install %cmake_install install -d -m 0755 $RPM_BUILD_ROOT%{_mandir}/man1 install -m644 %SOURCE2 %SOURCE3 $RPM_BUILD_ROOT/%{_mandir}/man1 %check make test %post -n %{name}%{soname} -p /sbin/ldconfig %postun -n %{name}%{soname} -p /sbin/ldconfig %files -n %{name}%{soname} %defattr(-,root,root) %doc COPYING README TODO %{_libdir}/libyajl.so.%{soname} %{_libdir}/libyajl.so.%{soname}.* %files -n %{name}-devel %defattr(-,root,root) %{_includedir}/yajl %{_libdir}/libyajl.so %{_datadir}/pkgconfig/yajl.pc %files -n %{name}-devel-static %defattr(-,root,root) %{_libdir}/libyajl_s.a %files -n yajl %defattr(-,root,root) %doc %{_mandir}/man1/json_reformat.1* %doc %{_mandir}/man1/json_verify.1* %{_bindir}/json_reformat %{_bindir}/json_verify %changelog