rpms/libresample/devel libresample-0.1.3-shlib-cmake.patch, NONE, 1.1 libresample.spec, 1.5, 1.6

Jeffrey C. Ollie jcollie at fedoraproject.org
Sat Sep 13 13:45:57 UTC 2008


Author: jcollie

Update of /cvs/pkgs/rpms/libresample/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv552

Modified Files:
	libresample.spec 
Added Files:
	libresample-0.1.3-shlib-cmake.patch 
Log Message:
* Thu Sep 11 2008 Jeffrey C. Ollie <jeff at ocjtech.us> - 0.1.3-6
- Add a patch that switches to cmake for building and build a shared library.


libresample-0.1.3-shlib-cmake.patch:

--- NEW FILE libresample-0.1.3-shlib-cmake.patch ---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..84857e9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,16 @@
+*~
+/src/config.h
+/libresample.so*
+/cmake_install.cmake
+/CMakeCache.txt
+/.sconsign.dblite
+/CMakeFiles
+/Makefile
+/CTestTestfile.cmake
+/DartTestfile.txt
+/Testing
+/libresample.pc
+/testresample
+/compareresample
+/resample-sndfile
+/docs/html
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..e70429f
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,60 @@
+cmake_minimum_required(VERSION 2.6)
+project(libresample)
+enable_testing()
+
+include(CheckIncludeFiles)
+include(CheckTypeSize)
+include(FindPkgConfig)
+
+check_type_size("void *" POINTER_SIZE)
+
+if(${POINTER_SIZE} EQUAL 8)
+    set(LIBDIR lib64)
+elseif(${POINTER_SIZE} EQUAL 4)
+    set(LIBDIR lib)
+else(${POINTER_SIZE} EQUAL 8)
+    message(FATAL_ERROR "pointer size is not 4 bytes or 8 bytes")
+endif(${POINTER_SIZE} EQUAL 8)
+
+check_include_files(inttypes.h HAVE_INTTYPES_H)
+
+find_library(HAVE_LIBM m)
+
+pkg_check_modules(SNDFILE sndfile)
+pkg_check_modules(SAMPLERATE samplerate)
+
+find_program(DOXYGEN NAMES doxygen)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/configtemplate.h ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libresample.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libresample.pc)
+
+add_library(resample SHARED src/filterkit.c src/resample.c src/resamplesubs.c)
+set_target_properties(resample PROPERTIES VERSION 1.0 SOVERSION 1)
+install(TARGETS resample LIBRARY DESTINATION ${LIBDIR})
+install(FILES include/libresample.h DESTINATION include)
+
+add_executable(testresample tests/testresample.c)
+target_link_libraries(testresample resample m)
+add_test(testresample testresample)
+
+if(SNDFILE_FOUND)
+   add_executable(resample-sndfile tests/resample-sndfile.c)
+   target_link_libraries(resample-sndfile resample m)
+   set_target_properties(resample-sndfile PROPERTIES COMPILE_FLAGS "${SNDFILE_CFLAGS}" LINK_FLAGS "${SNDFILE_LDFLAGS}")
+   install(TARGETS resample-sndfile RUNTIME DESTINATION bin)
+endif(SNDFILE_FOUND)
+
+if(SAMPLERATE_FOUND)
+   add_executable(compareresample tests/compareresample.c)
+   target_link_libraries(compareresample resample m)
+   set_target_properties(compareresample PROPERTIES COMPILE_FLAGS "${SAMPLERATE_CFLAGS}" LINK_FLAGS "${SAMPLERATE_LDFLAGS}")
+   add_test(compareresample compareresample)
+endif(SAMPLERATE_FOUND)
+
+install(FILES libresample.pc DESTINATION ${LIBDIR}/pkgconfig)
+
+if(DOXYGEN)
+   add_custom_command(OUTPUT docs/html/index.html COMMAND ${DOXYGEN} docs/Doxyfile DEPENDS include/libresample.h)
+   add_custom_target(docs ALL DEPENDS docs/html/index.html)
+endif(DOXYGEN)
+
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644
index febf70a..0000000
--- a/Makefile.in
+++ /dev/null
@@ -1,57 +0,0 @@
-# Run configure to generate Makefile from Makefile.in on
-# any system supported by GNU autoconf.  For all other
-# systems, use this file as a template to create a
-# working Makefile.
-
-CC = @CC@
-CFLAGS = @CFLAGS@ -Wall
-
-LIBS = @LIBS@ -lm
-
-AR = @AR@
-RANLIB = @RANLIB@
-srcdir=@srcdir@
-
-OBJS = \
-	src/resample.c.o \
-	src/resamplesubs.c.o \
-	src/filterkit.c.o
-
-TARGETS = @TARGETS@
-DIRS=tests
-
-all: $(TARGETS)
-
-libresample.a: $(OBJS) Makefile
-	$(AR) ruv libresample.a $(OBJS)
-	ranlib libresample.a
-
-tests/testresample: libresample.a $(srcdir)/tests/testresample.c $(DIRS)
-	$(CC) -o tests/testresample \
-		$(CFLAGS) $(srcdir)/tests/testresample.c \
-		libresample.a $(LIBS)
-
-tests/compareresample: libresample.a $(srcdir)/tests/compareresample.c $(DIRS)
-	$(CC) -o tests/compareresample \
-		$(CFLAGS) $(srcdir)/tests/compareresample.c \
-		libresample.a -lsamplerate $(LIBS)
-
-tests/resample-sndfile: libresample.a $(srcdir)/tests/resample-sndfile.c $(DIRS)
-	$(CC) -o tests/resample-sndfile \
-		$(CFLAGS) $(srcdir)/tests/resample-sndfile.c \
-		libresample.a -lsndfile $(LIBS)
-
-$(DIRS):
-	mkdir $(DIRS)
-
-clean:
-	rm -f $(TARGETS) $(OBJS)
-
-dist: clean
-	rm -f Makefile
-	rm -f config.status config.cache config.log src/config.h
-	rm -f *~ src/*~ tests/*~ include/*~
-
-$(OBJS): %.c.o: $(srcdir)/%.c Makefile $(srcdir)/include/libresample.h \
-	$(srcdir)/src/resample_defs.h $(srcdir)/src/filterkit.h $(srcdir)/src/config.h
-	$(CC) -c $(CFLAGS) $< -o $@
diff --git a/config.guess b/config.guess
deleted file mode 100755
index 297e5c3..0000000
--- a/config.guess
+++ /dev/null
@@ -1,1308 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-#   Free Software Foundation, Inc.
-
-timestamp='2001-10-05'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Per Bothner <bothner at cygnus.com>.
-# Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
[...7448 lines suppressed...]
-	fi
-
-# don't allow the sed command to completely eliminate the filename
-
-	if [ x"$dstfile" = x ] 
-	then
-		dstfile=`basename $dst`
-	else
-		true
-	fi
-
-# Make a temp file name in the proper directory.
-
-	dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
-	$doit $instcmd $src $dsttmp &&
-
-	trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing.  If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
-	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
-	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
-	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
-	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
-	$doit $rmcmd -f $dstdir/$dstfile &&
-	$doit $mvcmd $dsttmp $dstdir/$dstfile 
-
-fi &&
-
-
-exit 0
diff --git a/libresample.pc.in b/libresample.pc.in
new file mode 100644
index 0000000..c984e74
--- /dev/null
+++ b/libresample.pc.in
@@ -0,0 +1,7 @@
+prefix=${CMAKE_INSTALL_PREFIX}
+
+Name: libresample
+Description: A real-time library for audio sampling rate conversion
+Version: 0.1.3
+Cflags: ${CMAKE_C_FLAGS}
+Libs: ${CMAKE_SHARED_LINKER_FLAGS} -lm
diff --git a/src/configtemplate.h b/src/configtemplate.h
index 94ae1ce..bc1cd71 100644
--- a/src/configtemplate.h
+++ b/src/configtemplate.h
@@ -3,5 +3,5 @@
    use this file as a template to create config.h
 */
 
