]>
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 | |
8cc77028 | 15 | Source0: https://github.com/qtproject/qt-solutions/archive/%{commit}/%{name}-%{commit}.tar.gz |
e3b3d3a4 | 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 |
8cc77028 | 24 | BuildRequires: glibc-misc |
98529ade | 25 | BuildRequires: libstdc++-devel |
97b6f035 | 26 | %if %{with qt4} |
30fcf11b | 27 | BuildRequires: QtGui-devel |
310002d3 | 28 | BuildRequires: QtLockedFile-devel |
30fcf11b | 29 | BuildRequires: QtNetwork-devel |
5f8c12b9 | 30 | BuildRequires: qt4-build |
310002d3 | 31 | BuildRequires: qt4-qmake |
97b6f035 ER |
32 | %endif |
33 | %if %{with qt5} | |
34 | BuildRequires: Qt5Core-devel | |
35 | BuildRequires: Qt5Gui-devel | |
36 | BuildRequires: Qt5LockedFile-devel | |
37 | BuildRequires: Qt5Network-devel | |
38 | BuildRequires: Qt5Widgets-devel | |
39 | BuildRequires: qt5-build | |
c54a9d69 | 40 | BuildRequires: qt5-qmake >= 5.4 |
97b6f035 | 41 | %endif |
5f8c12b9 ER |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
43 | ||
dfdbbb18 | 44 | %define qt4dir %{_datadir}/qt4 |
97b6f035 | 45 | %define qt5dir %{_libdir}/qt5 |
310002d3 | 46 | |
5f8c12b9 ER |
47 | %description |
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. | |
52 | ||
53 | The QtSingleApplication class provides an interface to detect a | |
54 | running instance, and to send command strings to that instance. | |
55 | ||
56 | For console (non-GUI) applications, the QtSingleCoreApplication | |
57 | variant is provided, which avoids dependency on QtGui. | |
58 | ||
5c92ed78 | 59 | %package devel |
310002d3 | 60 | Summary: Development files for QtSingleApplication |
5f8c12b9 ER |
61 | Group: Development/Libraries |
62 | Requires: %{name} = %{version}-%{release} | |
5f8c12b9 | 63 | |
5c92ed78 | 64 | %description devel |
5f8c12b9 | 65 | This package contains libraries and header files for developing |
310002d3 | 66 | applications that use QtSingleApplication. |
5f8c12b9 | 67 | |
97b6f035 ER |
68 | %package -n Qt5SingleApplication |
69 | Summary: Qt library to start applications only once per user | |
70 | Group: Libraries | |
71 | ||
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. | |
77 | ||
78 | The QtSingleApplication class provides an interface to detect a | |
79 | running instance, and to send command strings to that instance. | |
80 | ||
81 | For console (non-GUI) applications, the QtSingleCoreApplication | |
82 | variant is provided, which avoids dependency on QtGui. | |
83 | ||
84 | %package -n Qt5SingleApplication-devel | |
85 | Summary: Development files for Qt5SingleApplication library | |
86 | Group: Development/Libraries | |
87 | Requires: Qt5SingleApplication = %{version}-%{release} | |
97b6f035 ER |
88 | |
89 | %description -n Qt5SingleApplication-devel | |
90 | This package contains libraries and header files for developing | |
c64ddd18 | 91 | applications that use Qt5SingleApplication. |
97b6f035 | 92 | |
5f8c12b9 | 93 | %prep |
5c92ed78 | 94 | %setup -qc |
e3b3d3a4 | 95 | mv qt-solutions-*/qtsingleapplication/* . |
5c92ed78 ER |
96 | %patch0 -p0 |
97 | %patch1 -p0 | |
3e0bb370 | 98 | %patch2 -p1 |
e3b3d3a4 | 99 | %patch3 -p1 |
310002d3 | 100 | |
c64ddd18 | 101 | # We already disabled bundling this external library. |
310002d3 ER |
102 | # But just to make sure: |
103 | rm src/{QtLocked,qtlocked}* | |
5f8c12b9 | 104 | |
97b6f035 ER |
105 | set -- * |
106 | install -d build-qt{4,5} | |
107 | cp -al "$@" build-qt4 | |
108 | cp -al "$@" build-qt5 | |
109 | ||
5f8c12b9 | 110 | %build |
97b6f035 ER |
111 | %if %{with qt4} |
112 | cd build-qt4 | |
5f8c12b9 | 113 | # Does not use GNU configure |
97b6f035 | 114 | ./configure -library |
dfdbbb18 | 115 | qmake-qt4 |
5f8c12b9 | 116 | %{__make} |
8cc77028 ER |
117 | |
118 | # ensure the it links to right version of LockedFile | |
119 | for l in SingleApplication SingleCoreApplication; do | |
120 | f=libQtSolutions_$l-2.6.so | |
121 | ldd lib/$f | grep libQtSolutions_LockedFile | |
122 | done | |
97b6f035 ER |
123 | cd .. |
124 | %endif | |
125 | ||
126 | %if %{with qt5} | |
127 | cd build-qt5 | |
128 | ./configure -library | |
129 | # XXX fix QtLockedFile package? | |
130 | qmake-qt5 INCLUDEPATH+=%{_includedir}/qt5/QtSolutions | |
131 | %{__make} | |
8cc77028 ER |
132 | |
133 | # ensure the it links to right version of LockedFile | |
134 | for l in SingleApplication SingleCoreApplication; do | |
135 | f=libQt5Solutions_$l-2.6.so | |
136 | ldd lib/$f | grep libQt5Solutions_LockedFile | |
137 | done | |
97b6f035 ER |
138 | cd .. |
139 | %endif | |
5f8c12b9 ER |
140 | |
141 | %install | |
142 | rm -rf $RPM_BUILD_ROOT | |
97b6f035 ER |
143 | %if %{with qt4} |
144 | cd build-qt4 | |
dfdbbb18 | 145 | install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt4/QtSolutions,%{qt4dir}/mkspecs/features} |
5f8c12b9 ER |
146 | cp -a lib/* $RPM_BUILD_ROOT%{_libdir} |
147 | rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0 | |
dfdbbb18 ER |
148 | cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt4/QtSolutions |
149 | cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{qt4dir}/mkspecs/features | |
98529ade | 150 | cd .. |
97b6f035 ER |
151 | %endif |
152 | ||
153 | %if %{with qt5} | |
154 | cd build-qt5 | |
155 | install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt5/QtSolutions,%{qt5dir}/mkspecs/features} | |
156 | cp -a lib/* $RPM_BUILD_ROOT%{_libdir} | |
157 | rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0 | |
158 | cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt5/QtSolutions | |
159 | cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{qt5dir}/mkspecs/features | |
98529ade | 160 | cd .. |
8cc77028 | 161 | |
97b6f035 | 162 | %endif |
310002d3 | 163 | |
5f8c12b9 ER |
164 | %clean |
165 | rm -rf $RPM_BUILD_ROOT | |
166 | ||
167 | %post -p /sbin/ldconfig | |
168 | %postun -p /sbin/ldconfig | |
169 | ||
97b6f035 ER |
170 | %post -n Qt5SingleApplication -p /sbin/ldconfig |
171 | %postun -n Qt5SingleApplication -p /sbin/ldconfig | |
172 | ||
173 | %if %{with qt4} | |
5f8c12b9 ER |
174 | %files |
175 | %defattr(644,root,root,755) | |
5c92ed78 | 176 | %doc README.TXT |
5c92ed78 ER |
177 | %attr(755,root,root) %{_libdir}/libQtSolutions_SingleApplication-2.6.so.*.*.* |
178 | %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_SingleApplication-2.6.so.1 | |
179 | %attr(755,root,root) %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so.*.*.* | |
180 | %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so.1 | |
5f8c12b9 ER |
181 | |
182 | %files devel | |
183 | %defattr(644,root,root,755) | |
184 | %doc doc examples | |
5c92ed78 ER |
185 | %{_libdir}/libQtSolutions_SingleApplication-2.6.so |
186 | %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so | |
7023061e ER |
187 | %{_includedir}/qt4/QtSolutions/QtSingleApplication |
188 | %{_includedir}/qt4/QtSolutions/QtSingleCoreApplication | |
189 | %{_includedir}/qt4/QtSolutions/qtsingleapplication.h | |
190 | %{_includedir}/qt4/QtSolutions/qtsinglecoreapplication.h | |
dfdbbb18 ER |
191 | %{qt4dir}/mkspecs/features/qtsingleapplication.prf |
192 | %{qt4dir}/mkspecs/features/qtsinglecoreapplication.prf | |
97b6f035 ER |
193 | %endif |
194 | ||
195 | %if %{with qt5} | |
196 | %files -n Qt5SingleApplication | |
197 | %defattr(644,root,root,755) | |
198 | %doc README.TXT | |
199 | %attr(755,root,root) %{_libdir}/libQt5Solutions_SingleApplication-2.6.so.*.*.* | |
200 | %attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_SingleApplication-2.6.so.1 | |
201 | %attr(755,root,root) %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so.*.*.* | |
202 | %attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so.1 | |
203 | ||
204 | %files -n Qt5SingleApplication-devel | |
205 | %defattr(644,root,root,755) | |
206 | %doc doc examples | |
207 | %{_libdir}/libQt5Solutions_SingleApplication-2.6.so | |
208 | %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so | |
209 | %{_includedir}/qt5/QtSolutions/QtSingleApplication | |
210 | %{_includedir}/qt5/QtSolutions/QtSingleCoreApplication | |
211 | %{_includedir}/qt5/QtSolutions/qtsingleapplication.h | |
212 | %{_includedir}/qt5/QtSolutions/qtsinglecoreapplication.h | |
213 | %{qt5dir}/mkspecs/features/qtsingleapplication.prf | |
214 | %{qt5dir}/mkspecs/features/qtsinglecoreapplication.prf | |
215 | %endif |