From a893adb933b64de2bfa968e9e3da381bd1cf5839 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Dec 14 2010 07:24:30 +0000 Subject: Sync el6 with master - Merge branch 'master' into el6 (initial el6 package) --- diff --git a/.gitignore b/.gitignore index ea39678..a3f2b98 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -portmidi-src-184.zip +portmidi-src-200.zip +/portmidi-src-217.zip diff --git a/portmidi-cmake.patch b/portmidi-cmake.patch index 5c5ca98..149de6d 100644 --- a/portmidi-cmake.patch +++ b/portmidi-cmake.patch @@ -1,18 +1,30 @@ -diff -rupN portmidi.old/CMakeLists.txt portmidi/CMakeLists.txt ---- portmidi.old/CMakeLists.txt 2009-10-19 15:36:57.000000000 -0400 -+++ portmidi/CMakeLists.txt 2009-11-27 20:20:22.000000000 -0500 -@@ -8,6 +8,7 @@ if(UNIX) - # allow user to set Release or Debug - set(CMAKE_BUILD_TYPE Release CACHE STRING - "Semicolon-separate list of supported configuration types") -+ set(PROJECT_BINARY_DIR ${CMAKE_SOURCE_DIR}/build) - # set default directories but don't override cached values... - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE} - CACHE STRING "libraries go here") diff -rupN portmidi.old/pm_common/CMakeLists.txt portmidi/pm_common/CMakeLists.txt ---- portmidi.old/pm_common/CMakeLists.txt 2009-10-19 14:41:21.000000000 -0400 -+++ portmidi/pm_common/CMakeLists.txt 2009-11-27 20:33:36.000000000 -0500 -@@ -65,15 +65,12 @@ if(UNIX) +--- portmidi.old/pm_common/CMakeLists.txt 2010-09-20 15:57:48.000000000 -0400 ++++ portmidi/pm_common/CMakeLists.txt 2010-10-09 01:14:53.000000000 -0400 +@@ -120,8 +120,8 @@ set_target_properties(pmjni PROPERTIES E + # install the libraries (Linux and Mac OS X command line) + if(UNIX) + INSTALL(TARGETS portmidi-static pmjni +- LIBRARY DESTINATION /usr/local/lib +- ARCHIVE DESTINATION /usr/local/lib) ++ LIBRARY DESTINATION ${LIB_INSTALL_DIR} ++ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) + # .h files installed by pm_dylib/CMakeLists.txt, so don't need them here + # INSTALL(FILES portmidi.h ../porttime/porttime.h + # DESTINATION /usr/local/include) +diff -rupN portmidi.old/pm_dylib/CMakeLists.txt portmidi/pm_dylib/CMakeLists.txt +--- portmidi.old/pm_dylib/CMakeLists.txt 2009-11-20 00:41:09.000000000 -0500 ++++ portmidi/pm_dylib/CMakeLists.txt 2010-10-09 01:17:32.000000000 -0400 +@@ -59,7 +59,7 @@ if(UNIX) + + set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework") + set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers) +- set(INSTALL_NAME_DIR "/usr/local/lib") ++ set(INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) + message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT}) + else(APPLE) + # LINUX settings... +@@ -75,11 +75,7 @@ if(UNIX) # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation # because JAVA_INCLUDE_PATH2 is pretty obscure) @@ -22,67 +34,34 @@ diff -rupN portmidi.old/pm_common/CMakeLists.txt portmidi/pm_common/CMakeLists.t - # libjvm.so is found relative to JAVA_INCLUDE_PATH: - set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so) + set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}) -+ set(LINUXSRC pmlinuxalsa pmlinux finddefault) prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC}) -- list(APPEND LIBSRC ../porttime/ptlinux) -+ set(LIBPTSRC ../porttime/ptlinux) - - set(PM_NEEDED_LIBS pthread asound) - endif(APPLE) -@@ -98,29 +95,29 @@ set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${J - # this completes the list of library sources by adding shared code - list(APPEND LIBSRC pmutil portmidi) - --# now add the shared files to make the complete list of library sources --add_library(portmidi-static ${LIBSRC}) --set_target_properties(portmidi-static PROPERTIES OUTPUT_NAME "portmidi_s") --target_link_libraries(portmidi-static ${PM_NEEDED_LIBS}) -+add_library(porttime-dynamic SHARED ${LIBPTSRC}) -+set_target_properties(porttime-dynamic PROPERTIES SOVERSION 0 VERSION 0.${VERSION} OUTPUT_NAME "porttime") -+target_link_libraries(porttime-dynamic pthread) +@@ -114,14 +110,14 @@ prepend_path(SHARED_PATHS ../pm_common/ + list(APPEND LIBSRC ${SHARED_PATHS}) add_library(portmidi-dynamic SHARED ${LIBSRC}) -set_target_properties(portmidi-dynamic PROPERTIES OUTPUT_NAME "portmidi") --target_link_libraries(portmidi-dynamic ${PM_NEEDED_LIBS}) -- -+add_dependencies(portmidi-dynamic porttime-dynamic) -+set_target_properties(portmidi-dynamic PROPERTIES LINK_FLAGS "-L../build/Release" SOVERSION 0 VERSION 0.${VERSION} OUTPUT_NAME "portmidi") -+target_link_libraries(portmidi-dynamic ${PM_NEEDED_LIBS} porttime) - - # define the jni library - include_directories(${JAVA_INCLUDE_PATHS}) ++set_target_properties(portmidi-dynamic PROPERTIES LINK_FLAGS "-L${CMAKE_CACHEFILE_DIR}/Release" SOVERSION 0 VERSION 0.${VERSION} OUTPUT_NAME "portmidi") + target_link_libraries(portmidi-dynamic ${PM_NEEDED_LIBS}) - set(JNISRC ${LIBSRC} ../pm_java/pmjni/pmjni.c) - add_library(pmjni SHARED ${JNISRC}) --target_link_libraries(pmjni ${JNI_EXTRA_LIBS}) --set_target_properties(pmjni PROPERTIES EXECUTABLE_EXTENSION "jnilib") -+add_dependencies(pmjni porttime-dynamic) -+target_link_libraries(pmjni ${JNI_EXTRA_LIBS} porttime) -+set_target_properties(pmjni PROPERTIES LINK_FLAGS "-L../build/Release" EXECUTABLE_EXTENSION "jnilib") - - # install the libraries (Linux only) - if(UNIX AND NOT APPLE) -- INSTALL(TARGETS portmidi-static portmidi-dynamic pmjni + # install the libraries (Linux and Mac OS X command line) + if(UNIX) + INSTALL(TARGETS portmidi-dynamic - LIBRARY DESTINATION /usr/local/lib - ARCHIVE DESTINATION /usr/local/lib) -+ INSTALL(TARGETS porttime-dynamic portmidi-dynamic pmjni + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) - INSTALL(FILES portmidi.h ../porttime/porttime.h + INSTALL(FILES ../pm_common/portmidi.h ../porttime/porttime.h - DESTINATION /usr/local/include) + DESTINATION ${INCLUDE_INSTALL_DIR}) - endif(UNIX AND NOT APPLE) + endif(UNIX) diff -rupN portmidi.old/pm_java/CMakeLists.txt portmidi/pm_java/CMakeLists.txt ---- portmidi.old/pm_java/CMakeLists.txt 2009-10-14 14:04:06.000000000 -0400 -+++ portmidi/pm_java/CMakeLists.txt 2009-11-27 20:20:22.000000000 -0500 -@@ -39,9 +39,9 @@ if(UNIX) - - # install the libraries (Linux only) +--- portmidi.old/pm_java/CMakeLists.txt 2009-11-04 10:20:44.000000000 -0500 ++++ portmidi/pm_java/CMakeLists.txt 2010-10-09 01:18:10.000000000 -0400 +@@ -41,7 +41,7 @@ if(UNIX) INSTALL(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar -- DESTINATION /usr/share/java) -+ DESTINATION ${SHARE_INSTALL_PREFIX}/java) + DESTINATION /usr/share/java) INSTALL(PROGRAMS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults - DESTINATION /usr/local/bin) + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) @@ -90,15 +69,14 @@ diff -rupN portmidi.old/pm_java/CMakeLists.txt portmidi/pm_java/CMakeLists.txt endif(UNIX) # In windows, use pm_java/make.bat diff -rupN portmidi.old/pm_test/CMakeLists.txt portmidi/pm_test/CMakeLists.txt ---- portmidi.old/pm_test/CMakeLists.txt 2009-10-19 14:41:21.000000000 -0400 -+++ portmidi/pm_test/CMakeLists.txt 2009-11-27 20:20:22.000000000 -0500 -@@ -8,7 +8,8 @@ endif(APPLE) +--- portmidi.old/pm_test/CMakeLists.txt 2010-09-20 15:57:48.000000000 -0400 ++++ portmidi/pm_test/CMakeLists.txt 2010-10-09 02:36:31.000000000 -0400 +@@ -12,7 +12,7 @@ endif(WIN32) macro(make_a_test name) add_executable(${name} ${name}.c) - target_link_libraries(${name} portmidi-static ${PM_NEEDED_LIBS}) -+ set_target_properties(${name} PROPERTIES LINK_FLAGS "-L${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}") -+ target_link_libraries(${name} portmidi-dynamic ${PM_NEEDED_LIBS}) ++ target_link_libraries(${name} portmidi-dynamic) + add_dependencies(${name} portmidi-static) endmacro(make_a_test) - make_a_test(test) diff --git a/portmidi.spec b/portmidi.spec index 18b28b2..c8d8581 100644 --- a/portmidi.spec +++ b/portmidi.spec @@ -1,7 +1,8 @@ +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %global with_gcj %{!?_without_gcj:1}%{?_without_gcj:0} Summary: Real-time Midi I/O Library Name: portmidi -Version: 184 +Version: 217 Release: 1%{?dist} License: MIT Group: System Environment/Libraries @@ -16,6 +17,7 @@ BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: java-devel >= 1.5 BuildRequires: jpackage-utils +BuildRequires: python2-devel BuildRequires: doxygen BuildRequires: tex(latex) BuildRequires: java-gcj-compat-devel >= 1.0.31 @@ -24,7 +26,7 @@ Requires(postun): java-gcj-compat >= 1.0.31 %description PortMedia is a set of simple clean APIs and cross-platform library -implementations for music and other media. PortMidi subproject provides a +implementations for music and other media. PortMidi sub-project provides a real-time MIDI input/output library. This package contains the PortMidi libraries. @@ -35,10 +37,22 @@ Requires: %{name} = %{version}-%{release} %description devel PortMedia is a set of simple clean APIs and cross-platform library -implementations for music and other media. PortMidi subproject provides a +implementations for music and other media. PortMidi sub-project provides a real-time MIDI input/output library. This package contains the header files and the documentation of PortMidi libraries. +%package -n python-%{name} +Summary: Python wrapper for %{name} +Group: System Environment/Libraries +Requires: %{name} = %{version}-%{release} + +%description -n python-%{name} +PortMedia is a set of simple clean APIs and cross-platform library +implementations for music and other media. PortMidi sub-project provides a +real-time MIDI input/output library. This package contains the python +bindings of PortMidi libraries. It can send and receive MIDI data in +real-time from Python. + %package tools Summary: Tools to configure and use %{name} Group: Applications/Multimedia @@ -49,7 +63,7 @@ Requires: %{name} = %{version}-%{release} %description tools PortMedia is a set of simple clean APIs and cross-platform library -implementations for music and other media. PortMidi subproject provides a +implementations for music and other media. PortMidi sub-project provides a real-time MIDI input/output library. This package contains the PortMidi configuration utility "pmdefaults" and some test applications. @@ -83,7 +97,7 @@ sed -i -e 's|^java|#!/bin/sh\njava \\\ %build export JAVA_HOME=%{java_home} -%cmake -DVERSION=%{version} . +%cmake -DCMAKE_SKIP_BUILD_RPATH=1 -DCMAKE_CACHEFILE_DIR=%{_builddir}/%{name}/build -DVERSION=%{version} . make %{?_smp_flags} # Build the doxygen documentation: @@ -92,6 +106,15 @@ pushd latex make %{?_smp_flags} popd +# Build python modules +PYTHON_VER=$(python -c "from sys import version; print (version[:3])") +PYTHON_INC=$(python -c "from distutils.sysconfig import get_python_inc; print get_python_inc()") +pushd pm_python/pyportmidi + gcc %{optflags} -pthread -fPIC -c -o _pyportmidi.o -I../../pm_common \ + -I../../porttime -I$PYTHON_INC _pyportmidi.c + gcc -shared -o _pyportmidi.so _pyportmidi.o -lportmidi -lpython$PYTHON_VER \ + -L../../build/Release +popd %install rm -rf %{buildroot} @@ -99,7 +122,7 @@ make install DESTDIR=%{buildroot} # Install the test applications: install -d %{buildroot}%{_libdir}/%{name} -for app in latency midiclock midithread midithru mm sysex test; do +for app in latency midiclock midithread midithru mm qtest sysex test; do install -m 0755 build/Release/$app %{buildroot}%{_libdir}/%{name}/ done @@ -117,18 +140,33 @@ install -pm 644 pm_java/pmdefaults/pmdefaults-icon.png \ # desktop file mkdir -p %{buildroot}%{_desktopdir}/ desktop-file-install \ - --dir=${RPM_BUILD_ROOT}%{_desktopdir} \ + --dir=%{buildroot}%{_desktopdir} \ %{SOURCE1} # Why don't they install this header file? install -pm 644 pm_common/pmutil.h %{buildroot}%{_includedir}/ +# Install python modules +mkdir -p %{buildroot}%{python_sitearch}/pyportmidi +pushd pm_python/pyportmidi + install -pm 755 _pyportmidi.so %{buildroot}%{python_sitearch}/pyportmidi/ + install -pm 644 *.py %{buildroot}%{python_sitearch}/pyportmidi/ +popd + +# we don't want to provide private python extension libs +%{?filter_setup: +%filter_provides_in %{python_sitearch}/.*\.so$ +%filter_setup +} + +# Remove duplicate library +rm -f %{buildroot}%{_libdir}/libportmidi_s.so + # AOT bits %if %{with_gcj} %{_bindir}/aot-compile-rpm %endif - %clean rm -rf %{buildroot} @@ -159,7 +197,7 @@ rm -rf %{buildroot} %files tools %defattr(-,root,root,-) -%doc pm_java/pmdefaults/README.txt +%doc pm_java/pmdefaults/README.txt pm_cl/* %{_libdir}/%{name}/ %{_bindir}/pmdefaults %{_datadir}/icons/hicolor/128x128/apps/pmdefaults-icon.png @@ -168,6 +206,10 @@ rm -rf %{buildroot} %{_libdir}/gcj/%{name}/ %endif +%files -n python-%{name} +%defattr(-,root,root,-) +%doc pm_python/README_PYTHON.txt +%{python_sitearch}/pyportmidi/ %files devel %defattr(-,root,root,-) @@ -177,6 +219,22 @@ rm -rf %{buildroot} %{_libdir}/lib*.so %changelog +* Sat Oct 09 2010 Orcan Ogetbil 217-1 +- Update to 217 + +* Fri Jul 23 2010 Orcan Ogetbil 200-4 +- Fix python module build + +* Wed Jul 21 2010 David Malcolm - 200-3 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Sat Jan 30 2010 Orcan Ogetbil 200-2 +- Remove duplicate library + +* Sat Jan 30 2010 Orcan Ogetbil 200-1 +- Update to 200. +- Add python subpackage + * Fri Nov 27 2009 Orcan Ogetbil 184-1 - Update to 184. Build system uses cmake now. diff --git a/sources b/sources index 59a6efd..06b5962 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6d242a5cfe802cace10af733c185d1b6 portmidi-src-184.zip +03f46fd3947e2ef4c8c465baaf832241 portmidi-src-217.zip