]> git.pld-linux.org Git - packages/QtSingleApplication.git/blame - QtSingleApplication.spec
add qt5 packages
[packages/QtSingleApplication.git] / QtSingleApplication.spec
CommitLineData
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 9Summary: Qt library to start applications only once per user
310002d3 10Name: QtSingleApplication
5c92ed78
ER
11Version: 2.6.1
12Release: 1
5f8c12b9
ER
13License: GPL v3 or LGPL v2 with exceptions
14Group: 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 .
18Source0: %{name}-%{version}.tar.bz2
19# Source0-md5: 2442ba5536b99b4b9144bd33ea23cb17
310002d3 20Source1: qtsingleapplication.prf
099d1b50 21Source2: qtsinglecoreapplication.prf
310002d3 22Patch0: qtsingleapplication-build.diff
5c92ed78 23Patch1: qtlockedfile.patch
b639dacf 24Patch2: clementine.patch
5c92ed78 25URL: http://doc.qt.digia.com/solutions/4/qtsingleapplication/qtsingleapplication.html
97b6f035 26%if %{with qt4}
30fcf11b 27BuildRequires: QtCore-devel
28BuildRequires: QtGui-devel
310002d3 29BuildRequires: QtLockedFile-devel
30fcf11b 30BuildRequires: QtNetwork-devel
5f8c12b9 31BuildRequires: qt4-build
310002d3 32BuildRequires: qt4-qmake
97b6f035
ER
33%endif
34%if %{with qt5}
35BuildRequires: Qt5Core-devel
36BuildRequires: Qt5Gui-devel
37BuildRequires: Qt5LockedFile-devel
38BuildRequires: Qt5Network-devel
39BuildRequires: Qt5Widgets-devel
40BuildRequires: qt5-build
41BuildRequires: qt5-qmake
42%endif
5f8c12b9
ER
43BuildRoot: %{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
49For some applications it is useful or even critical that they are
50started only once by any user. Future attempts to start the
51application should activate any already running instance, and possibly
52perform requested actions, e.g. loading a file, in that instance.
53
54The QtSingleApplication class provides an interface to detect a
55running instance, and to send command strings to that instance.
56
57For console (non-GUI) applications, the QtSingleCoreApplication
58variant is provided, which avoids dependency on QtGui.
59
5c92ed78 60%package devel
310002d3 61Summary: Development files for QtSingleApplication
5f8c12b9
ER
62Group: Development/Libraries
63Requires: %{name} = %{version}-%{release}
64Requires: qt4-build
310002d3 65Requires: qt4-qmake
5f8c12b9 66
5c92ed78 67%description devel
5f8c12b9 68This package contains libraries and header files for developing
310002d3 69applications that use QtSingleApplication.
5f8c12b9 70
97b6f035
ER
71%package -n Qt5SingleApplication
72Summary: Qt library to start applications only once per user
73Group: Libraries
74
75%description -n Qt5SingleApplication
76For some applications it is useful or even critical that they are
77started only once by any user. Future attempts to start the
78application should activate any already running instance, and possibly
79perform requested actions, e.g. loading a file, in that instance.
80
81The QtSingleApplication class provides an interface to detect a
82running instance, and to send command strings to that instance.
83
84For console (non-GUI) applications, the QtSingleCoreApplication
85variant is provided, which avoids dependency on QtGui.
86
87%package -n Qt5SingleApplication-devel
88Summary: Development files for Qt5SingleApplication library
89Group: Development/Libraries
90Requires: Qt5SingleApplication = %{version}-%{release}
91Requires: qt5-build
92Requires: qt5-qmake
93
94%description -n Qt5SingleApplication-devel
95This package contains libraries and header files for developing
96applications 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:
106rm src/{QtLocked,qtlocked}*
5f8c12b9 107
97b6f035
ER
108set -- *
109install -d build-qt{4,5}
110cp -al "$@" build-qt4
111cp -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}
117cd build-qt4
5f8c12b9 118# Does not use GNU configure
97b6f035 119./configure -library
dfdbbb18 120qmake-qt4
5f8c12b9 121%{__make}
97b6f035
ER
122cd ..
123%endif
124
125%if %{with qt5}
126cd build-qt5
127./configure -library
128# XXX fix QtLockedFile package?
129qmake-qt5 INCLUDEPATH+=%{_includedir}/qt5/QtSolutions
130%{__make}
131cd ..
132%endif
5f8c12b9
ER
133
134%install
135rm -rf $RPM_BUILD_ROOT
97b6f035
ER
136%if %{with qt4}
137cd build-qt4
dfdbbb18 138install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt4/QtSolutions,%{qt4dir}/mkspecs/features}
5f8c12b9
ER
139cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
140rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0
dfdbbb18
ER
141cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt4/QtSolutions
142cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{qt4dir}/mkspecs/features
97b6f035
ER
143%endif
144
145%if %{with qt5}
146cd build-qt5
147install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt5/QtSolutions,%{qt5dir}/mkspecs/features}
148cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
149rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0
150cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt5/QtSolutions
151cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{qt5dir}/mkspecs/features
152%endif
310002d3 153
5f8c12b9
ER
154%clean
155rm -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
This page took 0.150702 seconds and 4 git commands to generate.