]>
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+ | |
15 | URL: http://svn.netlabs.org/kbuild | |
937b464e | 16 | Source0: %{name}-r%{svnrev}.tar.bz2 |
67809d62 | 17 | # Source0-md5: 7c394fbe248f903d0bc1aabd235dc0a9 |
937b464e | 18 | Source1: get-source.sh |
7395c18c ER |
19 | Patch0: %{name}-0.1.3-escape.patch |
20 | Patch1: %{name}-0.1.5-dprintf.patch | |
21 | Patch2: %{name}-0.1.5-pthread.patch | |
3ae532bd | 22 | Patch3: re_string_fetch_byte_case-not-pure-attribute.patch |
7395c18c ER |
23 | BuildRequires: acl-devel |
24 | BuildRequires: autoconf | |
25 | BuildRequires: automake | |
26 | BuildRequires: byacc | |
27 | BuildRequires: cvs | |
28 | BuildRequires: flex | |
afb28ddd | 29 | BuildRequires: gettext-autopoint |
15c5fcb9 | 30 | BuildRequires: gettext-tools |
937b464e | 31 | %{!?with_bootstrap:BuildRequires: kBuild} |
7395c18c ER |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
33 | ||
937b464e ER |
34 | %ifarch %{x8664} |
35 | %define kbuild_arch amd64 | |
36 | %else | |
37 | %define kbuild_arch x86 | |
38 | %endif | |
39 | ||
7395c18c ER |
40 | %description |
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. | |
44 | ||
d10babce | 45 | The goals of the kBuild framework: |
77f5dc2f | 46 | - Similar behavior across all supported platforms |
d10babce ER |
47 | - Flexibility, don't create unnecessary restrictions preventing ad-hoc |
48 | solutions | |
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 | |
52 | simplification | |
53 | - Tools and SDKs for helping out the templates with flexibility | |
54 | - Non-recursive makefile method by using sub-makefiles | |
7395c18c ER |
55 | |
56 | %prep | |
d4a5e87a ER |
57 | %setup -qc |
58 | mv %{name} .tmp; mv .tmp/* . | |
7395c18c ER |
59 | %patch0 -p1 |
60 | %patch1 -p1 | |
61 | %patch2 -p1 | |
3ae532bd | 62 | %patch3 -p1 |
7395c18c | 63 | |
253d6e7b ER |
64 | cat > SvnInfo.kmk << EOF |
65 | KBUILD_SVN_REV := %{svnrev} | |
66 | KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk | |
67 | EOF | |
68 | ||
937b464e ER |
69 | %{__sed} -i -e 's@_LDFLAGS\.%{kbuild_arch}*.*=@& %{rpmldflags}@g' Config.kmk |
70 | ||
7395c18c | 71 | %build |
e6257564 ER |
72 | %define bootstrap_mflags %{?_smp_mflags} %{?with_verbose:KBUILD_VERBOSE=2} \\\ |
73 | CC="%{__cc}" TOOL_GCC3_CC="%{__cc}" CFLAGS="%{rpmcflags}" | |
74 | ||
75 | %define mflags %{bootstrap_mflags} \\\ | |
76 | NIX_INSTALL_DIR=%{_prefix} \\\ | |
77 | BUILD_TYPE=release \\\ | |
78 | MY_INST_MODE=0644 \\\ | |
7395c18c ER |
79 | MY_INST_BIN_MODE=0755 |
80 | ||
03adcd7a | 81 | ver=$(awk '/^KBUILD_VERSION =/{print $3}' Config.kmk) |
67809d62 | 82 | test "$ver" = %{ver} |
03adcd7a | 83 | |
e6257564 | 84 | %if %{with bootstrap} |
7395c18c ER |
85 | cd src/kmk |
86 | %{__libtoolize} | |
87 | %{__aclocal} -I config | |
88 | %{__autoconf} | |
89 | %{__autoheader} | |
90 | %{__automake} | |
937b464e ER |
91 | cd ../sed |
92 | %{__libtoolize} | |
93 | %{__aclocal} -I config | |
94 | %{__autoconf} | |
95 | %{__autoheader} | |
96 | %{__automake} | |
97 | cd ../.. | |
7395c18c ER |
98 | |
99 | kBuild/env.sh --full \ | |
100 | %{__make} -f bootstrap.gmk %{bootstrap_mflags} | |
e6257564 ER |
101 | |
102 | kBuild/env.sh kmk clean | |
03adcd7a | 103 | %endif |
7395c18c | 104 | |
e6257564 ER |
105 | kBuild/env.sh kmk %{mflags} all \ |
106 | PATH_INS=$RPM_BUILD_ROOT | |
7395c18c ER |
107 | |
108 | %install | |
109 | rm -rf $RPM_BUILD_ROOT | |
7395c18c ER |
110 | kBuild/env.sh kmk %{mflags} install \ |
111 | PATH_INS=$RPM_BUILD_ROOT | |
112 | ||
113 | # These are included later in files section | |
114 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir} | |
115 | ||
116 | %clean | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
119 | %files | |
120 | %defattr(644,root,root,755) | |
776fed43 | 121 | %doc ChangeLog |
7395c18c ER |
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 |