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 URL: http://svn.netlabs.org/kbuild
16 Source0: %{name}-r%{svnrev}.tar.bz2
17 # Source0-md5: 7c394fbe248f903d0bc1aabd235dc0a9
18 Source1: get-source.sh
19 Patch0: %{name}-0.1.3-escape.patch
20 Patch1: %{name}-0.1.5-dprintf.patch
21 Patch2: %{name}-0.1.5-pthread.patch
22 Patch3: re_string_fetch_byte_case-not-pure-attribute.patch
23 BuildRequires: acl-devel
24 BuildRequires: autoconf
25 BuildRequires: automake
29 BuildRequires: gettext-devel
30 %{!?with_bootstrap:BuildRequires: kBuild}
31 ExclusiveArch: %{x8664} %{ix86}
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 %define kbuild_arch amd64
37 %define kbuild_arch x86
41 This is a GNU make fork with a set of scripts to simplify complex
42 tasks and portable versions of various UNIX tools to ensure
43 cross-platform portability.
45 The goals of the kBuild framework:
46 - Similar behavior across all supported platforms
47 - Flexibility, don't create unnecessary restrictions preventing ad-hoc
49 - Makefiles can be simple to write and maintain
50 - One configuration file for a subtree automatically included
51 - Target configuration templates as the primary mechanism for makefile
53 - Tools and SDKs for helping out the templates with flexibility
54 - Non-recursive makefile method by using sub-makefiles
58 mv %{name} .tmp; mv .tmp/* .
64 cat > SvnInfo.kmk << EOF
65 KBUILD_SVN_REV := %{svnrev}
66 KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk
69 %{__sed} -i -e 's@_LDFLAGS\.%{kbuild_arch}*.*=@& %{rpmldflags}@g' Config.kmk
72 %define bootstrap_mflags %{?_smp_mflags} %{?with_verbose:KBUILD_VERBOSE=2} \\\
73 CC="%{__cc}" TOOL_GCC3_CC="%{__cc}" CFLAGS="%{rpmcflags}"
75 %define mflags %{bootstrap_mflags} \\\
76 NIX_INSTALL_DIR=%{_prefix} \\\
77 BUILD_TYPE=release \\\
81 ver=$(awk '/^KBUILD_VERSION =/{print $3}' Config.kmk)
87 %{__aclocal} -I config
93 %{__aclocal} -I config
99 kBuild/env.sh --full \
100 %{__make} -f bootstrap.gmk %{bootstrap_mflags}
102 kBuild/env.sh kmk clean
105 kBuild/env.sh kmk %{mflags} all \
106 PATH_INS=$RPM_BUILD_ROOT
109 rm -rf $RPM_BUILD_ROOT
110 kBuild/env.sh kmk %{mflags} install \
111 PATH_INS=$RPM_BUILD_ROOT
113 # These are included later in files section
114 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
117 rm -rf $RPM_BUILD_ROOT
120 %defattr(644,root,root,755)
122 %doc kBuild/doc/COPYING-FDL-1.3 kBuild/doc/QuickReference*
123 %attr(755,root,root) %{_bindir}/kDepIDB
124 %attr(755,root,root) %{_bindir}/kDepObj
125 %attr(755,root,root) %{_bindir}/kDepPre
126 %attr(755,root,root) %{_bindir}/kObjCache
127 %attr(755,root,root) %{_bindir}/kmk
128 %attr(755,root,root) %{_bindir}/kmk_append
129 %attr(755,root,root) %{_bindir}/kmk_ash
130 %attr(755,root,root) %{_bindir}/kmk_cat
131 %attr(755,root,root) %{_bindir}/kmk_chmod
132 %attr(755,root,root) %{_bindir}/kmk_cmp
133 %attr(755,root,root) %{_bindir}/kmk_cp
134 %attr(755,root,root) %{_bindir}/kmk_echo
135 %attr(755,root,root) %{_bindir}/kmk_expr
136 %attr(755,root,root) %{_bindir}/kmk_gmake
137 %attr(755,root,root) %{_bindir}/kmk_install
138 %attr(755,root,root) %{_bindir}/kmk_ln
139 %attr(755,root,root) %{_bindir}/kmk_md5sum
140 %attr(755,root,root) %{_bindir}/kmk_mkdir
141 %attr(755,root,root) %{_bindir}/kmk_mv
142 %attr(755,root,root) %{_bindir}/kmk_printf
143 %attr(755,root,root) %{_bindir}/kmk_redirect
144 %attr(755,root,root) %{_bindir}/kmk_rm
145 %attr(755,root,root) %{_bindir}/kmk_rmdir
146 %attr(755,root,root) %{_bindir}/kmk_sed
147 %attr(755,root,root) %{_bindir}/kmk_sleep
148 %attr(755,root,root) %{_bindir}/kmk_test
149 %attr(755,root,root) %{_bindir}/kmk_time
150 %dir %{_datadir}/%{name}
151 %{_datadir}/%{name}/*.kmk
152 %dir %{_datadir}/%{name}/msgstyles
153 %{_datadir}/%{name}/msgstyles/*.kmk
154 %dir %{_datadir}/%{name}/sdks
155 %{_datadir}/%{name}/sdks/*.kmk
156 %dir %{_datadir}/%{name}/templates
157 %{_datadir}/%{name}/templates/*.kmk
158 %dir %{_datadir}/%{name}/tools
159 %{_datadir}/%{name}/tools/*.kmk
160 %dir %{_datadir}/%{name}/units
161 %{_datadir}/%{name}/units/*.kmk