]> git.pld-linux.org Git - packages/QtLockedFile.git/blob - QtLockedFile.spec
prepare qt5 build
[packages/QtLockedFile.git] / QtLockedFile.spec
1 #
2 # Conditional build:
3 %bcond_without  qt4             # build Qt4
4 %bcond_with     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 %if %{with qt4}
25 BuildRequires:  QtCore-devel
26 BuildRequires:  libstdc++-devel
27 BuildRequires:  qt4-qmake
28 %endif
29 %if %{with qt5}
30 %endif
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %define         _qt4_datadir    %{_datadir}/qt4
34 %define         _qt5_datadir    %{_datadir}/qt5
35
36 %description
37 This class extends the QFile class with inter-process file locking
38 capabilities. If an application requires that several processes should
39 access the same file, QtLockedFile can be used to easily ensure that
40 only one process at a time is writing to the file, and that no process
41 is writing to it while others are reading it.
42
43 %package devel
44 Summary:        Development files for QtLockedFile library
45 Group:          Development/Libraries
46 Requires:       %{name} = %{version}-%{release}
47 Requires:       qt4-build
48 Requires:       qt4-qmake
49
50 %description devel
51 This package contains libraries and header files for developing
52 applications that use QtLockedFile.
53
54 %prep
55 %setup -qc
56 %patch0 -p1
57 %patch1 -p0
58
59 set -- *
60 install -d build-qt{4,5}
61 cp -al "$@" build-qt4
62 cp -al "$@" build-qt5
63
64 %build
65 %if %{with qt4}
66 cd build-qt4
67 # Does not use GNU configure
68 ./configure -library
69 qmake-qt4
70 %{__make}
71 cd ..
72 %endif
73
74 %if %{with qt5}
75 cd build-qt5
76 ./configure -library
77 qmake-qt5
78 %{__make}
79 cd ..
80 %endif
81
82 %install
83 rm -rf $RPM_BUILD_ROOT
84
85 %if %{with qt4}
86 cd build-qt4
87 install -d $RPM_BUILD_ROOT{%{_libdir},%{_qt4_datadir}/mkspecs/features}
88 cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
89 rm $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
90 install -d $RPM_BUILD_ROOT%{_includedir}/QtSolutions
91 cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/QtSolutions
92 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_qt4_datadir}/mkspecs/features
93 cd ..
94 %endif
95
96 %if %{with qt5}
97 cd build-qt5
98 install -d $RPM_BUILD_ROOT{%{_libdir},%{_qt5_datadir}/mkspecs/features}
99 cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
100 rm $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
101 install -d $RPM_BUILD_ROOT%{_includedir}/QtSolutions
102 cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/QtSolutions
103 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_qt5_datadir}/mkspecs/features
104 cd ..
105 %endif
106
107 %clean
108 rm -rf $RPM_BUILD_ROOT
109
110 %post   -p /sbin/ldconfig
111 %postun -p /sbin/ldconfig
112
113 %if %{with qt4}
114 %files
115 %defattr(644,root,root,755)
116 %doc README.TXT
117 #%doc LGPL_EXCEPTION.txt LICENSE.*
118 %attr(755,root,root) %{_libdir}/libQtSolutions_LockedFile-%{version}.so.*.*.*
119 %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_LockedFile-%{version}.so.1
120
121 %files devel
122 %defattr(644,root,root,755)
123 %doc doc example
124 %{_libdir}/libQtSolutions_LockedFile-%{version}.so
125 # XXX shared dir with QtSingleApplication
126 %dir %{_includedir}/QtSolutions
127 %{_includedir}/QtSolutions/QtLockedFile
128 %{_includedir}/QtSolutions/qtlockedfile.h
129 %{_qt4_datadir}/mkspecs/features/qtlockedfile.prf
130 %endif
131
132 %if %{with qt5}
133 %files
134 %defattr(644,root,root,755)
135 %doc README.TXT
136 %attr(755,root,root) %{_libdir}/libQtSolutions_LockedFile-%{version}.so.*.*.*
137 %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_LockedFile-%{version}.so.1
138
139 %files devel
140 %defattr(644,root,root,755)
141 %doc doc example
142 %{_libdir}/libQtSolutions_LockedFile-%{version}.so
143 # XXX shared dir with QtSingleApplication
144 %dir %{_includedir}/QtSolutions
145 %{_includedir}/QtSolutions/QtLockedFile
146 %{_includedir}/QtSolutions/qtlockedfile.h
147 %{_qt5_datadir}/mkspecs/features/qtlockedfile.prf
148 %endif
This page took 0.324431 seconds and 4 git commands to generate.