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