98cd245
Summary:        Real-time Midi I/O Library
98cd245
Name:           portmidi
f6ea614
Version:        217
55c74c1
Release:        9%{?dist}
98cd245
License:        MIT
98cd245
Group:          System Environment/Libraries
98cd245
URL:            http://portmedia.sourceforge.net/
98cd245
Source0:        http://downloads.sourceforge.net/portmedia/%{name}-src-%{version}.zip
9ac4231
Source1:        pmdefaults.desktop
9ac4231
# Build fixes:
9ac4231
Patch0:         portmidi-cmake.patch
70c469c
# Fix multilib conflict RHBZ#831432
70c469c
Patch1:         portmidi-no_date_footer.patch
9ac4231
BuildRequires:  alsa-lib-devel
9ac4231
BuildRequires:  cmake
9ac4231
BuildRequires:  desktop-file-utils
70c469c
BuildRequires:  java-devel >= 1.7
9ac4231
BuildRequires:  jpackage-utils
f6ea614
BuildRequires:  python2-devel
9ac4231
BuildRequires:  doxygen
9ac4231
BuildRequires:  tex(latex)
98cd245
98cd245
%description
98cd245
PortMedia is a set of simple clean APIs and cross-platform library
f6ea614
implementations for music and other media. PortMidi sub-project provides a
98cd245
real-time MIDI input/output library. This package contains the PortMidi
9ac4231
libraries.
98cd245
98cd245
%package devel
98cd245
Summary:        Headers for developing programs that will use %{name}
98cd245
Group:          System Environment/Libraries
70c469c
Requires:       %{name}%{?_isa} = %{version}-%{release}
98cd245
98cd245
%description devel
98cd245
PortMedia is a set of simple clean APIs and cross-platform library
f6ea614
implementations for music and other media. PortMidi sub-project provides a
98cd245
real-time MIDI input/output library. This package contains the header files
98cd245
and the documentation of PortMidi libraries.
98cd245
272c92b
%package -n python-%{name}
272c92b
Summary:        Python wrapper for %{name}
272c92b
Group:          System Environment/Libraries
70c469c
Requires:       %{name}%{?_isa} = %{version}-%{release}
272c92b
272c92b
%description -n python-%{name}
272c92b
PortMedia is a set of simple clean APIs and cross-platform library
f6ea614
implementations for music and other media. PortMidi sub-project provides a
272c92b
real-time MIDI input/output library. This package contains the python
272c92b
bindings of PortMidi libraries. It can send and receive MIDI data in
272c92b
real-time from Python.
272c92b
9ac4231
%package tools
Daniel Drake 5546faf
Summary:          Tools to configure and use %{name}
Daniel Drake 5546faf
Group:            Applications/Multimedia
Daniel Drake 5546faf
Requires:         hicolor-icon-theme
70c469c
Requires:         java >= 1.7
Daniel Drake 5546faf
Requires:         jpackage-utils
70c469c
Requires:         %{name}%{?_isa} = %{version}-%{release}
9ac4231
9ac4231
%description tools
9ac4231
PortMedia is a set of simple clean APIs and cross-platform library
f6ea614
implementations for music and other media. PortMidi sub-project provides a
9ac4231
real-time MIDI input/output library. This package contains the PortMidi
9ac4231
configuration utility "pmdefaults" and some test applications.
98cd245
98cd245
%prep
98cd245
%setup -q -n %{name}
9ac4231
%patch0 -p1 -b .buildfix
70c469c
%patch1 -p1 -b .no.date
9ac4231
9ac4231
# ewwww... binaries
9ac4231
rm -f portmidi_cdt.zip */*.exe */*/*.exe
98cd245
9ac4231
# Fix permissons and encoding issues:
98cd245
find . -name "*.c" -exec chmod -x {} \;
98cd245
find . -name "*.h" -exec chmod -x {} \;
9ac4231
for i in *.txt */*.txt */*/*.txt ; do
9ac4231
   chmod -x $i
98cd245
   sed 's|\r||' $i > $i.tmp
98cd245
   touch -r $i $i.tmp
98cd245
   mv -f $i.tmp $i
98cd245
done
98cd245
9ac4231
# Fedora's jni library location is different
9ac4231
sed -i 's|loadLibrary.*|load("%{_libdir}/%{name}/libpmjni.so");|' \
9ac4231
   pm_java/jportmidi/JPortMidiApi.java
9ac4231
9ac4231
# Add shebang, lib and class path
9ac4231
sed -i -e 's|^java|#!/bin/sh\njava \\\
9ac4231
   -Djava.library.path=%{_libdir}/%{name}/|' \
9ac4231
   -e 's|/usr/share/java/|%{_libdir}/%{name}/|' \
9ac4231
   pm_java/pmdefaults/pmdefaults
9ac4231
98cd245
%build
9ac4231
export JAVA_HOME=%{java_home}
f6ea614
%cmake -DCMAKE_SKIP_BUILD_RPATH=1 -DCMAKE_CACHEFILE_DIR=%{_builddir}/%{name}/build -DVERSION=%{version} .
9ac4231
make %{?_smp_flags}
98cd245
98cd245
# Build the doxygen documentation:
98cd245
doxygen
98cd245
272c92b
# Build python modules
36fe105
PYTHON_VER=$(python -c "from sys import version; print (version[:3])")
36fe105
PYTHON_INC=$(python -c "from distutils.sysconfig import get_python_inc; print get_python_inc()")
f6ea614
pushd pm_python/pyportmidi
f6ea614
   gcc %{optflags} -pthread -fPIC -c -o _pyportmidi.o -I../../pm_common \
f6ea614
       -I../../porttime -I$PYTHON_INC _pyportmidi.c
f6ea614
   gcc -shared -o _pyportmidi.so _pyportmidi.o -lportmidi -lpython$PYTHON_VER \
f6ea614
       -L../../build/Release
272c92b
popd
9ac4231
98cd245
%install
70c469c
%make_install
a08ee9d
98cd245
# Install the test applications:
98cd245
install -d %{buildroot}%{_libdir}/%{name}
272c92b
for app in latency midiclock midithread midithru mm qtest sysex test; do
9ac4231
   install -m 0755 build/Release/$app %{buildroot}%{_libdir}/%{name}/
98cd245
done
98cd245
9ac4231
# Fedora's jni library location is different
9ac4231
mv %{buildroot}%{_libdir}/libpmjni.so \
9ac4231
   %{buildroot}%{_libdir}/%{name}/
9ac4231
mv %{buildroot}%{_javadir}/pmdefaults.jar \
9ac4231
   %{buildroot}%{_libdir}/%{name}/
9ac4231
9ac4231
# pmdefaults icon
9ac4231
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/
9ac4231
install -pm 644 pm_java/pmdefaults/pmdefaults-icon.png \
9ac4231
   %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/
9ac4231
9ac4231
# desktop file
dbb87ce
mkdir -p %{buildroot}%{_datadir}/applications/
9ac4231
desktop-file-install \
dbb87ce
   --dir=%{buildroot}%{_datadir}/applications \
9ac4231
   %{SOURCE1}
9ac4231
9ac4231
# Why don't they install this header file?
9ac4231
install -pm 644 pm_common/pmutil.h %{buildroot}%{_includedir}/
9ac4231
272c92b
# Install python modules
f6ea614
mkdir -p %{buildroot}%{python_sitearch}/pyportmidi
f6ea614
pushd pm_python/pyportmidi
f6ea614
   install -pm 755 _pyportmidi.so %{buildroot}%{python_sitearch}/pyportmidi/
f6ea614
   install -pm 644 *.py %{buildroot}%{python_sitearch}/pyportmidi/
f6ea614
popd
f6ea614
f6ea614
# we don't want to provide private python extension libs
f6ea614
%{?filter_setup:
f6ea614
%filter_provides_in %{python_sitearch}/.*\.so$ 
f6ea614
%filter_setup
f6ea614
}
272c92b
821e5e8
# Remove duplicate library
821e5e8
rm -f %{buildroot}%{_libdir}/libportmidi_s.so
821e5e8
dbb87ce
%post
dbb87ce
/usr/bin/update-desktop-database &> /dev/null || :
dbb87ce
/sbin/ldconfig
98cd245
dbb87ce
%postun
dbb87ce
/usr/bin/update-desktop-database &> /dev/null || :
dbb87ce
/sbin/ldconfig
98cd245
98cd245
%files
98cd245
%doc CHANGELOG.txt license.txt
9ac4231
%{_libdir}/lib*.so.*
9ac4231
9ac4231
%files tools
821e5e8
%doc pm_java/pmdefaults/README.txt pm_cl/*
9ac4231
%{_libdir}/%{name}/
9ac4231
%{_bindir}/pmdefaults
9ac4231
%{_datadir}/icons/hicolor/128x128/apps/pmdefaults-icon.png
dbb87ce
%{_datadir}/applications/pmdefaults.desktop
9ac4231
272c92b
%files -n python-%{name}
f6ea614
%doc pm_python/README_PYTHON.txt
f6ea614
%{python_sitearch}/pyportmidi/
98cd245
98cd245
%files devel
9ac4231
%doc README.txt
70c469c
%doc html
98cd245
%{_includedir}/*
9ac4231
%{_libdir}/lib*.so
98cd245
98cd245
%changelog
dbb87ce
* Sun Aug 11 2013 Brendan Jones <brendan.jones.it@gmail.com> 217-9
dbb87ce
- Correct desktop file
dbb87ce
55c74c1
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-9
55c74c1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
55c74c1
ededc98
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-8
ededc98
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
ededc98
012a905
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-7
012a905
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
012a905
70c469c
* Tue Jun 12 2012 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 217-6
70c469c
- Fix multilib conflict RHBZ#831432
70c469c
- Don't bulid PDF doc, as it causes another multilib conflict
70c469c
- Specfile cleanup. Drop old GCJ-Java and Python bits
70c469c
cc154f3
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-5
cc154f3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
cc154f3
60b33ea
* Thu Jun 23 2011 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 217-4
60b33ea
- Fix FTBFS due to changes in cmake. RHBZ #715668
60b33ea
Daniel Drake 5546faf
* Sat May 14 2011 Daniel Drake <dsd@laptop.org> - 217-3
Daniel Drake 5546faf
- move Requires:Java to tools subpackage, its not needed by the main package
Daniel Drake 5546faf
0c94464
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-2
0c94464
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
0c94464
f6ea614
* Sat Oct 09 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 217-1
f6ea614
- Update to 217
f6ea614
36fe105
* Fri Jul 23 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 200-4
36fe105
- Fix python module build
36fe105
ddd1112
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 200-3
ddd1112
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
ddd1112
821e5e8
* Sat Jan 30 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 200-2
821e5e8
- Remove duplicate library
821e5e8
272c92b
* Sat Jan 30 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 200-1
272c92b
- Update to 200.
272c92b
- Add python subpackage
272c92b
9ac4231
* Fri Nov 27 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 184-1
9ac4231
- Update to 184. Build system uses cmake now.
9ac4231
ddd859c
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 131-4
ddd859c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
ddd859c
a08ee9d
* Tue Feb 24 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 131-3
a08ee9d
- Include pmutil.h in the devel package
a08ee9d
98cd245
* Tue Jan 27 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 131-2
98cd245
- Build and add doxygen documentation
98cd245
- Preserve some timestamps
98cd245
98cd245
* Sun Jan 11 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 131-1
98cd245
- New upstream release.
98cd245
98cd245
* Sun Dec 07 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 82-1
98cd245
- Initial release.