3 %bcond_with bootstrap # build boostrap
4 %bcond_without verbose # disable verbose build
7 Summary: A cross-platform build environment
11 Group: Development/Tools
12 # Most tools are from NetBSD, some are from FreeBSD, and make and sed are from GNU
13 License: BSD and GPL v2+
14 URL: http://svn.netlabs.org/kbuild
15 Source0: %{name}-r%{svnrev}.tar.bz2
16 # Source0-md5: d2ae623626f1e464333c384a2465a77a
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 BuildRequires: acl-devel
22 BuildRequires: autoconf
23 BuildRequires: automake
27 BuildRequires: gettext-devel
28 %{!?with_bootstrap:BuildRequires: kBuild}
29 ExclusiveArch: %{x8664} %{ix86}
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 %define kbuild_arch amd64
35 %define kbuild_arch x86
39 This is a GNU make fork with a set of scripts to simplify complex
40 tasks and portable versions of various UNIX tools to ensure
41 cross-platform portability.
43 The goals of the kBuild framework:
44 - Similar behavior across all supported platforms
45 - Flexibility, don't create unnecessary restrictions preventing ad-hoc
47 - Makefiles can be simple to write and maintain
48 - One configuration file for a subtree automatically included
49 - Target configuration templates as the primary mechanism for makefile
51 - Tools and SDKs for helping out the templates with flexibility
52 - Non-recursive makefile method by using sub-makefiles
56 mv %{name} .tmp; mv .tmp/* .
61 cat > SvnInfo.kmk << EOF
62 KBUILD_SVN_REV := %{svnrev}
63 KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk
66 %{__sed} -i -e 's@_LDFLAGS\.%{kbuild_arch}*.*=@& %{rpmldflags}@g' Config.kmk
69 %define bootstrap_mflags %{?_smp_mflags} %{?with_verbose:KBUILD_VERBOSE=2} \\\
70 CC="%{__cc}" TOOL_GCC3_CC="%{__cc}" CFLAGS="%{rpmcflags}"
72 %define mflags %{bootstrap_mflags} \\\
73 NIX_INSTALL_DIR=%{_prefix} \\\
74 BUILD_TYPE=release \\\
78 ver=$(awk '/^KBUILD_VERSION =/{print $3}' Config.kmk)
79 test "$ver" = %{version}
84 %{__aclocal} -I config
90 %{__aclocal} -I config
96 kBuild/env.sh --full \
97 %{__make} -f bootstrap.gmk %{bootstrap_mflags}
99 kBuild/env.sh kmk clean
102 kBuild/env.sh kmk %{mflags} all \
103 PATH_INS=$RPM_BUILD_ROOT
106 rm -rf $RPM_BUILD_ROOT
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