]>
Commit | Line | Data |
---|---|---|
97b6f035 ER |
1 | # |
2 | # Conditional build: | |
98529ade | 3 | %bcond_without qt4 # build Qt4 |
97b6f035 ER |
4 | %bcond_without qt5 # build Qt5 |
5 | ||
5c92ed78 ER |
6 | # last commit to qtsingleapplication subdir in |
7 | # https://qt.gitorious.org/qt-solutions/qt-solutions/ | |
e3b3d3a4 | 8 | %define commit ad9bc4600ce769a8b3ad10910803cd555811b70c |
5f8c12b9 | 9 | Summary: Qt library to start applications only once per user |
310002d3 | 10 | Name: QtSingleApplication |
5c92ed78 | 11 | Version: 2.6.1 |
e3b3d3a4 | 12 | Release: 2.1 |
5f8c12b9 ER |
13 | License: GPL v3 or LGPL v2 with exceptions |
14 | Group: Libraries | |
e3b3d3a4 ER |
15 | Source0: https://github.com/qtproject/qt-solutions/archive/%{commit}/%{name}-%{commit}.tar.gz |
16 | # Source0-md5: 07f01898ad475c5cded2968d25bee85c | |
310002d3 | 17 | Source1: qtsingleapplication.prf |
099d1b50 | 18 | Source2: qtsinglecoreapplication.prf |
310002d3 | 19 | Patch0: qtsingleapplication-build.diff |
5c92ed78 | 20 | Patch1: qtlockedfile.patch |
b639dacf | 21 | Patch2: clementine.patch |
e3b3d3a4 | 22 | Patch3: version.patch |
5c92ed78 | 23 | URL: http://doc.qt.digia.com/solutions/4/qtsingleapplication/qtsingleapplication.html |
98529ade | 24 | BuildRequires: libstdc++-devel |
97b6f035 | 25 | %if %{with qt4} |
30fcf11b | 26 | BuildRequires: QtGui-devel |
310002d3 | 27 | BuildRequires: QtLockedFile-devel |
30fcf11b | 28 | BuildRequires: QtNetwork-devel |
5f8c12b9 | 29 | BuildRequires: qt4-build |
310002d3 | 30 | BuildRequires: qt4-qmake |
97b6f035 ER |
31 | %endif |
32 | %if %{with qt5} | |
33 | BuildRequires: Qt5Core-devel | |
34 | BuildRequires: Qt5Gui-devel | |
35 | BuildRequires: Qt5LockedFile-devel | |
36 | BuildRequires: Qt5Network-devel | |
37 | BuildRequires: Qt5Widgets-devel | |
38 | BuildRequires: qt5-build | |
c54a9d69 | 39 | BuildRequires: qt5-qmake >= 5.4 |
97b6f035 | 40 | %endif |
5f8c12b9 ER |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
42 | ||
dfdbbb18 | 43 | %define qt4dir %{_datadir}/qt4 |
97b6f035 | 44 | %define qt5dir %{_libdir}/qt5 |
310002d3 | 45 | |
5f8c12b9 ER |
46 | %description |
47 | For some applications it is useful or even critical that they are | |
48 | started only once by any user. Future attempts to start the | |
49 | application should activate any already running instance, and possibly | |
50 | perform requested actions, e.g. loading a file, in that instance. | |
51 | ||
52 | The QtSingleApplication class provides an interface to detect a | |
53 | running instance, and to send command strings to that instance. | |
54 | ||
55 | For console (non-GUI) applications, the QtSingleCoreApplication | |
56 | variant is provided, which avoids dependency on QtGui. | |
57 | ||
5c92ed78 | 58 | %package devel |
310002d3 | 59 | Summary: Development files for QtSingleApplication |
5f8c12b9 ER |
60 | Group: Development/Libraries |
61 | Requires: %{name} = %{version}-%{release} | |
5f8c12b9 | 62 | |
5c92ed78 | 63 | %description devel |
5f8c12b9 | 64 | This package contains libraries and header files for developing |
310002d3 | 65 | applications that use QtSingleApplication. |
5f8c12b9 | 66 | |
97b6f035 ER |
67 | %package -n Qt5SingleApplication |
68 | Summary: Qt library to start applications only once per user | |
69 | Group: Libraries | |
70 | ||
71 | %description -n Qt5SingleApplication | |
72 | For some applications it is useful or even critical that they are | |
73 | started only once by any user. Future attempts to start the | |
74 | application should activate any already running instance, and possibly | |
75 | perform requested actions, e.g. loading a file, in that instance. | |
76 | ||
77 | The QtSingleApplication class provides an interface to detect a | |
78 | running instance, and to send command strings to that instance. | |
79 | ||
80 | For console (non-GUI) applications, the QtSingleCoreApplication | |
81 | variant is provided, which avoids dependency on QtGui. | |
82 | ||
83 | %package -n Qt5SingleApplication-devel | |
84 | Summary: Development files for Qt5SingleApplication library | |
85 | Group: Development/Libraries | |
86 | Requires: Qt5SingleApplication = %{version}-%{release} | |
97b6f035 ER |
87 | |
88 | %description -n Qt5SingleApplication-devel | |
89 | This package contains libraries and header files for developing | |
c64ddd18 | 90 | applications that use Qt5SingleApplication. |
97b6f035 | 91 | |
5f8c12b9 | 92 | %prep |
5c92ed78 | 93 | %setup -qc |
e3b3d3a4 | 94 | mv qt-solutions-*/qtsingleapplication/* . |
5c92ed78 ER |
95 | %patch0 -p0 |
96 | %patch1 -p0 | |
3e0bb370 | 97 | %patch2 -p1 |
e3b3d3a4 | 98 | %patch3 -p1 |
310002d3 | 99 | |
c64ddd18 | 100 | # We already disabled bundling this external library. |
310002d3 ER |
101 | # But just to make sure: |
102 | rm src/{QtLocked,qtlocked}* | |
5f8c12b9 | 103 | |
97b6f035 ER |
104 | set -- * |
105 | install -d build-qt{4,5} | |
106 | cp -al "$@" build-qt4 | |
107 | cp -al "$@" build-qt5 | |
108 | ||
5f8c12b9 | 109 | %build |
97b6f035 ER |
110 | %if %{with qt4} |
111 | cd build-qt4 | |
5f8c12b9 | 112 | # Does not use GNU configure |
97b6f035 | 113 | ./configure -library |
dfdbbb18 | 114 | qmake-qt4 |
5f8c12b9 | 115 | %{__make} |
97b6f035 ER |
116 | cd .. |
117 | %endif | |
118 | ||
119 | %if %{with qt5} | |
120 | cd build-qt5 | |
121 | ./configure -library | |
122 | # XXX fix QtLockedFile package? | |
123 | qmake-qt5 INCLUDEPATH+=%{_includedir}/qt5/QtSolutions | |
124 | %{__make} | |
125 | cd .. | |
126 | %endif | |
5f8c12b9 ER |
127 | |
128 | %install | |
129 | rm -rf $RPM_BUILD_ROOT | |
97b6f035 ER |
130 | %if %{with qt4} |
131 | cd build-qt4 | |
dfdbbb18 | 132 | install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt4/QtSolutions,%{qt4dir}/mkspecs/features} |
5f8c12b9 ER |
133 | cp -a lib/* $RPM_BUILD_ROOT%{_libdir} |
134 | rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0 | |
dfdbbb18 ER |
135 | cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt4/QtSolutions |
136 | cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{qt4dir}/mkspecs/features | |
98529ade | 137 | cd .. |
97b6f035 ER |
138 | %endif |
139 | ||
140 | %if %{with qt5} | |
141 | cd build-qt5 | |
142 | install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt5/QtSolutions,%{qt5dir}/mkspecs/features} | |
143 | cp -a lib/* $RPM_BUILD_ROOT%{_libdir} | |
144 | rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0 | |
145 | cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt5/QtSolutions | |
146 | cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{qt5dir}/mkspecs/features | |
98529ade | 147 | cd .. |
97b6f035 | 148 | %endif |
310002d3 | 149 | |
5f8c12b9 ER |
150 | %clean |
151 | rm -rf $RPM_BUILD_ROOT | |
152 | ||
153 | %post -p /sbin/ldconfig | |
154 | %postun -p /sbin/ldconfig | |
155 | ||
97b6f035 ER |
156 | %post -n Qt5SingleApplication -p /sbin/ldconfig |
157 | %postun -n Qt5SingleApplication -p /sbin/ldconfig | |
158 | ||
159 | %if %{with qt4} | |
5f8c12b9 ER |
160 | %files |
161 | %defattr(644,root,root,755) | |
5c92ed78 | 162 | %doc README.TXT |
5c92ed78 ER |
163 | %attr(755,root,root) %{_libdir}/libQtSolutions_SingleApplication-2.6.so.*.*.* |
164 | %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_SingleApplication-2.6.so.1 | |
165 | %attr(755,root,root) %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so.*.*.* | |
166 | %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so.1 | |
5f8c12b9 ER |
167 | |
168 | %files devel | |
169 | %defattr(644,root,root,755) | |
170 | %doc doc examples | |
5c92ed78 ER |
171 | %{_libdir}/libQtSolutions_SingleApplication-2.6.so |
172 | %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so | |
7023061e ER |
173 | %{_includedir}/qt4/QtSolutions/QtSingleApplication |
174 | %{_includedir}/qt4/QtSolutions/QtSingleCoreApplication | |
175 | %{_includedir}/qt4/QtSolutions/qtsingleapplication.h | |
176 | %{_includedir}/qt4/QtSolutions/qtsinglecoreapplication.h | |
dfdbbb18 ER |
177 | %{qt4dir}/mkspecs/features/qtsingleapplication.prf |
178 | %{qt4dir}/mkspecs/features/qtsinglecoreapplication.prf | |
97b6f035 ER |
179 | %endif |
180 | ||
181 | %if %{with qt5} | |
182 | %files -n Qt5SingleApplication | |
183 | %defattr(644,root,root,755) | |
184 | %doc README.TXT | |
185 | %attr(755,root,root) %{_libdir}/libQt5Solutions_SingleApplication-2.6.so.*.*.* | |
186 | %attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_SingleApplication-2.6.so.1 | |
187 | %attr(755,root,root) %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so.*.*.* | |
188 | %attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so.1 | |
189 | ||
190 | %files -n Qt5SingleApplication-devel | |
191 | %defattr(644,root,root,755) | |
192 | %doc doc examples | |
193 | %{_libdir}/libQt5Solutions_SingleApplication-2.6.so | |
194 | %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so | |
195 | %{_includedir}/qt5/QtSolutions/QtSingleApplication | |
196 | %{_includedir}/qt5/QtSolutions/QtSingleCoreApplication | |
197 | %{_includedir}/qt5/QtSolutions/qtsingleapplication.h | |
198 | %{_includedir}/qt5/QtSolutions/qtsinglecoreapplication.h | |
199 | %{qt5dir}/mkspecs/features/qtsingleapplication.prf | |
200 | %{qt5dir}/mkspecs/features/qtsinglecoreapplication.prf | |
201 | %endif |