%global container_name qtmidi Name: qt5-qtmidi Version: 0.1 Release: 1%{?dist} Summary: Qt 5 Multimedia Library License: GPL-3.0 Url: https://gitlab.com/tp3/qtmidi Source: https://gitlab.com/tp3/qtmidi/repository/archive.tar.bz2?ref=v%{version} #/archive.tar.bz2 BuildRequires: fdupes BuildRequires: alsa-lib-devel BuildRequires: qt5-qtbase-devel #to create the forwarding headers BuildRequires: perl BuildRequires: xz %description Qt is a set of libraries for developing applications. This package contains an plugin to support MIDI input and output devices. %package devel Summary: Qt Development Kit Group: Development/Libraries/X11 Requires: %{name} = %{version} Requires: qt5-qtbase-devel Suggests: libpulse-devel Suggests: libwmf-devel Suggests: openal-soft-devel Provides: libQt5Midi-devel = %{version} Obsoletes: libQt5Midi-devel < %{version} %description devel You need this package, if you want to compile programs with qtmidi. %package private-headers-devel Summary: Non-ABI stable experimental API Group: Development/Libraries/C and C++ BuildArch: noarch Requires: %{name}-devel = %{version} Provides: libQt5Midi-private-headers-devel = %{version} Obsoletes: libQt5Midi-private-headers-devel < %{version} %description private-headers-devel This package provides private headers of libqt5-qtmidi that are normally not used by application development and that do not have any ABI or API guarantees. The packages that build against these have to require the exact Qt version. %prep # standard setup, but rename the dir in the archive, because it contains its commit hash! tar xaf %{SOURCE0} if [ $? -ne 0 ]; then exit $? fi # remove commit number and move files to build dir mv "%{container_name}-v%{version}-"* "%{container_name}-%{version}" tar caf %{SOURCE0} "%{container_name}-%{version}" %autosetup -n "%{container_name}-%{version}" #ls -A | xargs -I {} mv {} $RPM_BUILD_DIR/{} #cd $RPM_BUILD_DIR #chmod -Rf a+rX,u+w,g-w,o-w . %build #force the configure script to generate the forwarding headers (it checks whether .git directory exists) mkdir .git qmake-qt5 -r make %{?_smp_mflags} %install make INSTALL_ROOT=%{buildroot} install find %{buildroot}/ -type f -name '*.la' -delete find %{buildroot}/%{_libdir} -type f -name '*pc' -print -exec perl -pi -e "s, -L$RPM_BUILD_DIR/?\S+,,g" {} \; -exec sed -i -e "s,^moc_location=.*,moc_location=%{_lib}qt5_bindir/moc," -e "s,uic_location=.*,uic_location=%{_lib}qt5_bindir/uic," {} \; %fdupes -s %{buildroot}/%{_libqt5_includedir} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %license LICENSE.GPLv3 %doc README.md %{_libdir}/libQt5*.so.* %{_libdir}/qt5/plugins/midi %files private-headers-devel %license LICENSE.GPLv3 %doc README.md %{_includedir}/qt5/QtMidi/*/QtMidi* %files devel %license LICENSE.GPLv3 %doc README.md %{_libdir}/cmake/Qt5* %{_libdir}/libQt5*.prl %{_libdir}/libQt5*.so %{_libdir}/pkgconfig/Qt5*.pc %exclude %{_includedir}/qt5/QtMidi/*/QtMidi* %{_includedir}/qt5/QtMidi %{_libdir}/qt5/mkspecs/modules/qt_lib_*.pri %changelog * Thu May 11 2017 Greg Hellings - 0.1-1 - First Fedora package prep - Adapt upstream provided spec file, remove distro-specific portions