]>
Commit | Line | Data |
---|---|---|
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 | 9 | Summary: QFile extension with advisory locking functions |
ad427fbe | 10 | Summary(pl.UTF-8): Rozszerzenie QFile z funkcjami do blokowania doradczego |
3498a0fc ER |
11 | Name: QtLockedFile |
12 | Version: 2.4 | |
12c2edc9 | 13 | Release: 5 |
3498a0fc ER |
14 | License: GPL v3 or LGPL v2 with exceptions |
15 | Group: Libraries | |
93c2628d ER |
16 | # git clone git@gitorious.org:qt-solutions/qt-solutions.git |
17 | # git checkout %{commit} | |
18 | # tar -cjf QtLockedFile-%{version}.tar.bz2 -C qt-solutions/qtlockedfile . | |
19 | Source0: %{name}-%{version}.tar.bz2 | |
20 | # Source0-md5: 8d0525b7f3dc92ee1464c6a538832535 | |
3498a0fc ER |
21 | Source1: qtlockedfile.prf |
22 | Patch0: qtlockedfile-dont-build-example.patch | |
93c2628d | 23 | Patch1: qtlockedfile-use-current-version.patch |
ad427fbe | 24 | Patch2: qtlockedfile-install.patch |
93c2628d | 25 | URL: http://doc.qt.digia.com/solutions/4/qtlockedfile/qtlockedfile.html |
4237b724 | 26 | BuildRequires: libstdc++-devel |
0b76b377 | 27 | %if %{with qt4} |
a7041599 JB |
28 | BuildRequires: QtCore-devel >= 4 |
29 | BuildRequires: qt4-qmake >= 4 | |
0b76b377 ER |
30 | %endif |
31 | %if %{with qt5} | |
a7041599 | 32 | BuildRequires: Qt5Core-devel >= 5.4 |
f1a25cde | 33 | BuildRequires: qt5-qmake >= 5.4 |
0b76b377 | 34 | %endif |
3498a0fc ER |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
36 | ||
1d007fa9 ER |
37 | %define qt4dir %{_datadir}/qt4 |
38 | %define qt5dir %{_libdir}/qt5 | |
3498a0fc ER |
39 | |
40 | %description | |
41 | This class extends the QFile class with inter-process file locking | |
42 | capabilities. If an application requires that several processes should | |
43 | access the same file, QtLockedFile can be used to easily ensure that | |
44 | only one process at a time is writing to the file, and that no process | |
45 | is writing to it while others are reading it. | |
46 | ||
ad427fbe JB |
47 | %description -l pl.UTF-8 |
48 | Ta klasa rozszerza klasę QFile o możliwość międzyprocesowego | |
49 | blokowania plików. Jeśli aplikacja wymaga, aby różne procesy miały | |
50 | dostęp do tego samego pliku, QtLockedFile może pomóc łatwo zapewnić, | |
51 | że tylko jeden proces naraz zapisuje do pliku i żaden proces nie | |
52 | zapisuje, kiedy inne go czytają. | |
53 | ||
93c2628d | 54 | %package devel |
3498a0fc | 55 | Summary: Development files for QtLockedFile library |
ad427fbe | 56 | Summary(pl.UTF-8): Pliki programistyczne biblioteki QtLockedFile |
3498a0fc ER |
57 | Group: Development/Libraries |
58 | Requires: %{name} = %{version}-%{release} | |
a7041599 | 59 | Requires: QtCore-devel >= 4 |
3498a0fc | 60 | |
93c2628d | 61 | %description devel |
ad427fbe JB |
62 | This package contains header files for developing applications that |
63 | use QtLockedFile. | |
64 | ||
65 | %description devel -l pl.UTF-8 | |
66 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji | |
67 | wykorzystujących QtLockedFile. | |
3498a0fc | 68 | |
4237b724 ER |
69 | %package -n Qt5LockedFile |
70 | Summary: QFile extension with advisory locking functions | |
ad427fbe | 71 | Summary(pl.UTF-8): Rozszerzenie QFile z funkcjami do blokowania doradczego |
4237b724 ER |
72 | Group: Libraries |
73 | ||
74 | %description -n Qt5LockedFile | |
75 | This class extends the QFile class with inter-process file locking | |
76 | capabilities. If an application requires that several processes should | |
77 | access the same file, QtLockedFile can be used to easily ensure that | |
78 | only one process at a time is writing to the file, and that no process | |
79 | is writing to it while others are reading it. | |
80 | ||
ad427fbe JB |
81 | %description -n Qt5LockedFile -l pl.UTF-8 |
82 | Ta klasa rozszerza klasę QFile o możliwość międzyprocesowego | |
83 | blokowania plików. Jeśli aplikacja wymaga, aby różne procesy miały | |
84 | dostęp do tego samego pliku, QtLockedFile może pomóc łatwo zapewnić, | |
85 | że tylko jeden proces naraz zapisuje do pliku i żaden proces nie | |
86 | zapisuje, kiedy inne go czytają. | |
87 | ||
4237b724 ER |
88 | %package -n Qt5LockedFile-devel |
89 | Summary: Development files for Qt5LockedFile library | |
ad427fbe | 90 | Summary(pl.UTF-8): Pliki programistyczne biblioteki QtLockedFile |
4237b724 | 91 | Group: Development/Libraries |
a7041599 | 92 | Requires: Qt5Core-devel >= 5 |
4237b724 | 93 | Requires: Qt5LockedFile = %{version}-%{release} |
4237b724 ER |
94 | |
95 | %description -n Qt5LockedFile-devel | |
96 | This package contains libraries and header files for developing | |
97 | applications that use Qt5LockedFile. | |
98 | ||
ad427fbe JB |
99 | %description -n Qt5LockedFile-devel -l pl.UTF-8 |
100 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji | |
101 | wykorzystujących QtLockedFile. | |
102 | ||
3498a0fc | 103 | %prep |
93c2628d | 104 | %setup -qc |
3498a0fc | 105 | %patch0 -p1 |
93c2628d | 106 | %patch1 -p0 |
ad427fbe | 107 | %patch2 -p1 |
0b76b377 | 108 | |
3498a0fc | 109 | %build |
3498a0fc ER |
110 | # Does not use GNU configure |
111 | ./configure -library | |
ad427fbe JB |
112 | |
113 | %if %{with qt4} | |
114 | install -d build-qt4 | |
115 | cd build-qt4 | |
116 | qmake-qt4 ../qtlockedfile.pro \ | |
117 | QMAKE_CXX="%{__cxx}" \ | |
118 | QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \ | |
119 | QMAKE_LFLAGS_RELEASE="%{rpmldflags}" \ | |
120 | INSTALL_LIBDIR=%{_libdir} | |
3498a0fc | 121 | %{__make} |
0b76b377 ER |
122 | cd .. |
123 | %endif | |
124 | ||
125 | %if %{with qt5} | |
ad427fbe | 126 | install -d build-qt5 |
0b76b377 | 127 | cd build-qt5 |
ad427fbe JB |
128 | qmake-qt5 ../qtlockedfile.pro \ |
129 | QMAKE_CXX="%{__cxx}" \ | |
130 | QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \ | |
131 | QMAKE_LFLAGS_RELEASE="%{rpmldflags}" \ | |
132 | INSTALL_LIBDIR=%{_libdir} | |
0b76b377 ER |
133 | %{__make} |
134 | cd .. | |
135 | %endif | |
3498a0fc ER |
136 | |
137 | %install | |
138 | rm -rf $RPM_BUILD_ROOT | |
139 | ||
0b76b377 | 140 | %if %{with qt4} |
ad427fbe JB |
141 | %{__make} -C build-qt4 install \ |
142 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
143 | ||
144 | install -d $RPM_BUILD_ROOT{%{_includedir}/qt4/QtSolutions,%{qt4dir}/mkspecs/features} | |
145 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0 | |
1d007fa9 ER |
146 | cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/qt4/QtSolutions |
147 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{qt4dir}/mkspecs/features | |
0b76b377 ER |
148 | %endif |
149 | ||
150 | %if %{with qt5} | |
ad427fbe JB |
151 | %{__make} -C build-qt5 install \ |
152 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
153 | ||
154 | install -d $RPM_BUILD_ROOT{%{_includedir}/qt5/QtSolutions,%{qt5dir}/mkspecs/features} | |
155 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0 | |
4237b724 | 156 | cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/qt5/QtSolutions |
12c2edc9 JB |
157 | %{__sed} -e 's/-lQtSolutions/-lQt5Solutions/' \ |
158 | -e 's/QMAKE_INCDIR_QT/QT_MODULE_INCLUDE_BASE/' %{SOURCE1} >$RPM_BUILD_ROOT%{qt5dir}/mkspecs/features/qtlockedfile.prf | |
0b76b377 | 159 | %endif |
3498a0fc ER |
160 | |
161 | %clean | |
162 | rm -rf $RPM_BUILD_ROOT | |
163 | ||
164 | %post -p /sbin/ldconfig | |
165 | %postun -p /sbin/ldconfig | |
166 | ||
83075c20 ER |
167 | %post -n Qt5LockedFile -p /sbin/ldconfig |
168 | %postun -n Qt5LockedFile -p /sbin/ldconfig | |
169 | ||
0b76b377 | 170 | %if %{with qt4} |
3498a0fc ER |
171 | %files |
172 | %defattr(644,root,root,755) | |
93c2628d | 173 | %doc README.TXT |
3498a0fc ER |
174 | %attr(755,root,root) %{_libdir}/libQtSolutions_LockedFile-%{version}.so.*.*.* |
175 | %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_LockedFile-%{version}.so.1 | |
176 | ||
177 | %files devel | |
178 | %defattr(644,root,root,755) | |
179 | %doc doc example | |
ad427fbe | 180 | %attr(755,root,root) %{_libdir}/libQtSolutions_LockedFile-%{version}.so |
1d007fa9 ER |
181 | # XXX shared dir |
182 | %dir %{_includedir}/qt4/QtSolutions | |
183 | %{_includedir}/qt4/QtSolutions/QtLockedFile | |
184 | %{_includedir}/qt4/QtSolutions/qtlockedfile.h | |
185 | %{qt4dir}/mkspecs/features/qtlockedfile.prf | |
0b76b377 ER |
186 | %endif |
187 | ||
188 | %if %{with qt5} | |
4237b724 | 189 | %files -n Qt5LockedFile |
0b76b377 ER |
190 | %defattr(644,root,root,755) |
191 | %doc README.TXT | |
4237b724 ER |
192 | %attr(755,root,root) %{_libdir}/libQt5Solutions_LockedFile-%{version}.so.*.*.* |
193 | %attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_LockedFile-%{version}.so.1 | |
0b76b377 | 194 | |
4237b724 | 195 | %files -n Qt5LockedFile-devel |
0b76b377 ER |
196 | %defattr(644,root,root,755) |
197 | %doc doc example | |
ad427fbe | 198 | %attr(755,root,root) %{_libdir}/libQt5Solutions_LockedFile-%{version}.so |
4237b724 ER |
199 | # XXX shared dir |
200 | %dir %{_includedir}/qt5/QtSolutions | |
201 | %{_includedir}/qt5/QtSolutions/QtLockedFile | |
202 | %{_includedir}/qt5/QtSolutions/qtlockedfile.h | |
1d007fa9 | 203 | %{qt5dir}/mkspecs/features/qtlockedfile.prf |
0b76b377 | 204 | %endif |