-#undef HAVE_INTTYPES_H
+#cmakedefine HAVE_INTTYPES_H
 
diff --git a/src/resample_defs.h b/src/resample_defs.h
index 576c1bc..ccaf3ee 100644
--- a/src/resample_defs.h
+++ b/src/resample_defs.h
@@ -52,7 +52,7 @@
 #define SGN(x)   ((x)<0   ?(-1):((x)==0?(0):(1)))
 #endif
 
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
   #include <inttypes.h>
   typedef char           BOOL;
   typedef int32_t        WORD;
diff --git a/win/libresample.dsp b/win/libresample.dsp
deleted file mode 100644
index 4ebb51e..0000000
--- a/win/libresample.dsp
+++ /dev/null
@@ -1,116 +0,0 @@
-# Microsoft Developer Studio Project File - Name="libresample" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=libresample - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "libresample.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "libresample.mak" CFG="libresample - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "libresample - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "libresample - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "libresample - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"libresample.lib"
-
-!ELSEIF  "$(CFG)" == "libresample - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"libresampled.lib"
-
-!ENDIF 
-
-# Begin Target
-
-# Name "libresample - Win32 Release"
-# Name "libresample - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\src\filterkit.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\resample.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\resamplesubs.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\src\filterkit.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\include\libresample.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\resample_defs.h
-# End Source File
-# End Group
-# End Target
-# End Project


