3 %bcond_without qt4 # build Qt4
4 %bcond_without qt5 # build Qt5
6 # last commit to qtsingleapplication subdir in
7 # https://qt.gitorious.org/qt-solutions/qt-solutions/
8 %define commit ad9bc4600ce769a8b3ad10910803cd555811b70c
9 Summary: Qt library to start applications only once per user
10 Name: QtSingleApplication
13 License: GPL v3 or LGPL v2 with exceptions
15 Source0: https://github.com/qtproject/qt-solutions/archive/%{commit}/%{name}-%{commit}.tar.gz
16 # Source0-md5: 07f01898ad475c5cded2968d25bee85c
17 Source1: qtsingleapplication.prf
18 Source2: qtsinglecoreapplication.prf
19 Patch0: qtsingleapplication-build.diff
20 Patch1: qtlockedfile.patch
21 Patch2: clementine.patch
23 URL: http://doc.qt.digia.com/solutions/4/qtsingleapplication/qtsingleapplication.html
24 BuildRequires: glibc-misc
25 BuildRequires: libstdc++-devel
27 BuildRequires: QtGui-devel
28 BuildRequires: QtLockedFile-devel
29 BuildRequires: QtNetwork-devel
30 BuildRequires: qt4-build
31 BuildRequires: qt4-qmake
34 BuildRequires: Qt5Core-devel
35 BuildRequires: Qt5Gui-devel
36 BuildRequires: Qt5LockedFile-devel
37 BuildRequires: Qt5Network-devel
38 BuildRequires: Qt5Widgets-devel
39 BuildRequires: qt5-build
40 BuildRequires: qt5-qmake >= 5.4
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 %define qt4dir %{_datadir}/qt4
45 %define qt5dir %{_libdir}/qt5
48 For some applications it is useful or even critical that they are
49 started only once by any user. Future attempts to start the
50 application should activate any already running instance, and possibly
51 perform requested actions, e.g. loading a file, in that instance.
53 The QtSingleApplication class provides an interface to detect a
54 running instance, and to send command strings to that instance.
56 For console (non-GUI) applications, the QtSingleCoreApplication
57 variant is provided, which avoids dependency on QtGui.
60 Summary: Development files for QtSingleApplication
61 Group: Development/Libraries
62 Requires: %{name} = %{version}-%{release}
65 This package contains libraries and header files for developing
66 applications that use QtSingleApplication.
68 %package -n Qt5SingleApplication
69 Summary: Qt library to start applications only once per user
72 %description -n Qt5SingleApplication
73 For some applications it is useful or even critical that they are
74 started only once by any user. Future attempts to start the
75 application should activate any already running instance, and possibly
76 perform requested actions, e.g. loading a file, in that instance.
78 The QtSingleApplication class provides an interface to detect a
79 running instance, and to send command strings to that instance.
81 For console (non-GUI) applications, the QtSingleCoreApplication
82 variant is provided, which avoids dependency on QtGui.
84 %package -n Qt5SingleApplication-devel
85 Summary: Development files for Qt5SingleApplication library
86 Group: Development/Libraries
87 Requires: Qt5SingleApplication = %{version}-%{release}
89 %description -n Qt5SingleApplication-devel
90 This package contains libraries and header files for developing
91 applications that use Qt5SingleApplication.
95 mv qt-solutions-* .qtsolutions
96 mv .qtsolutions/qtsingleapplication/* .
102 # We already disabled bundling this external library.
103 # But just to make sure:
104 rm src/{QtLocked,qtlocked}*
107 install -d build-qt{4,5}
108 cp -al "$@" build-qt4
109 cp -al "$@" build-qt5
114 # Does not use GNU configure
119 # ensure the it links to right version of LockedFile
120 for l in SingleApplication SingleCoreApplication; do
121 f=libQtSolutions_$l-2.6.so
122 ldd lib/$f | grep libQtSolutions_LockedFile
130 # XXX fix QtLockedFile package?
131 qmake-qt5 INCLUDEPATH+=%{_includedir}/qt5/QtSolutions
134 # ensure the it links to right version of LockedFile
135 for l in SingleApplication SingleCoreApplication; do
136 f=libQt5Solutions_$l-2.6.so
137 ldd lib/$f | grep libQt5Solutions_LockedFile
143 rm -rf $RPM_BUILD_ROOT
146 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt4/QtSolutions,%{qt4dir}/mkspecs/features}
147 cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
148 rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0
149 cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt4/QtSolutions
150 cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{qt4dir}/mkspecs/features
156 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt5/QtSolutions,%{qt5dir}/mkspecs/features}
157 cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
158 rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0
159 cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt5/QtSolutions
160 cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{qt5dir}/mkspecs/features
166 rm -rf $RPM_BUILD_ROOT
168 %post -p /sbin/ldconfig
169 %postun -p /sbin/ldconfig
171 %post -n Qt5SingleApplication -p /sbin/ldconfig
172 %postun -n Qt5SingleApplication -p /sbin/ldconfig
176 %defattr(644,root,root,755)
178 %attr(755,root,root) %{_libdir}/libQtSolutions_SingleApplication-2.6.so.*.*.*
179 %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_SingleApplication-2.6.so.1
180 %attr(755,root,root) %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so.*.*.*
181 %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so.1
184 %defattr(644,root,root,755)
186 %{_libdir}/libQtSolutions_SingleApplication-2.6.so
187 %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so
188 %{_includedir}/qt4/QtSolutions/QtSingleApplication
189 %{_includedir}/qt4/QtSolutions/QtSingleCoreApplication
190 %{_includedir}/qt4/QtSolutions/qtsingleapplication.h
191 %{_includedir}/qt4/QtSolutions/qtsinglecoreapplication.h
192 %{qt4dir}/mkspecs/features/qtsingleapplication.prf
193 %{qt4dir}/mkspecs/features/qtsinglecoreapplication.prf
197 %files -n Qt5SingleApplication
198 %defattr(644,root,root,755)
200 %attr(755,root,root) %{_libdir}/libQt5Solutions_SingleApplication-2.6.so.*.*.*
201 %attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_SingleApplication-2.6.so.1
202 %attr(755,root,root) %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so.*.*.*
203 %attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so.1
205 %files -n Qt5SingleApplication-devel
206 %defattr(644,root,root,755)
208 %{_libdir}/libQt5Solutions_SingleApplication-2.6.so
209 %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so
210 %{_includedir}/qt5/QtSolutions/QtSingleApplication
211 %{_includedir}/qt5/QtSolutions/QtSingleCoreApplication
212 %{_includedir}/qt5/QtSolutions/qtsingleapplication.h
213 %{_includedir}/qt5/QtSolutions/qtsinglecoreapplication.h
214 %{qt5dir}/mkspecs/features/qtsingleapplication.prf
215 %{qt5dir}/mkspecs/features/qtsinglecoreapplication.prf