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