Index: libresample.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libresample/devel/libresample.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- libresample.spec	11 Feb 2008 20:10:02 -0000	1.5
+++ libresample.spec	13 Sep 2008 13:45:27 -0000	1.6
@@ -1,12 +1,17 @@
 Summary: A real-time library for audio sampling rate conversion
 Name: libresample
 Version: 0.1.3
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 URL: http://ccrma-www.stanford.edu/~jos/resample/Free_Resampling_Software.html
 Source0: http://ccrma.stanford.edu/~jos/resample/libresample-%{version}.tgz
+Patch0: libresample-0.1.3-shlib-cmake.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: cmake >= 2.6
+BuildRequires: doxygen
+BuildRequires: libsndfile-devel
+BuildRequires: libsamplerate-devel
 
 %description
 A real-time library for audio sampling rate conversion providing
@@ -35,23 +40,25 @@
 %package devel
 Summary: Development files for libresample
 Group: Development/Libraries
+Requires: libresample = %{version}-%{release}
 
 %description devel
 Development files for libresample.
 
 %prep
-%setup -q
+%setup0 -q
+%patch0 -p1
 
 %build
-%configure
-make %{?_smp_mflags}
+%cmake .
+make VERBOSE=1 %{?_smp_mflags}
 
 %install
 rm -rf %{buildroot}
-mkdir -p %{buildroot}%{_includedir}
-mkdir -p %{buildroot}%{_libdir}
-install -m644 include/libresample.h %{buildroot}%{_includedir}
-install -m644 libresample.a %{buildroot}%{_libdir}
+make install DESTDIR=%{buildroot}
+
+%check
+ctest .
 
 %clean
 rm -rf %{buildroot}
@@ -60,13 +67,23 @@
 
 %postun -p /sbin/ldconfig
 
-%files devel
+%files
 %defattr(-,root,root,-)
 %doc LICENSE.txt README.txt
+%{_bindir}/resample-sndfile
+%{_libdir}/libresample.so.*
+
+%files devel
+%defattr(-,root,root,-)
+%doc LICENSE.txt README.txt docs/html
 %{_includedir}/libresample.h
-%{_libdir}/libresample.a
+%{_libdir}/libresample.so
+%{_libdir}/pkgconfig/libresample.pc
 
 %changelog
+* Thu Sep 11 2008 Jeffrey C. Ollie <jeff at ocjtech.us> - 0.1.3-6
+- Add a patch that switches to cmake for building and build a shared library.
+
 * Mon Feb 11 2008 Jeffrey C. Ollie <jeff at ocjtech.us> - 0.1.3-5
 - Rebuild for GCC 4.3
 




More information about the fedora-extras-commits mailing list