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: ftp://ftp.netlabs.org/pub/kbuild/%{name}-%{version}%{?patchlevel:-%{patchlevel}}-src.tar.gz
15 # svn co -e2537 http://svn.netlabs.org/repos/kbuild/trunk@2537 kBuild
16 # tar czf kBuild-r2537.tar.gz --exclude .svn kBuild
17 Source0: %{name}-r%{svnrev}.tar.gz
18 # Source0-md5: 4890acabce44bb9c94f1211eca1c135c
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 BuildRequires: acl-devel
23 %{!?with_bootstrap:BuildRequires: kBuild}
24 BuildRequires: autoconf
25 BuildRequires: automake
29 BuildRequires: gettext-devel
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 This is a GNU make fork with a set of scripts to simplify complex
34 tasks and portable versions of various UNIX tools to ensure
35 cross-platform portability.
37 The goals of the kBuild framework:
38 - Similar behavior across all supported platforms
39 - Flexibility, don't create unnecessary restrictions preventing ad-hoc
41 - Makefiles can be simple to write and maintain
42 - One configuration file for a subtree automatically included
43 - Target configuration templates as the primary mechanism for makefile
45 - Tools and SDKs for helping out the templates with flexibility
46 - Non-recursive makefile method by using sub-makefiles
54 # Remove prebuilt stuff
55 %{__rm} -r kBuild/bin/*
57 cat > SvnInfo.kmk << EOF
58 KBUILD_SVN_REV := %{svnrev}
59 KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk
63 %define bootstrap_mflags %{?_smp_mflags} \\\
65 TOOL_GCC3_CC="%{__cc}" \\\
66 CFLAGS="%{rpmcflags}" \\\
68 KBUILD_VERSION_PATCH=999
70 %define mflags %{bootstrap_mflags} \\\
71 NIX_INSTALL_DIR=%{_prefix} \\\
72 BUILD_TYPE=release \\\
76 ver=$(awk '/^KBUILD_VERSION =/{print $3}' Config.kmk)
77 test "$ver" = %{version}
81 %{__aclocal} -I config
88 kBuild/env.sh --full \
89 %{__make} -f bootstrap.gmk %{bootstrap_mflags}
92 kBuild/env.sh kmk %{mflags} rebuild
95 rm -rf $RPM_BUILD_ROOT
96 export KBUILD_VERBOSE=2
97 kBuild/env.sh kmk %{mflags} install \
98 PATH_INS=$RPM_BUILD_ROOT
100 # These are included later in files section
101 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
104 rm -rf $RPM_BUILD_ROOT
107 %defattr(644,root,root,755)
109 %doc kBuild/doc/COPYING-FDL-1.3 kBuild/doc/QuickReference*
110 %attr(755,root,root) %{_bindir}/kDepIDB
111 %attr(755,root,root) %{_bindir}/kDepObj
112 %attr(755,root,root) %{_bindir}/kDepPre
113 %attr(755,root,root) %{_bindir}/kObjCache
114 %attr(755,root,root) %{_bindir}/kmk
115 %attr(755,root,root) %{_bindir}/kmk_append
116 %attr(755,root,root) %{_bindir}/kmk_ash
117 %attr(755,root,root) %{_bindir}/kmk_cat
118 %attr(755,root,root) %{_bindir}/kmk_chmod
119 %attr(755,root,root) %{_bindir}/kmk_cmp
120 %attr(755,root,root) %{_bindir}/kmk_cp
121 %attr(755,root,root) %{_bindir}/kmk_echo
122 %attr(755,root,root) %{_bindir}/kmk_expr
123 %attr(755,root,root) %{_bindir}/kmk_gmake
124 %attr(755,root,root) %{_bindir}/kmk_install
125 %attr(755,root,root) %{_bindir}/kmk_ln
126 %attr(755,root,root) %{_bindir}/kmk_md5sum
127 %attr(755,root,root) %{_bindir}/kmk_mkdir
128 %attr(755,root,root) %{_bindir}/kmk_mv
129 %attr(755,root,root) %{_bindir}/kmk_printf
130 %attr(755,root,root) %{_bindir}/kmk_redirect
131 %attr(755,root,root) %{_bindir}/kmk_rm
132 %attr(755,root,root) %{_bindir}/kmk_rmdir
133 %attr(755,root,root) %{_bindir}/kmk_sed
134 %attr(755,root,root) %{_bindir}/kmk_sleep
135 %attr(755,root,root) %{_bindir}/kmk_test
136 %attr(755,root,root) %{_bindir}/kmk_time
137 %dir %{_datadir}/%{name}
138 %{_datadir}/%{name}/*.kmk
139 %dir %{_datadir}/%{name}/msgstyles
140 %{_datadir}/%{name}/msgstyles/*.kmk
141 %dir %{_datadir}/%{name}/sdks
142 %{_datadir}/%{name}/sdks/*.kmk
143 %dir %{_datadir}/%{name}/templates
144 %{_datadir}/%{name}/templates/*.kmk
145 %dir %{_datadir}/%{name}/tools
146 %{_datadir}/%{name}/tools/*.kmk
147 %dir %{_datadir}/%{name}/units
148 %{_datadir}/%{name}/units/*.kmk