]> git.pld-linux.org Git - packages/QtLockedFile.git/blame - QtLockedFile.spec
- new qmake-qt5 can handle library name change by itself
[packages/QtLockedFile.git] / QtLockedFile.spec
CommitLineData
0b76b377
ER
1#
2# Conditional build:
3%bcond_without qt4 # build Qt4
4237b724 4%bcond_without qt5 # build Qt5
93c2628d
ER
5
6# last commit to qtlockedfile subdir in
7# https://qt.gitorious.org/qt-solutions/qt-solutions/
8%define commit 17b56547d6e0d9a06603231fe2384474f9144829
3498a0fc
ER
9Summary: QFile extension with advisory locking functions
10Name: QtLockedFile
11Version: 2.4
f1a25cde 12Release: 3
3498a0fc
ER
13License: GPL v3 or LGPL v2 with exceptions
14Group: Libraries
93c2628d
ER
15# git clone git@gitorious.org:qt-solutions/qt-solutions.git
16# git checkout %{commit}
17# tar -cjf QtLockedFile-%{version}.tar.bz2 -C qt-solutions/qtlockedfile .
18Source0: %{name}-%{version}.tar.bz2
19# Source0-md5: 8d0525b7f3dc92ee1464c6a538832535
3498a0fc
ER
20Source1: qtlockedfile.prf
21Patch0: qtlockedfile-dont-build-example.patch
93c2628d
ER
22Patch1: qtlockedfile-use-current-version.patch
23URL: http://doc.qt.digia.com/solutions/4/qtlockedfile/qtlockedfile.html
4237b724 24BuildRequires: libstdc++-devel
0b76b377 25%if %{with qt4}
caba5b65 26BuildRequires: QtCore-devel
caba5b65 27BuildRequires: qt4-qmake
0b76b377
ER
28%endif
29%if %{with qt5}
4237b724 30BuildRequires: Qt5Core-devel
f1a25cde 31BuildRequires: qt5-qmake >= 5.4
0b76b377 32%endif
3498a0fc
ER
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
1d007fa9
ER
35%define qt4dir %{_datadir}/qt4
36%define qt5dir %{_libdir}/qt5
3498a0fc
ER
37
38%description
39This class extends the QFile class with inter-process file locking
40capabilities. If an application requires that several processes should
41access the same file, QtLockedFile can be used to easily ensure that
42only one process at a time is writing to the file, and that no process
43is writing to it while others are reading it.
44
93c2628d 45%package devel
3498a0fc
ER
46Summary: Development files for QtLockedFile library
47Group: Development/Libraries
48Requires: %{name} = %{version}-%{release}
3498a0fc 49
93c2628d 50%description devel
3498a0fc
ER
51This package contains libraries and header files for developing
52applications that use QtLockedFile.
53
4237b724
ER
54%package -n Qt5LockedFile
55Summary: QFile extension with advisory locking functions
56Group: Libraries
57
58%description -n Qt5LockedFile
59This class extends the QFile class with inter-process file locking
60capabilities. If an application requires that several processes should
61access the same file, QtLockedFile can be used to easily ensure that
62only one process at a time is writing to the file, and that no process
63is writing to it while others are reading it.
64
65%package -n Qt5LockedFile-devel
66Summary: Development files for Qt5LockedFile library
67Group: Development/Libraries
68Requires: Qt5LockedFile = %{version}-%{release}
4237b724
ER
69
70%description -n Qt5LockedFile-devel
71This package contains libraries and header files for developing
72applications that use Qt5LockedFile.
73
3498a0fc 74%prep
93c2628d 75%setup -qc
3498a0fc 76%patch0 -p1
93c2628d 77%patch1 -p0
3498a0fc 78
0b76b377
ER
79set -- *
80install -d build-qt{4,5}
81cp -al "$@" build-qt4
82cp -al "$@" build-qt5
83
3498a0fc 84%build
0b76b377
ER
85%if %{with qt4}
86cd build-qt4
3498a0fc
ER
87# Does not use GNU configure
88./configure -library
89qmake-qt4
90%{__make}
0b76b377
ER
91cd ..
92%endif
93
94%if %{with qt5}
95cd build-qt5
96./configure -library
97qmake-qt5
98%{__make}
99cd ..
100%endif
3498a0fc
ER
101
102%install
103rm -rf $RPM_BUILD_ROOT
104
0b76b377
ER
105%if %{with qt4}
106cd build-qt4
1d007fa9 107install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt4/QtSolutions,%{qt4dir}/mkspecs/features}
3498a0fc 108cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
3498a0fc 109rm $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
1d007fa9
ER
110cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/qt4/QtSolutions
111cp -p %{SOURCE1} $RPM_BUILD_ROOT%{qt4dir}/mkspecs/features
0b76b377
ER
112cd ..
113%endif
114
115%if %{with qt5}
116cd build-qt5
1d007fa9 117install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt5/QtSolutions,%{qt5dir}/mkspecs/features}
0b76b377
ER
118cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
119rm $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
4237b724 120cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/qt5/QtSolutions
1d007fa9 121cp -p %{SOURCE1} $RPM_BUILD_ROOT%{qt5dir}/mkspecs/features
0b76b377
ER
122cd ..
123%endif
3498a0fc
ER
124
125%clean
126rm -rf $RPM_BUILD_ROOT
127
128%post -p /sbin/ldconfig
129%postun -p /sbin/ldconfig
130
83075c20
ER
131%post -n Qt5LockedFile -p /sbin/ldconfig
132%postun -n Qt5LockedFile -p /sbin/ldconfig
133
0b76b377 134%if %{with qt4}
3498a0fc
ER
135%files
136%defattr(644,root,root,755)
93c2628d 137%doc README.TXT
3498a0fc
ER
138%attr(755,root,root) %{_libdir}/libQtSolutions_LockedFile-%{version}.so.*.*.*
139%attr(755,root,root) %ghost %{_libdir}/libQtSolutions_LockedFile-%{version}.so.1
140
141%files devel
142%defattr(644,root,root,755)
143%doc doc example
144%{_libdir}/libQtSolutions_LockedFile-%{version}.so
1d007fa9
ER
145# XXX shared dir
146%dir %{_includedir}/qt4/QtSolutions
147%{_includedir}/qt4/QtSolutions/QtLockedFile
148%{_includedir}/qt4/QtSolutions/qtlockedfile.h
149%{qt4dir}/mkspecs/features/qtlockedfile.prf
0b76b377
ER
150%endif
151
152%if %{with qt5}
4237b724 153%files -n Qt5LockedFile
0b76b377
ER
154%defattr(644,root,root,755)
155%doc README.TXT
4237b724
ER
156%attr(755,root,root) %{_libdir}/libQt5Solutions_LockedFile-%{version}.so.*.*.*
157%attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_LockedFile-%{version}.so.1
0b76b377 158
4237b724 159%files -n Qt5LockedFile-devel
0b76b377
ER
160%defattr(644,root,root,755)
161%doc doc example
4237b724
ER
162%{_libdir}/libQt5Solutions_LockedFile-%{version}.so
163# XXX shared dir
164%dir %{_includedir}/qt5/QtSolutions
165%{_includedir}/qt5/QtSolutions/QtLockedFile
166%{_includedir}/qt5/QtSolutions/qtlockedfile.h
1d007fa9 167%{qt5dir}/mkspecs/features/qtlockedfile.prf
0b76b377 168%endif
This page took 0.085946 seconds and 4 git commands to generate.