[packages/json-c] - switch to /usr/include/json-c dir must be done at some moment anyway (/usr/include/json will be

qboosh qboosh at pld-linux.org
Fri Dec 13 19:44:54 CET 2013


commit 6cafbf586868202d67e90502fc81efe7357f33b1
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Dec 13 19:46:22 2013 +0100

    - switch to /usr/include/json-c dir must be done at some moment anyway
      (/usr/include/json will be dropped), so do it now (using pretrans script)
    - handle -ljson compatibility by symlink to libjson-c.so (stub libjson doesn't work with PLD rpmldflags)
    - release 3

 json-c.spec | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/json-c.spec b/json-c.spec
index 9ba6f05..504e0a7 100644
--- a/json-c.spec
+++ b/json-c.spec
@@ -2,9 +2,9 @@ Summary:	A JSON implementation in C
 Summary(pl.UTF-8):	Implementacja JSON w C
 Name:		json-c
 Version:	0.11
-Release:	2
+Release:	3
 License:	MIT
-Group:		Development/Libraries
+Group:		Libraries
 Source0:	https://s3.amazonaws.com/json-c_releases/releases/%{name}-%{version}.tar.gz
 # Source0-md5:	aa02367d2f7a830bf1e3376f77881e98
 URL:		https://github.com/json-c/json-c/wiki
@@ -59,18 +59,26 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-%{__rm} $RPM_BUILD_ROOT%{_includedir}/json
-%{__mv} $RPM_BUILD_ROOT%{_includedir}/json{-c,}
-ln -s %{_includedir}/json $RPM_BUILD_ROOT%{_includedir}/json-c
-
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
 
+# link with libjson-c directly (stub libjson won't work with --no-copy-dt-needed-entries
+ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/libjson-c.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libjson.so
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post	-p /sbin/ldconfig
 %postun	-p /sbin/ldconfig
 
+%pretrans devel
+# transition from 0.11-2
+[ ! -L %{_includedir}/json-c ] || rm -f %{_includedir}/json-c
+# transition from <= 0.10 and 0.11-2
+if [ -d %{_includedir}/json -a ! -d %{_includedir}/json-c ]; then
+	mv -f %{_includedir}/json %{_includedir}/json-c
+	ln -sf json-c %{_includedir}/json
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS COPYING ChangeLog README README.html
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/json-c.git/commitdiff/6cafbf586868202d67e90502fc81efe7357f33b1



More information about the pld-cvs-commit mailing list