98cd24
Summary:        Real-time Midi I/O Library
98cd24
Name:           portmidi
f6ea61
Version:        217
faa3b4
Release:        31%{?dist}
98cd24
License:        MIT
98cd24
URL:            http://portmedia.sourceforge.net/
98cd24
Source0:        http://downloads.sourceforge.net/portmedia/%{name}-src-%{version}.zip
9ac423
Source1:        pmdefaults.desktop
9ac423
# Build fixes:
9ac423
Patch0:         portmidi-cmake.patch
70c469
# Fix multilib conflict RHBZ#831432
70c469
Patch1:         portmidi-no_date_footer.patch
4417e2
Patch2:         portmidi-217-format-security.patch
4e362e
Patch3:         portmidi-no.c++.patch
a9c77f
Patch4:         portmidi-cyrex-0.21.patch
9ac423
BuildRequires:  alsa-lib-devel
9ac423
BuildRequires:  cmake
9ac423
BuildRequires:  desktop-file-utils
70c469
BuildRequires:  java-devel >= 1.7
9ac423
BuildRequires:  jpackage-utils
702a6d
BuildRequires:  python3-devel
a9c77f
BuildRequires:  python3-Cython
9ac423
BuildRequires:  doxygen
9ac423
BuildRequires:  tex(latex)
4e362e
BuildRequires:  gcc
98cd24
98cd24
%description
98cd24
PortMedia is a set of simple clean APIs and cross-platform library
f6ea61
implementations for music and other media. PortMidi sub-project provides a
98cd24
real-time MIDI input/output library. This package contains the PortMidi
9ac423
libraries.
98cd24
98cd24
%package devel
98cd24
Summary:        Headers for developing programs that will use %{name}
70c469
Requires:       %{name}%{?_isa} = %{version}-%{release}
98cd24
98cd24
%description devel
98cd24
PortMedia is a set of simple clean APIs and cross-platform library
f6ea61
implementations for music and other media. PortMidi sub-project provides a
98cd24
real-time MIDI input/output library. This package contains the header files
98cd24
and the documentation of PortMidi libraries.
98cd24
702a6d
%package -n python3-%{name}
702a6d
Summary:        Python 3 wrapper for %{name}
702a6d
Requires:       %{name}%{?_isa} = %{version}-%{release}
702a6d
702a6d
%description -n python3-%{name}
702a6d
PortMedia is a set of simple clean APIs and cross-platform library
702a6d
implementations for music and other media. PortMidi sub-project provides a
702a6d
real-time MIDI input/output library. This package contains the python
702a6d
bindings of PortMidi libraries. It can send and receive MIDI data in
702a6d
real-time from Python 3.
702a6d
9ac423
%package tools
Daniel Drake 5546fa
Summary:          Tools to configure and use %{name}
Daniel Drake 5546fa
Requires:         hicolor-icon-theme
70c469
Requires:         java >= 1.7
Daniel Drake 5546fa
Requires:         jpackage-utils
70c469
Requires:         %{name}%{?_isa} = %{version}-%{release}
9ac423
9ac423
%description tools
9ac423
PortMedia is a set of simple clean APIs and cross-platform library
f6ea61
implementations for music and other media. PortMidi sub-project provides a
9ac423
real-time MIDI input/output library. This package contains the PortMidi
9ac423
configuration utility "pmdefaults" and some test applications.
98cd24
98cd24
%prep
98cd24
%setup -q -n %{name}
9ac423
%patch0 -p1 -b .buildfix
70c469
%patch1 -p1 -b .no.date
4417e2
%patch2 -p1 -b .fmt.security
4e362e
%patch3 -p1 -b .no.c++
a9c77f
%patch4 -p1 -b .pyrex021
a9c77f
a9c77f
# generate Cython C files during build
a9c77f
rm -f pm_python/pyportmidi/_pyportmidi.c
9ac423
9ac423
# ewwww... binaries
9ac423
rm -f portmidi_cdt.zip */*.exe */*/*.exe
98cd24
9ac423
# Fix permissons and encoding issues:
98cd24
find . -name "*.c" -exec chmod -x {} \;
98cd24
find . -name "*.h" -exec chmod -x {} \;
9ac423
for i in *.txt */*.txt */*/*.txt ; do
9ac423
   chmod -x $i
98cd24
   sed 's|\r||' $i > $i.tmp
98cd24
   touch -r $i $i.tmp
98cd24
   mv -f $i.tmp $i
98cd24
done
98cd24
9ac423
# Fedora's jni library location is different
9ac423
sed -i 's|loadLibrary.*|load("%{_libdir}/%{name}/libpmjni.so");|' \
9ac423
   pm_java/jportmidi/JPortMidiApi.java
9ac423
9ac423
# Add shebang, lib and class path
9ac423
sed -i -e 's|^java|#!/bin/sh\njava \\\
9ac423
   -Djava.library.path=%{_libdir}/%{name}/|' \
9ac423
   -e 's|/usr/share/java/|%{_libdir}/%{name}/|' \
9ac423
   pm_java/pmdefaults/pmdefaults
9ac423
98cd24
%build
9ac423
export JAVA_HOME=%{java_home}
f6ea61
%cmake -DCMAKE_SKIP_BUILD_RPATH=1 -DCMAKE_CACHEFILE_DIR=%{_builddir}/%{name}/build -DVERSION=%{version} .
9ac423
make %{?_smp_flags}
98cd24
98cd24
# Build the doxygen documentation:
98cd24
doxygen
98cd24
272c92
# Build python modules
f6ea61
pushd pm_python/pyportmidi
a9c77f
   cython -2 _pyportmidi.pyx
f6ea61
   gcc %{optflags} -pthread -fPIC -c -o _pyportmidi.o -I../../pm_common \
a99bf3
       -I../../porttime $(python3-config --includes) _pyportmidi.c
a99bf3
   gcc -shared -o _pyportmidi.so _pyportmidi.o -lportmidi $(python3-config --libs) \
f6ea61
       -L../../build/Release
272c92
popd
9ac423
98cd24
%install
70c469
%make_install
a08ee9
98cd24
# Install the test applications:
98cd24
install -d %{buildroot}%{_libdir}/%{name}
272c92
for app in latency midiclock midithread midithru mm qtest sysex test; do
9ac423
   install -m 0755 build/Release/$app %{buildroot}%{_libdir}/%{name}/
98cd24
done
98cd24
9ac423
# Fedora's jni library location is different
9ac423
mv %{buildroot}%{_libdir}/libpmjni.so \
9ac423
   %{buildroot}%{_libdir}/%{name}/
9ac423
mv %{buildroot}%{_javadir}/pmdefaults.jar \
9ac423
   %{buildroot}%{_libdir}/%{name}/
9ac423
9ac423
# pmdefaults icon
9ac423
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/
9ac423
install -pm 644 pm_java/pmdefaults/pmdefaults-icon.png \
9ac423
   %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/
9ac423
9ac423
# desktop file
dbb87c
mkdir -p %{buildroot}%{_datadir}/applications/
9ac423
desktop-file-install \
dbb87c
   --dir=%{buildroot}%{_datadir}/applications \
9ac423
   %{SOURCE1}
9ac423
9ac423
# Why don't they install this header file?
9ac423
install -pm 644 pm_common/pmutil.h %{buildroot}%{_includedir}/
9ac423
272c92
# Install python modules
702a6d
mkdir -p %{buildroot}%{python3_sitearch}/pyportmidi
Orcan Ogetbil cfbf01
pushd pm_python/pyportmidi
702a6d
   install -pm 755 _pyportmidi.so %{buildroot}%{python3_sitearch}/pyportmidi/
702a6d
   install -pm 644 *.py %{buildroot}%{python3_sitearch}/pyportmidi/
f6ea61
popd
f6ea61
f6ea61
# we don't want to provide private python extension libs
f6ea61
%{?filter_setup:
702a6d
%filter_provides_in %{python3_sitearch}/.*\.so$
f6ea61
%filter_setup
f6ea61
}
272c92
821e5e
# Remove duplicate library
821e5e
rm -f %{buildroot}%{_libdir}/libportmidi_s.so
821e5e
e7638d
%post -p /sbin/ldconfig
98cd24
e7638d
%postun -p /sbin/ldconfig
98cd24
98cd24
%files
4e362e
%doc CHANGELOG.txt
4e362e
%license license.txt
9ac423
%{_libdir}/lib*.so.*
9ac423
9ac423
%files tools
821e5e
%doc pm_java/pmdefaults/README.txt pm_cl/*
9ac423
%{_libdir}/%{name}/
9ac423
%{_bindir}/pmdefaults
9ac423
%{_datadir}/icons/hicolor/128x128/apps/pmdefaults-icon.png
dbb87c
%{_datadir}/applications/pmdefaults.desktop
9ac423
702a6d
%files -n python3-%{name}
702a6d
%doc pm_python/README_PYTHON.txt
702a6d
%{python3_sitearch}/pyportmidi/
98cd24
98cd24
%files devel
9ac423
%doc README.txt
70c469
%doc html
98cd24
%{_includedir}/*
9ac423
%{_libdir}/lib*.so
98cd24
98cd24
%changelog
faa3b4
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 217-31
faa3b4
- Rebuilt for Python 3.8.0rc1 (#1748018)
faa3b4
77ada7
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 217-30
77ada7
- Rebuilt for Python 3.8
77ada7
7a080f
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 217-29
7a080f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
7a080f
a9c77f
* Mon May 20 2019 Michael J Gruber <mjg@fedoraproject.org> - 217-28
a9c77f
- Generate Cython C files during build
a9c77f
9ce9e1
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 217-27
9ce9e1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
9ce9e1
Orcan Ogetbil cfbf01
* Mon Oct 01 2018 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> - 217-26
Orcan Ogetbil cfbf01
- Removed the Python2 binding
Orcan Ogetbil cfbf01
0d508b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 217-25
0d508b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
0d508b
cfb331
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 217-24
cfb331
- Rebuilt for Python 3.7
cfb331
4e362e
* Thu Mar 08 2018 Michael J Gruber <mjg@fedoraproject.org> - 217-23
4e362e
- Adjust to new guidelines (BR gcc)
4e362e
1ab5fd
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 217-22
1ab5fd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1ab5fd
c0fca5
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 217-21
c0fca5
- Python 2 binary package renamed to python2-portmidi
c0fca5
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
c0fca5
e8cc3c
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 217-20
e8cc3c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
e8cc3c
c161be
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 217-19
c161be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c161be
Igor Gnatenko 08f738
* Fri Jul 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 217-18
Igor Gnatenko 08f738
- Rebuild due to bug in RPM (RHBZ #1468476)
Igor Gnatenko 08f738
702a6d
* Thu Jun 08 2017 Gwyn Ciesla <limburgher@gmail.com> - 217-17
702a6d
- Python 3 support.
702a6d
187498
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 217-16
187498
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
187498
86aaf8
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-15
86aaf8
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
86aaf8
e10cb1
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 217-14
e10cb1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e10cb1
1e309f
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-13
1e309f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
1e309f
314626
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-12
314626
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
314626
4417e2
* Mon Jun 09 2014 Brendan Jones <brendan.jones.it@gmail.com> 217-11
4417e2
- -Wformat-security patch
4417e2
a119ae
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-10
a119ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
a119ae
dbb87c
* Sun Aug 11 2013 Brendan Jones <brendan.jones.it@gmail.com> 217-9
dbb87c
- Correct desktop file
dbb87c
55c74c
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-9
55c74c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
55c74c
ededc9
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-8
ededc9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
ededc9
012a90
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-7
012a90
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
012a90
70c469
* Tue Jun 12 2012 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> 217-6
70c469
- Fix multilib conflict RHBZ#831432
70c469
- Don't bulid PDF doc, as it causes another multilib conflict
70c469
- Specfile cleanup. Drop old GCJ-Java and Python bits
70c469
cc154f
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-5
cc154f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
cc154f
60b33e
* Thu Jun 23 2011 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> 217-4
60b33e
- Fix FTBFS due to changes in cmake. RHBZ #715668
60b33e
Daniel Drake 5546fa
* Sat May 14 2011 Daniel Drake <dsd@laptop.org> - 217-3
Daniel Drake 5546fa
- move Requires:Java to tools subpackage, its not needed by the main package
Daniel Drake 5546fa
0c9446
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 217-2
0c9446
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
0c9446
f6ea61
* Sat Oct 09 2010 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> 217-1
f6ea61
- Update to 217
f6ea61
36fe10
* Fri Jul 23 2010 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> 200-4
36fe10
- Fix python module build
36fe10
ddd111
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 200-3
ddd111
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
ddd111
821e5e
* Sat Jan 30 2010 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> 200-2
821e5e
- Remove duplicate library
821e5e
272c92
* Sat Jan 30 2010 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> 200-1
272c92
- Update to 200.
272c92
- Add python subpackage
272c92
9ac423
* Fri Nov 27 2009 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> 184-1
9ac423
- Update to 184. Build system uses cmake now.
9ac423
ddd859
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 131-4
ddd859
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
ddd859
a08ee9
* Tue Feb 24 2009 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> 131-3
a08ee9
- Include pmutil.h in the devel package
a08ee9
98cd24
* Tue Jan 27 2009 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> 131-2
98cd24
- Build and add doxygen documentation
98cd24
- Preserve some timestamps
98cd24
98cd24
* Sun Jan 11 2009 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> 131-1
98cd24
- New upstream release.
98cd24
98cd24
* Sun Dec 07 2008 Orcan Ogetbil <oget [dot]="" fedora="" [at]="" gmail="" [dot]="" com=""> 82-1
98cd24
- Initial release.