source: spec/trunk/SPECS/qtcreator/qtcreator.spec

Last change on this file was 214, checked in by dmik, 10 years ago

Qt Creator: Spec for release 2.2.1-1.

File size: 6.8 KB
Line 
1#
2# http://github.com/dmik/qt-creator-os2
3#
4# If you are a packager, please read HowToDistribute.txt for general
5# instructions.
6#
7
8Name:       qtcreator
9Vendor:     netlabs.org
10License:    LGPLv2 with exceptions
11Url:        http://qt.nokia.com/products/developer-tools
12
13%define ver_major   2
14%define ver_minor   2
15%define ver_patch   1
16
17%define os2_release 0
18
19%define rpm_release 1
20
21%define git_url     http://github.com/dmik/qt-creator-os2/zipball/v%{version}-os2
22
23%define descr_brief Qt Creator is a lightweight, cross-platform integrated \
24development environment (IDE) designed to make development with the Qt \
25application framework even faster and easier.
26
27%define pkg_wps_base            QTCREATOR
28%define pkg_wps_folder_id       <WP_DESKTOP>
29
30%define pkg_docdir      %{_docdir}/%{name}
31
32%if 0%{?os2_release}
33Version:    %{ver_major}.%{ver_minor}.%{ver_patch}.%{os2_release}
34%else
35Version:    %{ver_major}.%{ver_minor}.%{ver_patch}
36%endif
37Release:    %{rpm_release}
38
39Source:     %{name}-%{version}.zip
40
41BuildRequires: libqt4-devel
42BuildRequires: libqt4-webkit-devel
43BuildRequires: qt4-devel-tools
44
45#------------------------------------------------------------------------------
46# commons
47#------------------------------------------------------------------------------
48
49# process command line arguments
50%if "%{?SOURCE_TREE}" == ""
51%define SOURCE_TREE .
52%else
53%define skip_prep_export 1
54%endif
55
56# disable lxlite compression (Qt EXEs and DLLs are already compressed)
57%define __os_install_post       %{nil}
58
59#------------------------------------------------------------------------------
60# main package
61#------------------------------------------------------------------------------
62
63Summary:    Lightweight and cross-platform IDE for Qt
64Group:      Development/Tools
65
66Requires:   libqt4-gui
67Requires:   libqt4-webkit
68Requires:   libqt4-designer
69
70%description
71%{descr_brief}
72
73# @todo see notes in %install
74%files
75%defattr(-,root,root,-)
76%dir %{pkg_docdir}/
77%docdir %{pkg_docdir}/
78%{pkg_docdir}/*
79%{_libdir}/qtcreator/
80%exclude %{_libdir}/qtcreator/share/doc/qtcreator/qtcreator.qch
81
82%post
83%wps_object_create_begin -n %{name}
84%{pkg_wps_base}:WPProgram|Qt Creator|%{pkg_wps_folder_id}|EXENAME=((%{_libdir}/qtcreator/bin/qtcreator.exe))
85%wps_object_create_end
86
87%postun
88%wps_object_delete_all -n %{name}
89
90#------------------------------------------------------------------------------
91%package doc
92#------------------------------------------------------------------------------
93
94Summary:    Qt Creator documentation
95Group:      Documentation
96BuildArch:  noarch
97
98Requires:   %{name} = %{version}-%{release}
99
100%description doc
101%{descr_brief}
102
103# @todo see notes in %install
104%files doc
105%doc %{_libdir}/qtcreator/share/doc/qtcreator/qtcreator.qch
106
107#------------------------------------------------------------------------------
108%prep
109#------------------------------------------------------------------------------
110
111%if !0%{?skip_prep}
112
113%if 0%{?master_mode}
114%if !0%{?skip_prep_export}
115# get clean source tree from github (both for building and for SRPM)
116%setup -n "%{name}-%{version}" -Tc
117rm -f "%{_sourcedir}/%{name}-%{version}.zip"
118wget --no-check-certificate %{git_url} -O %{_sourcedir}/%{name}-%{version}.zip
119unzip -qq "%{_sourcedir}/%{name}-%{version}.zip"
120mv "./$(ls -fx1 | grep qt-creator)/*" "./"
121%else
122# use source tree in %{SOURCE_TREE} (e.g. shadow build)
123%setup -n "%{name}-%{version}" -Tc%{?skip_prep_clean:D}
124%endif
125%else
126# use source zip (the dir name in it is different, so unzip/rename manually too)
127%setup -n "%{name}-%{version}" -Tc
128unzip -qq "%{_sourcedir}/%{name}-%{version}.zip"
129mv "./$(ls -fx1 | grep qt-creator)/*" "./"
130%endif
131
132%endif # if !0%{?skip_prep}
133
134#------------------------------------------------------------------------------
135%build
136#------------------------------------------------------------------------------
137
138%if !0%{?skip_build}
139
140die() { echo "ERROR: $@"; exit 1; }
141check_var() { eval "[ -n \"\$$1\" ] || die \"$1 variable is not set.\""; }
142
143# Qt source tree (DOS format)
144SOURCE_TREE_D=$(echo "%{SOURCE_TREE}" | tr '/' '\\')
145
146[ -z "$MAKE_JOBS" ] && MAKE_JOBS=1
147
148# CMD.EXE is required by the build process for now
149export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE
150
151qmake $SOURCE_TREE_D
152
153make -j$MAKE_JOBS
154
155%endif # if !0%{?skip_build}
156
157#------------------------------------------------------------------------------
158%install
159#------------------------------------------------------------------------------
160
161# @todo make install creates three subdirs: bin/, lib/ and share/. We install
162# them all to %{_libdir}/qtcreator/ instead of placing files to system bin/
163# lib/ and share/ because we need to patch sources to make it work:
164#   1. qtcreator.exe creates and uses private DLLs with very common names (eg.
165#      ExtSys.dll) so they cannot live in %{_libdir}. We should:
166#      - Move these private DLLs and EXEs to %{_libdir}/qtcreator/ (this requres
167#        patching the sources to add the new directory relative to the new EXE
168#        location to the plugin search list).
169#      - Create EXE wrappers that will live in %{_prefix}/bin/ and, when started,
170#        start their couterparts living in %{_libdir}/qtcreator/ after adding
171#        this path to BEGINLIBPATH.
172#   2. Place qtcreator.qch...
173
174
175%if !0%{?skip_install}
176
177rm -rf %{buildroot}
178
179# CMD.EXE is required by the build process for now
180export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE
181
182INSTALL_ROOT="%{buildroot}%{_libdir}/qtcreator"
183
184make install INSTALL_ROOT=$(echo "$INSTALL_ROOT" | sed -re 's,/,\\,g')
185
186# copy READMEs (make install doesn't do that)
187mkdir -p "%{buildroot}%{pkg_docdir}/"
188cp -dp \
189    "%{SOURCE_TREE}/LICENSE.LGPL" \
190    "%{SOURCE_TREE}/LGPL_EXCEPTION.TXT" \
191    "%{SOURCE_TREE}/README" \
192    "%{buildroot}%{pkg_docdir}/"
193
194# share/pixmaps/qtcreator_*.png is of no use ATM
195rm -rf "$INSTALL_ROOT/share/pixmaps/"
196
197
198# @todo temporarily split out .sym files (until we generate -debuginfo packages)
199rm -rf %{buildroot}.sym
200for f in $(cd "%{buildroot}" && find -type f -name "*.sym"); do
201    fd="${f%/*}"/
202    [ "$fp" = "$f/" ] && fd=
203    [ -d "%{buildroot}.sym/$fd" ] || mkdir -p "%{buildroot}.sym/$fd"
204    mv "%{buildroot}/$f" "%{buildroot}.sym/$fd"
205done
206
207%endif # if !0%{?skip_install}
208
209#------------------------------------------------------------------------------
210%clean
211#------------------------------------------------------------------------------
212
213%if !0%{?skip_clean}
214
215%if 0%{?master_mode}
216%if "%{?create_zips_script}" != ""
217# @todo put split out .sym files back
218(cd "%{buildroot}.sym" && find . -type f -name '*.sym' -exec mv "{}" "../%{buildroot}/{}" \;)
219rm -rf "%{buildroot}.sym"
220%{create_zips_script} "%{buildroot}" "%{_topdir}"
221%endif
222%endif
223
224rm -rf %{buildroot}
225
226%endif # if !0%{?skip_clean}
227
228#------------------------------------------------------------------------------
229%changelog
230* Thu Sep 17 2011 Dmitriy Kuminov <dmik/coding.org> 2.2.1-1
231- New release 2.2.1. See %{pkg_docdir}/changes-4.7.3 and
232  %{pkg_docdir}/CHANGES.OS2 for more information.
Note: See TracBrowser for help on using the repository browser.