From: Elan Ruusamäe Date: Tue, 20 Dec 2011 14:45:03 +0000 (+0000) Subject: - link soname properly X-Git-Tag: auto/ac/hiredis-0_10_0-1 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fhiredis.git;a=commitdiff_plain;h=e0ef74783d8e8467e47729670e8ba55192ce4606 - link soname properly Changed files: hiredis.spec -> 1.2 link.patch -> 1.1 --- diff --git a/hiredis.spec b/hiredis.spec index 57afed0..e73174f 100644 --- a/hiredis.spec +++ b/hiredis.spec @@ -1,13 +1,13 @@ Summary: A minimalistic C client library for Redis Name: hiredis Version: 0.10.0 -Release: 0.3 +Release: 1 License: BSD Group: Libraries URL: https://github.com/antirez/hiredis Source0: https://github.com/antirez/hiredis/tarball/v%{version}/%{name}-%{version}.tgz # Source0-md5: 66edb31cdc39c94978ddf98538259d72 -Requires: redis +Patch0: link.patch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -25,20 +25,24 @@ develop applications using a Redis database. %prep %setup -qc mv *-%{name}-*/* . +%patch0 -p1 %build %{__make} \ - OPTIMIZATION="%{optflags}" + CC="%{__cc}" \ + DEBUG="" \ + LDFLAGS="-L. %{rpmldflags}" \ + OPTIMIZATION="%{rpmcflags}" %install rm -rf $RPM_BUILD_ROOT %{__make} install \ + INSTALL="cp -a" \ PREFIX=$RPM_BUILD_ROOT%{_prefix} \ INSTALL_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir} install -d $RPM_BUILD_ROOT%{_bindir} -install -p hiredis-example $RPM_BUILD_ROOT%{_bindir} -install -p cp hiredis-test $RPM_BUILD_ROOT%{_bindir} +install -p hiredis-example hiredis-test $RPM_BUILD_ROOT%{_bindir} find $RPM_BUILD_ROOT -name *.a | xargs rm -v @@ -53,7 +57,7 @@ rm -rf $RPM_BUILD_ROOT %doc COPYING TODO %attr(755,root,root) %{_bindir}/hiredis-example %attr(755,root,root) %{_bindir}/hiredis-test -#%{_libdir}/libhiredis.so.0.10 +%attr(755,root,root) %{_libdir}/libhiredis.so.*.*.* %ghost %{_libdir}/libhiredis.so.0 %files devel diff --git a/link.patch b/link.patch new file mode 100644 index 0000000..62a1a15 --- /dev/null +++ b/link.patch @@ -0,0 +1,36 @@ +--- hiredis-0.10.0/Makefile 2011-12-20 16:34:25.025574337 +0200 ++++ hiredis-0.10.0/Makefile 2011-12-20 16:38:47.294352952 +0200 +@@ -37,7 +37,9 @@ + DYLIBSUFFIX=so + STLIBSUFFIX=a + DYLIBNAME?=$(LIBNAME).$(DYLIBSUFFIX) +- DYLIB_MAKE_CMD?=gcc -shared -Wl,-soname,$(DYLIBNAME) -o $(DYLIBNAME) ++ DYLIBSONAME?=$(DYLIBNAME).0 ++ LINKLIBNAME?=$(subst lib,,$(LIBNAME)) ++ DYLIB_MAKE_CMD?=$(CC) -shared -Wl,-soname,$(DYLIBSONAME) -o $(DYLIBNAME) + STLIBNAME?=$(LIBNAME).$(STLIBSUFFIX) + STLIB_MAKE_CMD?=ar rcs $(STLIBNAME) + endif +@@ -88,8 +90,8 @@ + $(CC) -o $@ $(CCOPT) $(DEBUG) -I$(AE_DIR) $(LDFLAGS) $(STLIBNAME) example-ae.c $(AE_DIR)/ae.o $(AE_DIR)/zmalloc.o + endif + +-hiredis-%: %.o $(STLIBNAME) +- $(CC) -o $@ $(CCOPT) $(DEBUG) $(LDFLAGS) $(STLIBNAME) $< ++hiredis-%: %.o $(DYLIBNAME) ++ $(CC) -o $@ $(CCOPT) $(DEBUG) -l$(LINKLIBNAME) $(LDFLAGS) $< + + test: hiredis-test + ./hiredis-test +@@ -106,7 +108,10 @@ + install: $(DYLIBNAME) $(STLIBNAME) + mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH) + $(INSTALL) hiredis.h async.h adapters $(INSTALL_INCLUDE_PATH) +- $(INSTALL) $(DYLIBNAME) $(STLIBNAME) $(INSTALL_LIBRARY_PATH) ++ $(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH) ++ $(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIBNAME).0.0.0 ++ ln -s $(DYLIBNAME).0.0.0 $(INSTALL_LIBRARY_PATH)/$(DYLIBNAME).0 ++ ln -s $(DYLIBNAME).0.0.0 $(INSTALL_LIBRARY_PATH)/$(DYLIBNAME) + + 32bit: + @echo ""