]> git.pld-linux.org Git - packages/QtSingleApplication.git/blame - QtSingleApplication.spec
- fix specs for qt5
[packages/QtSingleApplication.git] / QtSingleApplication.spec
CommitLineData
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 9Summary: Qt library to start applications only once per user
310002d3 10Name: QtSingleApplication
5c92ed78 11Version: 2.6.1
c6a37dad 12Release: 4
5f8c12b9
ER
13License: GPL v3 or LGPL v2 with exceptions
14Group: Libraries
8cc77028 15Source0: https://github.com/qtproject/qt-solutions/archive/%{commit}/%{name}-%{commit}.tar.gz
e3b3d3a4 16# Source0-md5: 07f01898ad475c5cded2968d25bee85c
310002d3 17Source1: qtsingleapplication.prf
099d1b50 18Source2: qtsinglecoreapplication.prf
310002d3 19Patch0: qtsingleapplication-build.diff
5c92ed78 20Patch1: qtlockedfile.patch
b639dacf 21Patch2: clementine.patch
e3b3d3a4 22Patch3: version.patch
5c92ed78 23URL: http://doc.qt.digia.com/solutions/4/qtsingleapplication/qtsingleapplication.html
8cc77028 24BuildRequires: glibc-misc
98529ade 25BuildRequires: libstdc++-devel
97b6f035 26%if %{with qt4}
30fcf11b 27BuildRequires: QtGui-devel
310002d3 28BuildRequires: QtLockedFile-devel
30fcf11b 29BuildRequires: QtNetwork-devel
5f8c12b9 30BuildRequires: qt4-build
310002d3 31BuildRequires: qt4-qmake
97b6f035
ER
32%endif
33%if %{with qt5}
34BuildRequires: Qt5Core-devel
35BuildRequires: Qt5Gui-devel
36BuildRequires: Qt5LockedFile-devel
37BuildRequires: Qt5Network-devel
38BuildRequires: Qt5Widgets-devel
39BuildRequires: qt5-build
c54a9d69 40BuildRequires: qt5-qmake >= 5.4
97b6f035 41%endif
5f8c12b9
ER
42BuildRoot: %{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
48For some applications it is useful or even critical that they are
49started only once by any user. Future attempts to start the
50application should activate any already running instance, and possibly
51perform requested actions, e.g. loading a file, in that instance.
52
53The QtSingleApplication class provides an interface to detect a
54running instance, and to send command strings to that instance.
55
56For console (non-GUI) applications, the QtSingleCoreApplication
57variant is provided, which avoids dependency on QtGui.
58
5c92ed78 59%package devel
310002d3 60Summary: Development files for QtSingleApplication
5f8c12b9
ER
61Group: Development/Libraries
62Requires: %{name} = %{version}-%{release}
5f8c12b9 63
5c92ed78 64%description devel
5f8c12b9 65This package contains libraries and header files for developing
310002d3 66applications that use QtSingleApplication.
5f8c12b9 67
97b6f035
ER
68%package -n Qt5SingleApplication
69Summary: Qt library to start applications only once per user
70Group: Libraries
71
72%description -n Qt5SingleApplication
73For some applications it is useful or even critical that they are
74started only once by any user. Future attempts to start the
75application should activate any already running instance, and possibly
76perform requested actions, e.g. loading a file, in that instance.
77
78The QtSingleApplication class provides an interface to detect a
79running instance, and to send command strings to that instance.
80
81For console (non-GUI) applications, the QtSingleCoreApplication
82variant is provided, which avoids dependency on QtGui.
83
84%package -n Qt5SingleApplication-devel
85Summary: Development files for Qt5SingleApplication library
86Group: Development/Libraries
87Requires: Qt5SingleApplication = %{version}-%{release}
97b6f035
ER
88
89%description -n Qt5SingleApplication-devel
90This package contains libraries and header files for developing
c64ddd18 91applications that use Qt5SingleApplication.
97b6f035 92
5f8c12b9 93%prep
5c92ed78 94%setup -qc
db4dc12e
ER
95mv qt-solutions-* .qtsolutions
96mv .qtsolutions/qtsingleapplication/* .
5c92ed78
ER
97%patch0 -p0
98%patch1 -p0
3e0bb370 99%patch2 -p1
e3b3d3a4 100%patch3 -p1
310002d3 101
c64ddd18 102# We already disabled bundling this external library.
310002d3
ER
103# But just to make sure:
104rm src/{QtLocked,qtlocked}*
5f8c12b9 105
97b6f035
ER
106set -- *
107install -d build-qt{4,5}
108cp -al "$@" build-qt4
109cp -al "$@" build-qt5
110
5f8c12b9 111%build
97b6f035
ER
112%if %{with qt4}
113cd build-qt4
5f8c12b9 114# Does not use GNU configure
97b6f035 115./configure -library
dfdbbb18 116qmake-qt4
5f8c12b9 117%{__make}
8cc77028
ER
118
119# ensure the it links to right version of LockedFile
120for l in SingleApplication SingleCoreApplication; do
121 f=libQtSolutions_$l-2.6.so
122 ldd lib/$f | grep libQtSolutions_LockedFile
123done
97b6f035
ER
124cd ..
125%endif
126
127%if %{with qt5}
128cd build-qt5
129./configure -library
130# XXX fix QtLockedFile package?
131qmake-qt5 INCLUDEPATH+=%{_includedir}/qt5/QtSolutions
132%{__make}
1bb0d705
ER
133# XXX: relink with proper version
134%{__sed} -i -e 's/QtSolutions/Qt5Solutions/' buildlib/Makefile*
135rm -r lib
136%{__make}
8cc77028
ER
137
138# ensure the it links to right version of LockedFile
139for l in SingleApplication SingleCoreApplication; do
140 f=libQt5Solutions_$l-2.6.so
141 ldd lib/$f | grep libQt5Solutions_LockedFile
142done
97b6f035
ER
143cd ..
144%endif
5f8c12b9
ER
145
146%install
147rm -rf $RPM_BUILD_ROOT
97b6f035
ER
148%if %{with qt4}
149cd build-qt4
dfdbbb18 150install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt4/QtSolutions,%{qt4dir}/mkspecs/features}
5f8c12b9
ER
151cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
152rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0
dfdbbb18
ER
153cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt4/QtSolutions
154cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{qt4dir}/mkspecs/features
98529ade 155cd ..
97b6f035
ER
156%endif
157
158%if %{with qt5}
159cd build-qt5
160install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt5/QtSolutions,%{qt5dir}/mkspecs/features}
161cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
162rm $RPM_BUILD_ROOT%{_libdir}/lib*.so.1.0
163cp -p src/qtsingle*application.h src/QtSingle*Application $RPM_BUILD_ROOT%{_includedir}/qt5/QtSolutions
c6a37dad
JR
164%{__sed} -e s/QtSolutions_SingleApplication-2.6/Qt5Solutions_SingleApplication-2.6/g %{SOURCE1} > $RPM_BUILD_ROOT%{qt5dir}/mkspecs/features/qtsingleapplication.prf
165%{__sed} -e s/QtSolutions_SingleCoreApplication-2.6/Qt5Solutions_SingleCoreApplication-2.6/g %{SOURCE2} > $RPM_BUILD_ROOT%{qt5dir}/mkspecs/features/qtsinglecoreapplication.prf
98529ade 166cd ..
97b6f035 167%endif
310002d3 168
5f8c12b9
ER
169%clean
170rm -rf $RPM_BUILD_ROOT
171
172%post -p /sbin/ldconfig
173%postun -p /sbin/ldconfig
174
97b6f035
ER
175%post -n Qt5SingleApplication -p /sbin/ldconfig
176%postun -n Qt5SingleApplication -p /sbin/ldconfig
177
178%if %{with qt4}
5f8c12b9
ER
179%files
180%defattr(644,root,root,755)
5c92ed78 181%doc README.TXT
5c92ed78
ER
182%attr(755,root,root) %{_libdir}/libQtSolutions_SingleApplication-2.6.so.*.*.*
183%attr(755,root,root) %ghost %{_libdir}/libQtSolutions_SingleApplication-2.6.so.1
184%attr(755,root,root) %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so.*.*.*
185%attr(755,root,root) %ghost %{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so.1
5f8c12b9
ER
186
187%files devel
188%defattr(644,root,root,755)
189%doc doc examples
5c92ed78
ER
190%{_libdir}/libQtSolutions_SingleApplication-2.6.so
191%{_libdir}/libQtSolutions_SingleCoreApplication-2.6.so
7023061e
ER
192%{_includedir}/qt4/QtSolutions/QtSingleApplication
193%{_includedir}/qt4/QtSolutions/QtSingleCoreApplication
194%{_includedir}/qt4/QtSolutions/qtsingleapplication.h
195%{_includedir}/qt4/QtSolutions/qtsinglecoreapplication.h
dfdbbb18
ER
196%{qt4dir}/mkspecs/features/qtsingleapplication.prf
197%{qt4dir}/mkspecs/features/qtsinglecoreapplication.prf
97b6f035
ER
198%endif
199
200%if %{with qt5}
201%files -n Qt5SingleApplication
202%defattr(644,root,root,755)
203%doc README.TXT
204%attr(755,root,root) %{_libdir}/libQt5Solutions_SingleApplication-2.6.so.*.*.*
205%attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_SingleApplication-2.6.so.1
206%attr(755,root,root) %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so.*.*.*
207%attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so.1
208
209%files -n Qt5SingleApplication-devel
210%defattr(644,root,root,755)
211%doc doc examples
212%{_libdir}/libQt5Solutions_SingleApplication-2.6.so
213%{_libdir}/libQt5Solutions_SingleCoreApplication-2.6.so
214%{_includedir}/qt5/QtSolutions/QtSingleApplication
215%{_includedir}/qt5/QtSolutions/QtSingleCoreApplication
216%{_includedir}/qt5/QtSolutions/qtsingleapplication.h
217%{_includedir}/qt5/QtSolutions/qtsinglecoreapplication.h
218%{qt5dir}/mkspecs/features/qtsingleapplication.prf
219%{qt5dir}/mkspecs/features/qtsinglecoreapplication.prf
220%endif
This page took 2.202097 seconds and 4 git commands to generate.