]>
Commit | Line | Data |
---|---|---|
03adcd7a ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with bootstrap # build boostrap | |
e6257564 | 4 | %bcond_without verbose # disable verbose build |
03adcd7a | 5 | |
67809d62 JR |
6 | %define ver 0.1.9998 |
7 | %define svnrev 2700 | |
7395c18c ER |
8 | Summary: A cross-platform build environment |
9 | Name: kBuild | |
67809d62 | 10 | Version: %{ver}.%{svnrev} |
7ea8a9f9 | 11 | Release: 2 |
7395c18c ER |
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+ | |
937b464e | 15 | Source0: %{name}-r%{svnrev}.tar.bz2 |
67809d62 | 16 | # Source0-md5: 7c394fbe248f903d0bc1aabd235dc0a9 |
937b464e | 17 | Source1: get-source.sh |
7395c18c ER |
18 | Patch0: %{name}-0.1.3-escape.patch |
19 | Patch1: %{name}-0.1.5-dprintf.patch | |
20 | Patch2: %{name}-0.1.5-pthread.patch | |
3ae532bd | 21 | Patch3: re_string_fetch_byte_case-not-pure-attribute.patch |
6e59f9ac | 22 | URL: http://svn.netlabs.org/kbuild |
7395c18c | 23 | BuildRequires: acl-devel |
7395c18c | 24 | BuildRequires: byacc |
7395c18c | 25 | BuildRequires: flex |
52eeae26 ER |
26 | %if %{with bootstrap} |
27 | BuildRequires: autoconf | |
28 | BuildRequires: automake | |
afb28ddd | 29 | BuildRequires: gettext-autopoint |
52eeae26 ER |
30 | BuildRequires: libtool |
31 | BuildRequires: texinfo | |
32 | %else | |
33 | BuildRequires: kBuild | |
34 | %endif | |
7395c18c ER |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
36 | ||
937b464e ER |
37 | %ifarch %{x8664} |
38 | %define kbuild_arch amd64 | |
39 | %else | |
40 | %define kbuild_arch x86 | |
41 | %endif | |
42 | ||
7395c18c ER |
43 | %description |
44 | This is a GNU make fork with a set of scripts to simplify complex | |
45 | tasks and portable versions of various UNIX tools to ensure | |
46 | cross-platform portability. | |
47 | ||
d10babce | 48 | The goals of the kBuild framework: |
77f5dc2f | 49 | - Similar behavior across all supported platforms |
d10babce ER |
50 | - Flexibility, don't create unnecessary restrictions preventing ad-hoc |
51 | solutions | |
52 | - Makefiles can be simple to write and maintain | |
53 | - One configuration file for a subtree automatically included | |
54 | - Target configuration templates as the primary mechanism for makefile | |
55 | simplification | |
56 | - Tools and SDKs for helping out the templates with flexibility | |
57 | - Non-recursive makefile method by using sub-makefiles | |
7395c18c ER |
58 | |
59 | %prep | |
d4a5e87a ER |
60 | %setup -qc |
61 | mv %{name} .tmp; mv .tmp/* . | |
7395c18c ER |
62 | %patch0 -p1 |
63 | %patch1 -p1 | |
64 | %patch2 -p1 | |
3ae532bd | 65 | %patch3 -p1 |
7395c18c | 66 | |
253d6e7b ER |
67 | cat > SvnInfo.kmk << EOF |
68 | KBUILD_SVN_REV := %{svnrev} | |
69 | KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk | |
70 | EOF | |
71 | ||
937b464e ER |
72 | %{__sed} -i -e 's@_LDFLAGS\.%{kbuild_arch}*.*=@& %{rpmldflags}@g' Config.kmk |
73 | ||
7395c18c | 74 | %build |
e6257564 ER |
75 | %define bootstrap_mflags %{?_smp_mflags} %{?with_verbose:KBUILD_VERBOSE=2} \\\ |
76 | CC="%{__cc}" TOOL_GCC3_CC="%{__cc}" CFLAGS="%{rpmcflags}" | |
77 | ||
78 | %define mflags %{bootstrap_mflags} \\\ | |
79 | NIX_INSTALL_DIR=%{_prefix} \\\ | |
80 | BUILD_TYPE=release \\\ | |
81 | MY_INST_MODE=0644 \\\ | |
7395c18c ER |
82 | MY_INST_BIN_MODE=0755 |
83 | ||
03adcd7a | 84 | ver=$(awk '/^KBUILD_VERSION =/{print $3}' Config.kmk) |
67809d62 | 85 | test "$ver" = %{ver} |
03adcd7a | 86 | |
e6257564 | 87 | %if %{with bootstrap} |
7395c18c ER |
88 | cd src/kmk |
89 | %{__libtoolize} | |
90 | %{__aclocal} -I config | |
91 | %{__autoconf} | |
92 | %{__autoheader} | |
93 | %{__automake} | |
937b464e ER |
94 | cd ../sed |
95 | %{__libtoolize} | |
96 | %{__aclocal} -I config | |
97 | %{__autoconf} | |
98 | %{__autoheader} | |
99 | %{__automake} | |
100 | cd ../.. | |
7395c18c ER |
101 | |
102 | kBuild/env.sh --full \ | |
103 | %{__make} -f bootstrap.gmk %{bootstrap_mflags} | |
e6257564 ER |
104 | |
105 | kBuild/env.sh kmk clean | |
03adcd7a | 106 | %endif |
7395c18c | 107 | |
e6257564 ER |
108 | kBuild/env.sh kmk %{mflags} all \ |
109 | PATH_INS=$RPM_BUILD_ROOT | |
7395c18c ER |
110 | |
111 | %install | |
112 | rm -rf $RPM_BUILD_ROOT | |
7395c18c ER |
113 | kBuild/env.sh kmk %{mflags} install \ |
114 | PATH_INS=$RPM_BUILD_ROOT | |
115 | ||
116 | # These are included later in files section | |
117 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir} | |
118 | ||
119 | %clean | |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
122 | %files | |
123 | %defattr(644,root,root,755) | |
776fed43 | 124 | %doc ChangeLog |
7395c18c ER |
125 | %doc kBuild/doc/COPYING-FDL-1.3 kBuild/doc/QuickReference* |
126 | %attr(755,root,root) %{_bindir}/kDepIDB | |
127 | %attr(755,root,root) %{_bindir}/kDepObj | |
128 | %attr(755,root,root) %{_bindir}/kDepPre | |
129 | %attr(755,root,root) %{_bindir}/kObjCache | |
130 | %attr(755,root,root) %{_bindir}/kmk | |
131 | %attr(755,root,root) %{_bindir}/kmk_append | |
132 | %attr(755,root,root) %{_bindir}/kmk_ash | |
133 | %attr(755,root,root) %{_bindir}/kmk_cat | |
134 | %attr(755,root,root) %{_bindir}/kmk_chmod | |
135 | %attr(755,root,root) %{_bindir}/kmk_cmp | |
136 | %attr(755,root,root) %{_bindir}/kmk_cp | |
137 | %attr(755,root,root) %{_bindir}/kmk_echo | |
138 | %attr(755,root,root) %{_bindir}/kmk_expr | |
139 | %attr(755,root,root) %{_bindir}/kmk_gmake | |
140 | %attr(755,root,root) %{_bindir}/kmk_install | |
141 | %attr(755,root,root) %{_bindir}/kmk_ln | |
142 | %attr(755,root,root) %{_bindir}/kmk_md5sum | |
143 | %attr(755,root,root) %{_bindir}/kmk_mkdir | |
144 | %attr(755,root,root) %{_bindir}/kmk_mv | |
145 | %attr(755,root,root) %{_bindir}/kmk_printf | |
146 | %attr(755,root,root) %{_bindir}/kmk_redirect | |
147 | %attr(755,root,root) %{_bindir}/kmk_rm | |
148 | %attr(755,root,root) %{_bindir}/kmk_rmdir | |
149 | %attr(755,root,root) %{_bindir}/kmk_sed | |
150 | %attr(755,root,root) %{_bindir}/kmk_sleep | |
151 | %attr(755,root,root) %{_bindir}/kmk_test | |
152 | %attr(755,root,root) %{_bindir}/kmk_time | |
153 | %dir %{_datadir}/%{name} | |
154 | %{_datadir}/%{name}/*.kmk | |
155 | %dir %{_datadir}/%{name}/msgstyles | |
156 | %{_datadir}/%{name}/msgstyles/*.kmk | |
157 | %dir %{_datadir}/%{name}/sdks | |
158 | %{_datadir}/%{name}/sdks/*.kmk | |
159 | %dir %{_datadir}/%{name}/templates | |
160 | %{_datadir}/%{name}/templates/*.kmk | |
161 | %dir %{_datadir}/%{name}/tools | |
162 | %{_datadir}/%{name}/tools/*.kmk | |
163 | %dir %{_datadir}/%{name}/units | |
164 | %{_datadir}/%{name}/units/*.kmk |