]> git.pld-linux.org Git - packages/QtSingleApplication.git/blob - QtSingleApplication.spec
a123b73626a48031c9eb329d000609033d8c5365
[packages/QtSingleApplication.git] / QtSingleApplication.spec
1 #
2 # Conditional build:
3 %bcond_without  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 BuildRequires:  libstdc++-devel
27 %if %{with qt4}
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
65 %description devel
66 This package contains libraries and header files for developing
67 applications that use QtSingleApplication.
68
69 %package -n Qt5SingleApplication
70 Summary:        Qt library to start applications only once per user
71 Group:          Libraries
72
73 %description -n Qt5SingleApplication
74 For some applications it is useful or even critical that they are
75 started only once by any user. Future attempts to start the
76 application should activate any already running instance, and possibly
77 perform requested actions, e.g. loading a file, in that instance.
78
79 The QtSingleApplication class provides an interface to detect a
80 running instance, and to send command strings to that instance.
81
82 For console (non-GUI) applications, the QtSingleCoreApplication
83 variant is provided, which avoids dependency on QtGui.
84
85 %package -n Qt5SingleApplication-devel
86 Summary:        Development files for Qt5SingleApplication library
87 Group:          Development/Libraries
88 Requires:       Qt5SingleApplication = %{version}-%{release}
89
90 %description -n Qt5SingleApplication-devel
91 This package contains libraries and header files for developing
92 applications that use QtSingleApplication.
93
94 %prep
95 %setup -qc
96 %patch0 -p0
97 %patch1 -p0
98 %patch2 -p1
99
100 # We already disabled bundling this extrenal library.
101 # But just to make sure:
102 rm src/{QtLocked,qtlocked}*
103
104 set -- *
105 install -d build-qt{4,5}
106 cp -al "$@" build-qt4
107 cp -al "$@" build-qt5
108
109 %{__sed} -i -e 's/QtSolutions/Qt5Solutions/' build-qt5/common.pri
110
111 %build
112 %if %{with qt4}
113 cd build-qt4
114 # Does not use GNU configure
115 ./configure -library
116 qmake-qt4
117 %{__make}
118 cd ..
119 %endif
120
121 %if %{with qt5}
122 cd build-qt5
123 ./configure -library
124 # XXX fix QtLockedFile package?
125 qmake-qt5 INCLUDEPATH+=%{_includedir}/qt5/QtSolutions
126 %{__make}
127 cd ..
128 %endif
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132 %if %{with qt4}
133 cd build-qt4
134 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt4/QtSolutions,%{qt4dir}/mkspecs/features}
135 cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
136 rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0
137 cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt4/QtSolutions
138 cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{qt4dir}/mkspecs/features
139 cd ..
140 %endif
141
142 %if %{with qt5}
143 cd build-qt5
144 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt5/QtSolutions,%{qt5dir}/mkspecs/features}
145 cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
146 rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0
147 cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt5/QtSolutions
148 cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{qt5dir}/mkspecs/features
149 cd ..
150 %endif
151
152 %clean
153 rm -rf $RPM_BUILD_ROOT
154
155 %post   -p /sbin/ldconfig
156 %postun -p /sbin/ldconfig
157
158 %post   -n Qt5SingleApplication -p /sbin/ldconfig
159 %postun -n Qt5SingleApplication -p /sbin/ldconfig
160
161 %if %{with qt4}
162 %files
163 %defattr(644,root,root,755)
164 %doc README.TXT
165 %attr(755,root,root) %{_libdir}/libQtSolutions_SingleApplication-2.6.so.*.*.*
166 %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_SingleApplication-2.6.so.1
167 %attr(755,root,root) %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so.*.*.*
168 %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so.1
169
170 %files devel
171 %defattr(644,root,root,755)
172 %doc doc examples
173 %{_libdir}/libQtSolutions_SingleApplication-2.6.so
174 %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so
175 %{_includedir}/qt4/QtSolutions/QtSingleApplication
176 %{_includedir}/qt4/QtSolutions/QtSingleCoreApplication
177 %{_includedir}/qt4/QtSolutions/qtsingleapplication.h
178 %{_includedir}/qt4/QtSolutions/qtsinglecoreapplication.h
179 %{qt4dir}/mkspecs/features/qtsingleapplication.prf
180 %{qt4dir}/mkspecs/features/qtsinglecoreapplication.prf
181 %endif
182
183 %if %{with qt5}
184 %files -n Qt5SingleApplication
185 %defattr(644,root,root,755)
186 %doc README.TXT
187 %attr(755,root,root) %{_libdir}/libQt5Solutions_SingleApplication-2.6.so.*.*.*
188 %attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_SingleApplication-2.6.so.1
189 %attr(755,root,root) %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so.*.*.*
190 %attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so.1
191
192 %files -n Qt5SingleApplication-devel
193 %defattr(644,root,root,755)
194 %doc doc examples
195 %{_libdir}/libQt5Solutions_SingleApplication-2.6.so
196 %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so
197 %{_includedir}/qt5/QtSolutions/QtSingleApplication
198 %{_includedir}/qt5/QtSolutions/QtSingleCoreApplication
199 %{_includedir}/qt5/QtSolutions/qtsingleapplication.h
200 %{_includedir}/qt5/QtSolutions/qtsinglecoreapplication.h
201 %{qt5dir}/mkspecs/features/qtsingleapplication.prf
202 %{qt5dir}/mkspecs/features/qtsinglecoreapplication.prf
203 %endif
This page took 0.095318 seconds and 3 git commands to generate.