]> git.pld-linux.org Git - packages/QtSingleApplication.git/blob - QtSingleApplication.spec
add qt5 packages
[packages/QtSingleApplication.git] / QtSingleApplication.spec
1 #
2 # Conditional build:
3 %bcond_with     qt4             # build Qt4
4 %bcond_without  qt5             # build Qt5
5
6 # last commit to qtsingleapplication subdir in
7 # https://qt.gitorious.org/qt-solutions/qt-solutions/
8 %define commit  841982ceec9d30a7ab7324979a0fd5c9c36fd121
9 Summary:        Qt library to start applications only once per user
10 Name:           QtSingleApplication
11 Version:        2.6.1
12 Release:        1
13 License:        GPL v3 or LGPL v2 with exceptions
14 Group:          Libraries
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
20 Source1:        qtsingleapplication.prf
21 Source2:        qtsinglecoreapplication.prf
22 Patch0:         qtsingleapplication-build.diff
23 Patch1:         qtlockedfile.patch
24 Patch2:         clementine.patch
25 URL:            http://doc.qt.digia.com/solutions/4/qtsingleapplication/qtsingleapplication.html
26 %if %{with qt4}
27 BuildRequires:  QtCore-devel
28 BuildRequires:  QtGui-devel
29 BuildRequires:  QtLockedFile-devel
30 BuildRequires:  QtNetwork-devel
31 BuildRequires:  qt4-build
32 BuildRequires:  qt4-qmake
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
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %define         qt4dir  %{_datadir}/qt4
46 %define         qt5dir  %{_libdir}/qt5
47
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
60 %package devel
61 Summary:        Development files for QtSingleApplication
62 Group:          Development/Libraries
63 Requires:       %{name} = %{version}-%{release}
64 Requires:       qt4-build
65 Requires:       qt4-qmake
66
67 %description devel
68 This package contains libraries and header files for developing
69 applications that use QtSingleApplication.
70
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
98 %prep
99 %setup -qc
100 %patch0 -p0
101 %patch1 -p0
102 %patch2 -p1
103
104 # We already disabled bundling this extrenal library.
105 # But just to make sure:
106 rm src/{QtLocked,qtlocked}*
107
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
115 %build
116 %if %{with qt4}
117 cd build-qt4
118 # Does not use GNU configure
119 ./configure -library
120 qmake-qt4
121 %{__make}
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
133
134 %install
135 rm -rf $RPM_BUILD_ROOT
136 %if %{with qt4}
137 cd build-qt4
138 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt4/QtSolutions,%{qt4dir}/mkspecs/features}
139 cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
140 rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0
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
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
153
154 %clean
155 rm -rf $RPM_BUILD_ROOT
156
157 %post   -p /sbin/ldconfig
158 %postun -p /sbin/ldconfig
159
160 %post   -n Qt5SingleApplication -p /sbin/ldconfig
161 %postun -n Qt5SingleApplication -p /sbin/ldconfig
162
163 %if %{with qt4}
164 %files
165 %defattr(644,root,root,755)
166 %doc README.TXT
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
171
172 %files devel
173 %defattr(644,root,root,755)
174 %doc doc examples
175 %{_libdir}/libQtSolutions_SingleApplication-2.6.so
176 %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so
177 %{_includedir}/qt4/QtSolutions/QtSingleApplication
178 %{_includedir}/qt4/QtSolutions/QtSingleCoreApplication
179 %{_includedir}/qt4/QtSolutions/qtsingleapplication.h
180 %{_includedir}/qt4/QtSolutions/qtsinglecoreapplication.h
181 %{qt4dir}/mkspecs/features/qtsingleapplication.prf
182 %{qt4dir}/mkspecs/features/qtsinglecoreapplication.prf
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
This page took 0.174426 seconds and 3 git commands to generate.