Blob Blame History Raw
%global commit 8c2c3f0bde67e64c627c903b718bec92ace28680

Summary:    Qt library to start applications only once per user
Name:       qtsingleapplication
Version:    2.6.1
Release:    18%{?dist}

License:    GPLv3 or LGPLv2 with exceptions
URL:        http://doc.qt.digia.com/solutions/4/qtsingleapplication/qtsingleapplication.html
Source0:    https://qt.gitorious.org/qt-solutions/qt-solutions/archive/%{commit}.tar.gz#/%{name}-%{commit}.tar.gz
# Proposed upstream in https://codereview.qt-project.org/#/c/92417/
Source1:    qtsingleapplication.prf
# Proposed upstream in https://codereview.qt-project.org/#/c/92416/
Source2:    qtsinglecoreapplication.prf
# Proposed upstream in https://codereview.qt-project.org/#/c/92411/
Source3:    LICENSE.GPL3
# Proposed upstream in https://codereview.qt-project.org/#/c/92411/
Source4:    LICENSE.LGPL
# Proposed upstream in https://codereview.qt-project.org/#/c/92411/
Source5:    LGPL_EXCEPTION

# Proposed upstream in https://codereview.qt-project.org/#/c/92416/
Patch0:     qtsingleapplication-build-qtsinglecoreapplication.patch
# Proposed upstream in https://codereview.qt-project.org/#/c/92415/
Patch1:     qtsingleapplication-remove-included-qtlockedfile.patch

BuildRequires: qt4-devel qtlockedfile-devel
BuildRequires: qt5-qtbase-devel qtlockedfile-qt5-devel

%description
For some applications it is useful or even critical that they are started
only once by any user. Future attempts to start the application should
activate any already running instance, and possibly perform requested
actions, e.g. loading a file, in that instance.

The QtSingleApplication class provides an interface to detect a running
instance, and to send command strings to that instance.

%package devel
Summary:    Development files for %{name}
Requires:   %{name} = %{version}-%{release}
Requires:   qt4-devel

%description devel
This package contains libraries and header files for developing applications
that use QtSingleApplication.

%package -n qtsinglecoreapplication
Summary:    Qt library to start applications only once per user
Requires:   qt4

%description -n qtsinglecoreapplication
For some applications it is useful or even critical that they are started
only once by any user. Future attempts to start the application should
activate any already running instance, and possibly perform requested
actions, e.g. loading a file, in that instance.

For console (non-GUI) applications, the QtSingleCoreApplication variant
is provided, which avoids dependency on QtGui.

%package -n qtsinglecoreapplication-devel
Summary:    Development files for qtsinglecoreapplication
Requires:   qtsinglecoreapplication = %{version}-%{release}
Requires:   qt4-devel

%description -n qtsinglecoreapplication-devel
This package contains libraries and header files for developing applications
that use QtSingleCoreApplication.

%package qt5
Summary:    Qt5 library to start applications only once per user
Requires:   qt5-qtbase

%description qt5
For some applications it is useful or even critical that they are started
only once by any user. Future attempts to start the application should
activate any already running instance, and possibly perform requested
actions, e.g. loading a file, in that instance.

This is a special build against Qt5.

%package qt5-devel
Summary:    Development files for %{name}-qt5
Requires:   %{name}-qt5 = %{version}-%{release}
Requires:   qt5-qtbase-devel

%description qt5-devel
This package contains libraries and header files for developing applications
that use QtSingleApplication with Qt5.

%package -n qtsinglecoreapplication-qt5
Summary:    Qt library to start applications only once per user (Qt5)
Requires:   qt5-qtbase

%description -n qtsinglecoreapplication-qt5
For some applications it is useful or even critical that they are started
only once by any user. Future attempts to start the application should
activate any already running instance, and possibly perform requested
actions, e.g. loading a file, in that instance.

For console (non-GUI) applications, the QtSingleCoreApplication variant
is provided, which avoids dependency on QtGui.

This is a special build against Qt5.

%package -n qtsinglecoreapplication-qt5-devel
Summary:    Development files for qtsinglecoreapplication-qt5
Requires:   qtsinglecoreapplication-qt5 = %{version}-%{release}
Requires:   qt5-qtbase-devel

%description -n qtsinglecoreapplication-qt5-devel
This package contains libraries and header files for developing applications
that use QtSingleCoreApplication.


%prep
%setup -qnqt-solutions-qt-solutions/%{name}
%patch0 -p0
%patch1 -p0

mkdir licenses
cp -p %{SOURCE3} %{SOURCE4} %{SOURCE5} licenses

# We already disabled bundling this external library.
# But just to make sure:
rm -rf ../qtlockedfile/
sed -i 's,qtlockedfile\.h,QtSolutions/\0,' src/qtlocalpeer.h
rm src/{QtLocked,qtlocked}*


%build
# Does not use GNU configure
./configure -library
%{qmake_qt4}
make %{?_smp_mflags}
mkdir qt5
pushd qt5
%{qmake_qt5} ..
make %{?_smp_mflags}
popd


