3 %bcond_with bootstrap # build boostrap
6 Summary: A cross-platform build environment
10 Group: Development/Tools
11 # Most tools are from NetBSD, some are from FreeBSD, and make and sed are from GNU
12 License: BSD and GPL v2+
13 URL: http://svn.netlabs.org/kbuild
14 Source0: %{name}-r%{svnrev}.tar.bz2
15 # Source0-md5: d2ae623626f1e464333c384a2465a77a
16 Source1: get-source.sh
17 Patch0: %{name}-0.1.3-escape.patch
18 Patch1: %{name}-0.1.5-dprintf.patch
19 Patch2: %{name}-0.1.5-pthread.patch
20 BuildRequires: acl-devel
21 BuildRequires: autoconf
22 BuildRequires: automake
26 BuildRequires: gettext-devel
27 %{!?with_bootstrap:BuildRequires: kBuild}
28 ExclusiveArch: %{x8664} %{ix86}
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 %define kbuild_arch amd64
34 %define kbuild_arch x86
38 This is a GNU make fork with a set of scripts to simplify complex
39 tasks and portable versions of various UNIX tools to ensure
40 cross-platform portability.
42 The goals of the kBuild framework:
43 - Similar behavior across all supported platforms
44 - Flexibility, don't create unnecessary restrictions preventing ad-hoc
46 - Makefiles can be simple to write and maintain
47 - One configuration file for a subtree automatically included
48 - Target configuration templates as the primary mechanism for makefile
50 - Tools and SDKs for helping out the templates with flexibility
51 - Non-recursive makefile method by using sub-makefiles
59 cat > SvnInfo.kmk << EOF
60 KBUILD_SVN_REV := %{svnrev}
61 KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk
64 %{__sed} -i -e 's@_LDFLAGS\.%{kbuild_arch}*.*=@& %{rpmldflags}@g' Config.kmk
67 %define bootstrap_mflags %{?_smp_mflags} \\\
69 TOOL_GCC3_CC="%{__cc}" \\\
70 CFLAGS="%{rpmcflags}" \\\
72 KBUILD_VERSION_PATCH=999
74 %define mflags %{bootstrap_mflags} \\\
75 NIX_INSTALL_DIR=%{_prefix} \\\
76 BUILD_TYPE=release \\\
80 ver=$(awk '/^KBUILD_VERSION =/{print $3}' Config.kmk)
81 test "$ver" = %{version}
85 %{__aclocal} -I config
91 %{__aclocal} -I config
98 kBuild/env.sh --full \
99 %{__make} -f bootstrap.gmk %{bootstrap_mflags}
102 kBuild/env.sh kmk %{mflags} rebuild
105 rm -rf $RPM_BUILD_ROOT
106 export KBUILD_VERBOSE=2
107 kBuild/env.sh kmk %{mflags} install \
108 PATH_INS=$RPM_BUILD_ROOT
110 # These are included later in files section
111 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
114 rm -rf $RPM_BUILD_ROOT
117 %defattr(644,root,root,755)
119 %doc kBuild/doc/COPYING-FDL-1.3 kBuild/doc/QuickReference*
120 %attr(755,root,root) %{_bindir}/kDepIDB
121 %attr(755,root,root) %{_bindir}/kDepObj
122 %attr(755,root,root) %{_bindir}/kDepPre
123 %attr(755,root,root) %{_bindir}/kObjCache
124 %attr(755,root,root) %{_bindir}/kmk
125 %attr(755,root,root) %{_bindir}/kmk_append
126 %attr(755,root,root) %{_bindir}/kmk_ash
127 %attr(755,root,root) %{_bindir}/kmk_cat
128 %attr(755,root,root) %{_bindir}/kmk_chmod
129 %attr(755,root,root) %{_bindir}/kmk_cmp
130 %attr(755,root,root) %{_bindir}/kmk_cp
131 %attr(755,root,root) %{_bindir}/kmk_echo
132 %attr(755,root,root) %{_bindir}/kmk_expr
133 %attr(755,root,root) %{_bindir}/kmk_gmake
134 %attr(755,root,root) %{_bindir}/kmk_install
135 %attr(755,root,root) %{_bindir}/kmk_ln
136 %attr(755,root,root) %{_bindir}/kmk_md5sum
137 %attr(755,root,root) %{_bindir}/kmk_mkdir
138 %attr(755,root,root) %{_bindir}/kmk_mv
139 %attr(755,root,root) %{_bindir}/kmk_printf
140 %attr(755,root,root) %{_bindir}/kmk_redirect
141 %attr(755,root,root) %{_bindir}/kmk_rm
142 %attr(755,root,root) %{_bindir}/kmk_rmdir
143 %attr(755,root,root) %{_bindir}/kmk_sed
144 %attr(755,root,root) %{_bindir}/kmk_sleep
145 %attr(755,root,root) %{_bindir}/kmk_test
146 %attr(755,root,root) %{_bindir}/kmk_time
147 %dir %{_datadir}/%{name}
148 %{_datadir}/%{name}/*.kmk
149 %dir %{_datadir}/%{name}/msgstyles
150 %{_datadir}/%{name}/msgstyles/*.kmk
151 %dir %{_datadir}/%{name}/sdks
152 %{_datadir}/%{name}/sdks/*.kmk
153 %dir %{_datadir}/%{name}/templates
154 %{_datadir}/%{name}/templates/*.kmk
155 %dir %{_datadir}/%{name}/tools
156 %{_datadir}/%{name}/tools/*.kmk
157 %dir %{_datadir}/%{name}/units
158 %{_datadir}/%{name}/units/*.kmk