3 %bcond_with bootstrap # build boostrap
4 %bcond_without verbose # disable verbose build
8 Summary: A cross-platform build environment
10 Version: %{ver}.%{svnrev}
12 Group: Development/Tools
13 # Most tools are from NetBSD, some are from FreeBSD, and make and sed are from GNU
14 License: BSD and GPL v2+
15 Source0: %{name}-r%{svnrev}.tar.bz2
16 # Source0-md5: 7c394fbe248f903d0bc1aabd235dc0a9
17 Source1: get-source.sh
18 Patch0: %{name}-0.1.3-escape.patch
19 Patch1: %{name}-0.1.5-dprintf.patch
20 Patch2: %{name}-0.1.5-pthread.patch
21 Patch3: re_string_fetch_byte_case-not-pure-attribute.patch
23 URL: http://svn.netlabs.org/kbuild
24 BuildRequires: acl-devel
28 BuildRequires: autoconf
29 BuildRequires: automake
30 BuildRequires: gettext-autopoint
31 BuildRequires: libtool
32 BuildRequires: texinfo
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 %define kbuild_arch amd64
41 %define kbuild_arch x86
45 This is a GNU make fork with a set of scripts to simplify complex
46 tasks and portable versions of various UNIX tools to ensure
47 cross-platform portability.
49 The goals of the kBuild framework:
50 - Similar behavior across all supported platforms
51 - Flexibility, don't create unnecessary restrictions preventing ad-hoc
53 - Makefiles can be simple to write and maintain
54 - One configuration file for a subtree automatically included
55 - Target configuration templates as the primary mechanism for makefile
57 - Tools and SDKs for helping out the templates with flexibility
58 - Non-recursive makefile method by using sub-makefiles
62 mv %{name} .tmp; mv .tmp/* .
69 cat > SvnInfo.kmk << EOF
70 KBUILD_SVN_REV := %{svnrev}
71 KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk
74 %{__sed} -i -e 's@_LDFLAGS\.%{kbuild_arch}*.*=@& %{rpmldflags}@g' Config.kmk
77 # probably should add full x32 configuration
78 # but can't find place to submit code upstream, so this will do for now.
79 # but then again, forcing -m64 is bad and pointless
80 sed -i -e 's/-m64//' kBuild/tools/GCC64.kmk kBuild/tools/GXX64.kmk tests/Config.kmk Config.kmk
84 %define bootstrap_mflags %{?_smp_mflags} %{?with_verbose:KBUILD_VERBOSE=2} \\\
85 CC="%{__cc}" TOOL_GCC3_CC="%{__cc}" CFLAGS="%{rpmcflags}"
87 %define mflags %{bootstrap_mflags} \\\
88 NIX_INSTALL_DIR=%{_prefix} \\\
89 BUILD_TYPE=release \\\
93 ver=$(awk '/^KBUILD_VERSION =/{print $3}' Config.kmk)
99 %{__aclocal} -I config
105 %{__aclocal} -I config
111 kBuild/env.sh --full \
112 %{__make} -f bootstrap.gmk %{bootstrap_mflags}
114 kBuild/env.sh kmk clean
117 kBuild/env.sh kmk %{mflags} all \
118 PATH_INS=$RPM_BUILD_ROOT
121 rm -rf $RPM_BUILD_ROOT
122 kBuild/env.sh kmk %{mflags} install \
123 PATH_INS=$RPM_BUILD_ROOT
125 # These are included later in files section
126 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
129 rm -rf $RPM_BUILD_ROOT
132 %defattr(644,root,root,755)
134 %doc kBuild/doc/COPYING-FDL-1.3 kBuild/doc/QuickReference*
135 %attr(755,root,root) %{_bindir}/kDepIDB
136 %attr(755,root,root) %{_bindir}/kDepObj
137 %attr(755,root,root) %{_bindir}/kDepPre
138 %attr(755,root,root) %{_bindir}/kObjCache
139 %attr(755,root,root) %{_bindir}/kmk
140 %attr(755,root,root) %{_bindir}/kmk_append
141 %attr(755,root,root) %{_bindir}/kmk_ash
142 %attr(755,root,root) %{_bindir}/kmk_cat
143 %attr(755,root,root) %{_bindir}/kmk_chmod
144 %attr(755,root,root) %{_bindir}/kmk_cmp
145 %attr(755,root,root) %{_bindir}/kmk_cp
146 %attr(755,root,root) %{_bindir}/kmk_echo
147 %attr(755,root,root) %{_bindir}/kmk_expr
148 %attr(755,root,root) %{_bindir}/kmk_gmake
149 %attr(755,root,root) %{_bindir}/kmk_install
150 %attr(755,root,root) %{_bindir}/kmk_ln
151 %attr(755,root,root) %{_bindir}/kmk_md5sum
152 %attr(755,root,root) %{_bindir}/kmk_mkdir
153 %attr(755,root,root) %{_bindir}/kmk_mv
154 %attr(755,root,root) %{_bindir}/kmk_printf
155 %attr(755,root,root) %{_bindir}/kmk_redirect
156 %attr(755,root,root) %{_bindir}/kmk_rm
157 %attr(755,root,root) %{_bindir}/kmk_rmdir
158 %attr(755,root,root) %{_bindir}/kmk_sed
159 %attr(755,root,root) %{_bindir}/kmk_sleep
160 %attr(755,root,root) %{_bindir}/kmk_test
161 %attr(755,root,root) %{_bindir}/kmk_time
162 %dir %{_datadir}/%{name}
163 %{_datadir}/%{name}/*.kmk
164 %dir %{_datadir}/%{name}/msgstyles
165 %{_datadir}/%{name}/msgstyles/*.kmk
166 %dir %{_datadir}/%{name}/sdks
167 %{_datadir}/%{name}/sdks/*.kmk
168 %dir %{_datadir}/%{name}/templates
169 %{_datadir}/%{name}/templates/*.kmk
170 %dir %{_datadir}/%{name}/tools
171 %{_datadir}/%{name}/tools/*.kmk
172 %dir %{_datadir}/%{name}/units
173 %{_datadir}/%{name}/units/*.kmk