]> git.pld-linux.org Git - packages/QtLockedFile.git/blob - QtLockedFile.spec
build qt5 package
[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         _qt4_datadir    %{_datadir}/qt4
36 %define         _qt5_datadir    %{_datadir}/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 Requires:       qt4-build
50 Requires:       qt4-qmake
51
52 %description devel
53 This package contains libraries and header files for developing
54 applications that use QtLockedFile.
55
56 %package -n Qt5LockedFile
57 Summary:        QFile extension with advisory locking functions
58 Group:          Libraries
59
60 %description -n Qt5LockedFile
61 This class extends the QFile class with inter-process file locking
62 capabilities. If an application requires that several processes should
63 access the same file, QtLockedFile can be used to easily ensure that
64 only one process at a time is writing to the file, and that no process
65 is writing to it while others are reading it.
66
67 %package -n Qt5LockedFile-devel
68 Summary:        Development files for Qt5LockedFile library
69 Group:          Development/Libraries
70 Requires:       Qt5LockedFile = %{version}-%{release}
71 Requires:       qt5-build
72 Requires:       qt5-qmake
73
74 %description -n Qt5LockedFile-devel
75 This package contains libraries and header files for developing
76 applications that use Qt5LockedFile.
77
78 %prep
79 %setup -qc
80 %patch0 -p1
81 %patch1 -p0
82
83 set -- *
84 install -d build-qt{4,5}
85 cp -al "$@" build-qt4
86 cp -al "$@" build-qt5
87
88 %{__sed} -i -e 's/QtSolutions/Qt5Solutions/' build-qt5/common.pri
89
90 %build
91 %if %{with qt4}
92 cd build-qt4
93 # Does not use GNU configure
94 ./configure -library
95 qmake-qt4
96 %{__make}
97 cd ..
98 %endif
99
100 %if %{with qt5}
101 cd build-qt5
102 ./configure -library
103 qmake-qt5
104 %{__make}
105 cd ..
106 %endif
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
110
111 %if %{with qt4}
112 cd build-qt4
113 install -d $RPM_BUILD_ROOT{%{_libdir},%{_qt4_datadir}/mkspecs/features}
114 cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
115 rm $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
116 install -d $RPM_BUILD_ROOT%{_includedir}/QtSolutions
117 cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/QtSolutions
118 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_qt4_datadir}/mkspecs/features
119 cd ..
120 %endif
121
122 %if %{with qt5}
123 cd build-qt5
124 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt5/QtSolutions,%{_qt5_datadir}/mkspecs/features}
125 cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
126 rm $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
127 cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/qt5/QtSolutions
128 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_qt5_datadir}/mkspecs/features
129 cd ..
130 %endif
131
132 %clean
133 rm -rf $RPM_BUILD_ROOT
134
135 %post   -p /sbin/ldconfig
136 %postun -p /sbin/ldconfig
137
138 %if %{with qt4}
139 %files
140 %defattr(644,root,root,755)
141 %doc README.TXT
142 #%doc LGPL_EXCEPTION.txt LICENSE.*
143 %attr(755,root,root) %{_libdir}/libQtSolutions_LockedFile-%{version}.so.*.*.*
144 %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_LockedFile-%{version}.so.1
145
146 %files devel
147 %defattr(644,root,root,755)
148 %doc doc example
149 %{_libdir}/libQtSolutions_LockedFile-%{version}.so
150 # XXX shared dir with QtSingleApplication
151 %dir %{_includedir}/QtSolutions
152 %{_includedir}/QtSolutions/QtLockedFile
153 %{_includedir}/QtSolutions/qtlockedfile.h
154 %{_qt4_datadir}/mkspecs/features/qtlockedfile.prf
155 %endif
156
157 %if %{with qt5}
158 %files -n Qt5LockedFile
159 %defattr(644,root,root,755)
160 %doc README.TXT
161 %attr(755,root,root) %{_libdir}/libQt5Solutions_LockedFile-%{version}.so.*.*.*
162 %attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_LockedFile-%{version}.so.1
163
164 %files -n Qt5LockedFile-devel
165 %defattr(644,root,root,755)
166 %doc doc example
167 %{_libdir}/libQt5Solutions_LockedFile-%{version}.so
168 # XXX shared dir
169 %dir %{_includedir}/qt5/QtSolutions
170 %{_includedir}/qt5/QtSolutions/QtLockedFile
171 %{_includedir}/qt5/QtSolutions/qtlockedfile.h
172 %{_qt5_datadir}/mkspecs/features/qtlockedfile.prf
173 %endif
This page took 0.057078 seconds and 4 git commands to generate.