%install
# libraries
mkdir -p %{buildroot}%{_libdir}
cp -a lib/* %{buildroot}%{_libdir}
chmod 755 %{buildroot}%{_libdir}/*.so*

# headers
for qtdir in %{_qt4_headerdir} %{_qt5_headerdir} ; do
 d=%{buildroot}$qtdir/QtSolutions ;
 mkdir -p $d ;
 cp -a \
    src/qtsingleapplication.h \
    src/QtSingleApplication \
    src/qtsinglecoreapplication.h \
    src/QtSingleCoreApplication \
    $d ;
done

install -p -D -m644 %{SOURCE1} %{buildroot}%{_qt4_datadir}/mkspecs/features/qtsingleapplication.prf
install -p -D -m644 %{SOURCE1} %{buildroot}%{_qt5_archdatadir}/mkspecs/features/qtsingleapplication.prf
install -p -D -m644 %{SOURCE2} %{buildroot}%{_qt4_datadir}/mkspecs/features/qtsinglecoreapplication.prf
install -p -D -m644 %{SOURCE2} %{buildroot}%{_qt5_archdatadir}/mkspecs/features/qtsinglecoreapplication.prf


%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post -n qtsinglecoreapplication -p /sbin/ldconfig

%postun -n qtsinglecoreapplication -p /sbin/ldconfig

%files
%license licenses/*
%doc README.TXT
# Caution! Unversioned so file goes into -devel
%{_qt4_libdir}/libQtSolutions_SingleApplication*.so.*

%files devel
%doc doc/html/ examples/
%{_qt4_libdir}/libQtSolutions_SingleApplication*.so
%dir %{_qt4_headerdir}/QtSolutions/
%{_qt4_headerdir}/QtSolutions/QtSingleApplication
%{_qt4_headerdir}/QtSolutions/%{name}.h
%{_qt4_datadir}/mkspecs/features/qtsingleapplication.prf

%files -n qtsinglecoreapplication
%license licenses/*
# Caution! Unversioned so file goes into -devel
%{_qt4_libdir}/libQtSolutions_SingleCoreApplication*.so.*

%files -n qtsinglecoreapplication-devel
%{_qt4_libdir}/libQtSolutions_SingleCoreApplication*.so
%dir %{_qt4_headerdir}/QtSolutions/
%{_qt4_headerdir}/QtSolutions/QtSingleCoreApplication
%{_qt4_headerdir}/QtSolutions/qtsinglecoreapplication.h
%{_qt4_datadir}/mkspecs/features/qtsinglecoreapplication.prf

%files qt5
%license licenses/*
%doc README.TXT
# Caution! Unversioned so file goes into -devel
%{_qt5_libdir}/libQt5*SingleApplication*.so.*

%files qt5-devel
%doc doc/html/ examples/
%{_qt5_libdir}/libQt5*SingleApplication*.so
%dir %{_qt5_headerdir}/QtSolutions/
%{_qt5_headerdir}/QtSolutions/QtSingleApplication
%{_qt5_headerdir}/QtSolutions/%{name}.h
%{_qt5_archdatadir}/mkspecs/features/qtsingleapplication.prf

%files -n qtsinglecoreapplication-qt5
%license licenses/*
# Caution! Unversioned so file goes into -devel
%{_qt5_libdir}/libQt5*SingleCoreApplication*.so.*

%files -n qtsinglecoreapplication-qt5-devel
%{_qt5_libdir}/libQt5*SingleCoreApplication*.so
%dir %{_qt5_headerdir}/QtSolutions/
%{_qt5_headerdir}/QtSolutions/QtSingleCoreApplication
%{_qt5_headerdir}/QtSolutions/qtsinglecoreapplication.h
%{_qt5_archdatadir}/mkspecs/features/qtsinglecoreapplication.prf


%changelog
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed May 06 2015 Rex Dieter <rdieter@fedoraproject.org> 2.6.1-17
- .prf: use versioned libs for linking

* Fri May 01 2015 Rex Dieter <rdieter@fedoraproject.org> 2.6.1-16
- .prf: use QT_INSTALL_HEADERS instead, drop DEPENDPATH

* Fri May 01 2015 Rex Dieter <rdieter@fedoraproject.org> - 2.6.1-15
- fix/simplify qt5 mkspecs/features install path
- more insurance bundled qtlockedfile is not used

* Mon Apr 27 2015 Raphael Groner <projects.rg@smart.ms> - 2.6.1-14
- bump Release to identicate BR fixes

* Sat Apr 25 2015 Raphael Groner <projects.rg@smart.ms> - 2.6.1-13
- use latest commit hash of dedicated folder at upstream
- build subpackage for Qt5
- remove deprecated spec file entries
- use license macro and improve license patches
- replace with new buildroot macro

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Fri Aug 15 2014 Fabio Alessandro Locati <fabiolocati@gmail.com> - 2.6.1-11
- Update to current repository
- Clean patches

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Wed Jan 11 2012 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6.1-6
- gcc-4.7 compilation fix

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Aug 11 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6.1-4
- Make the additional API patch backwards compatible

* Wed Jul 21 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6.1-3
- Split the qtsinglecoreapplication bits into their own subpackages

* Fri Jul 16 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6.1-2
- Add additional API to support clementine.

* Fri Jun 04 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6.1-1
- Change version to 2.6.1. Upstream uses weird version convention 2.6_1
- Own the directory %%{_qt4_headerdir}/QtSolutions/

* Sat May 01 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6-3
- Add comments to the extra source and patches
- Add a chmod 755 to make sure that the library gets the right permission

* Thu Apr 15 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6-2
- Include .prf file
- Don't bundle external qtlockedfile library
- Fix typo in the description

* Sun Apr 11 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> 2.6-1
- Initial Fedora package. Specfile partly borrowed from opensuse

* Thu Dec  3 2009 Todor Prokopov <koprok@nand.bg>
- Initial package.