Accepting request 690893 from devel:libraries:c_c++

- Install pkgconfig into libdir instead of datadir with libyajl-pkgconfig.patch
- Use autosetup and cmake_build macro
- Rename macro soname to sover

OBS-URL: https://build.opensuse.org/request/show/690893
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libyajl?expand=0&rev=22
This commit is contained in:
Dominique Leuenberger 2019-04-04 10:04:19 +00:00 committed by Git OBS Bridge
commit 32b16cd94f
5 changed files with 35 additions and 23 deletions

View File

@ -1,7 +1,6 @@
diff -aur lloyd-yajl-66cb08c_orig/src/CMakeLists.txt lloyd-yajl-66cb08c/src/CMakeLists.txt
--- lloyd-yajl-66cb08c_orig/src/CMakeLists.txt 2014-03-19 05:58:29.000000000 +0100
+++ lloyd-yajl-66cb08c/src/CMakeLists.txt 2014-11-01 11:04:26.327902124 +0100
@@ -28,7 +28,7 @@
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -28,7 +28,7 @@ SET (PUB_HDRS api/yajl_parse.h api/yajl_
ADD_DEFINITIONS(-DYAJL_BUILD)
# set up some paths

View File

@ -1,7 +1,6 @@
diff -aur lloyd-yajl-66cb08c_orig/CMakeLists.txt lloyd-yajl-66cb08c/CMakeLists.txt
--- lloyd-yajl-66cb08c_orig/CMakeLists.txt 2014-03-19 05:58:29.000000000 +0100
+++ lloyd-yajl-66cb08c/CMakeLists.txt 2014-11-01 11:03:10.921290296 +0100
@@ -59,7 +59,7 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,7 +59,7 @@ ELSE (WIN32)
"${CMAKE_C_FLAGS} -std=c99 -pedantic -Wpointer-arith -Wno-format-y2k -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -Wextra -Wundef -Wwrite-strings -Wold-style-definition -Wredundant-decls -Wno-unused-parameter -Wno-sign-compare -Wmissing-prototypes")
SET(CMAKE_C_FLAGS_DEBUG "-DDEBUG -g")

8
libyajl-pkgconfig.patch Normal file
View File

@ -0,0 +1,8 @@
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -84,4 +84,4 @@ INSTALL(TARGETS yajl
INSTALL(TARGETS yajl_s ARCHIVE DESTINATION lib${LIB_SUFFIX})
INSTALL(FILES ${PUB_HDRS} DESTINATION include/yajl)
INSTALL(FILES ${incDir}/yajl_version.h DESTINATION include/yajl)
-INSTALL(FILES ${shareDir}/yajl.pc DESTINATION share/pkgconfig)
+INSTALL(FILES ${shareDir}/yajl.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Mar 25 16:58:41 UTC 2019 - olaf@aepfle.de
- Install pkgconfig into libdir instead of datadir with libyajl-pkgconfig.patch
- Use autosetup and cmake_build macro
- Rename macro soname to sover
-------------------------------------------------------------------
Tue Mar 27 11:44:33 CEST 2018 - kukuk@suse.de

View File

@ -16,7 +16,7 @@
#
%define soname 2
%define sover 2
Name: libyajl
Version: 2.1.0
Release: 0
@ -31,6 +31,7 @@ Source3: json_verify.1
Source99: %{name}-rpmlintrc
Patch1: libyajl-optflags.patch
Patch2: libyajl-lib_suffix.patch
Patch3: libyajl-pkgconfig.patch
BuildRequires: bison
BuildRequires: cmake
BuildRequires: doxygen
@ -43,18 +44,18 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C, and a
small validating JSON generator.
%package -n %{name}%{soname}
%package -n %{name}%{sover}
Summary: Yet Another JSON Library
Group: System/Libraries
%description -n %{name}%{soname}
%description -n %{name}%{sover}
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}
Requires: %{name}%{sover} = %{version}
%description -n %{name}-devel
YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C, and a
@ -78,7 +79,7 @@ against %{name}.
%package -n yajl
Summary: Yet Another JSON Library Tools
Group: Productivity/Text/Utilities
Requires: %{name}%{soname} = %{version}
Requires: %{name}%{sover} = %{version}
%description -n yajl
YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C, and a
@ -87,13 +88,11 @@ small validating JSON generator.
This package provides a few command-line utilities for processing JSON files.
%prep
%setup -q -n yajl-%{version}
%patch1 -p1 -b .optflags
%patch2 -p1 -b .lib_suffix
%autosetup -p1 -n yajl-%{version}
%build
%cmake
make %{?_smp_mflags}
%cmake_build
%install
%cmake_install
@ -103,22 +102,22 @@ install -m644 %{SOURCE2} %{SOURCE3} %{buildroot}/%{_mandir}/man1
%check
make %{?_smp_mflags} test
%post -n %{name}%{soname} -p /sbin/ldconfig
%post -n %{name}%{sover} -p /sbin/ldconfig
%postun -n %{name}%{soname} -p /sbin/ldconfig
%postun -n %{name}%{sover} -p /sbin/ldconfig
%files -n %{name}%{soname}
%files -n %{name}%{sover}
%defattr(-,root,root)
%license COPYING
%{_libdir}/libyajl.so.%{soname}
%{_libdir}/libyajl.so.%{soname}.*
%{_libdir}/libyajl.so.%{sover}
%{_libdir}/libyajl.so.%{sover}.*
%files -n %{name}-devel
%defattr(-,root,root)
%doc README TODO
%{_includedir}/yajl
%{_libdir}/libyajl.so
%{_datadir}/pkgconfig/yajl.pc
%{_libdir}/pkgconfig/yajl.pc
%files -n %{name}-devel-static
%defattr(-,root,root)