]>
Commit | Line | Data |
---|---|---|
03adcd7a ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with bootstrap # build boostrap | |
4 | ||
253d6e7b | 5 | %define svnrev 2537 |
7395c18c ER |
6 | Summary: A cross-platform build environment |
7 | Name: kBuild | |
03adcd7a ER |
8 | Version: 0.1.999 |
9 | Release: 1 | |
7395c18c ER |
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 | |
253d6e7b ER |
17 | Source0: %{name}-r%{svnrev}.tar.gz |
18 | # Source0-md5: 4890acabce44bb9c94f1211eca1c135c | |
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 | |
22 | BuildRequires: acl-devel | |
03adcd7a | 23 | %{!?with_bootstrap:BuildRequires: kBuild} |
7395c18c ER |
24 | BuildRequires: autoconf |
25 | BuildRequires: automake | |
26 | BuildRequires: byacc | |
27 | BuildRequires: cvs | |
28 | BuildRequires: flex | |
29 | BuildRequires: gettext-devel | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
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. | |
36 | ||
d10babce ER |
37 | The goals of the kBuild framework: |
38 | - Similar behavior across all supported platforms | |
39 | - Flexibility, don't create unnecessary restrictions preventing ad-hoc | |
40 | solutions | |
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 | |
44 | simplification | |
45 | - Tools and SDKs for helping out the templates with flexibility | |
46 | - Non-recursive makefile method by using sub-makefiles | |
7395c18c ER |
47 | |
48 | %prep | |
49 | %setup -q -n %{name} | |
50 | %patch0 -p1 | |
51 | %patch1 -p1 | |
52 | %patch2 -p1 | |
53 | ||
54 | # Remove prebuilt stuff | |
d10babce | 55 | %{__rm} -r kBuild/bin/* |
7395c18c | 56 | |
253d6e7b ER |
57 | cat > SvnInfo.kmk << EOF |
58 | KBUILD_SVN_REV := %{svnrev} | |
59 | KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk | |
60 | EOF | |
61 | ||
7395c18c ER |
62 | # The bootstrap would probably not be needed if we depended on ourselves, |
63 | # yet it is not guarranteed that new versions are compilable with older | |
64 | # kmk versions, so with this we are on a safer side | |
65 | find -name config.log -delete | |
66 | ||
67 | %build | |
d10babce ER |
68 | %define bootstrap_mflags \\\ |
69 | CC="%{__cc}" \\\ | |
70 | TOOL_GCC3_CC="%{__cc}" \\\ | |
71 | CFLAGS="%{rpmcflags}" \\\ | |
7395c18c ER |
72 | KBUILD_VERBOSE=2 \\\ |
73 | KBUILD_VERSION_PATCH=999 | |
74 | ||
75 | %define mflags %{bootstrap_mflags} \\\ | |
76 | NIX_INSTALL_DIR=%{_prefix} \\\ | |
77 | BUILD_TYPE=release \\\ | |
78 | MY_INST_MODE=0644 \\\ | |
79 | MY_INST_BIN_MODE=0755 | |
80 | ||
03adcd7a ER |
81 | ver=$(awk '/^KBUILD_VERSION =/{print $3}' Config.kmk) |
82 | test "$ver" = %{version} | |
83 | ||
7395c18c ER |
84 | cd src/kmk |
85 | %{__libtoolize} | |
86 | %{__aclocal} -I config | |
87 | %{__autoconf} | |
88 | %{__autoheader} | |
89 | %{__automake} | |
90 | cd - | |
91 | ||
03adcd7a | 92 | %if %{with bootstrap} |
7395c18c ER |
93 | kBuild/env.sh --full \ |
94 | %{__make} -f bootstrap.gmk %{bootstrap_mflags} | |
03adcd7a | 95 | %endif |
7395c18c ER |
96 | |
97 | kBuild/env.sh kmk %{mflags} rebuild | |
98 | ||
99 | %install | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | export KBUILD_VERBOSE=2 | |
102 | kBuild/env.sh kmk %{mflags} install \ | |
103 | PATH_INS=$RPM_BUILD_ROOT | |
104 | ||
105 | # These are included later in files section | |
106 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir} | |
107 | ||
108 | %clean | |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | ||
111 | %files | |
112 | %defattr(644,root,root,755) | |
113 | %doc COPYING ChangeLog | |
114 | %doc kBuild/doc/COPYING-FDL-1.3 kBuild/doc/QuickReference* | |
115 | %attr(755,root,root) %{_bindir}/kDepIDB | |
116 | %attr(755,root,root) %{_bindir}/kDepObj | |
117 | %attr(755,root,root) %{_bindir}/kDepPre | |
118 | %attr(755,root,root) %{_bindir}/kObjCache | |
119 | %attr(755,root,root) %{_bindir}/kmk | |
120 | %attr(755,root,root) %{_bindir}/kmk_append | |
121 | %attr(755,root,root) %{_bindir}/kmk_ash | |
122 | %attr(755,root,root) %{_bindir}/kmk_cat | |
123 | %attr(755,root,root) %{_bindir}/kmk_chmod | |
124 | %attr(755,root,root) %{_bindir}/kmk_cmp | |
125 | %attr(755,root,root) %{_bindir}/kmk_cp | |
126 | %attr(755,root,root) %{_bindir}/kmk_echo | |
127 | %attr(755,root,root) %{_bindir}/kmk_expr | |
128 | %attr(755,root,root) %{_bindir}/kmk_gmake | |
129 | %attr(755,root,root) %{_bindir}/kmk_install | |
130 | %attr(755,root,root) %{_bindir}/kmk_ln | |
131 | %attr(755,root,root) %{_bindir}/kmk_md5sum | |
132 | %attr(755,root,root) %{_bindir}/kmk_mkdir | |
133 | %attr(755,root,root) %{_bindir}/kmk_mv | |
134 | %attr(755,root,root) %{_bindir}/kmk_printf | |
135 | %attr(755,root,root) %{_bindir}/kmk_redirect | |
136 | %attr(755,root,root) %{_bindir}/kmk_rm | |
137 | %attr(755,root,root) %{_bindir}/kmk_rmdir | |
138 | %attr(755,root,root) %{_bindir}/kmk_sed | |
139 | %attr(755,root,root) %{_bindir}/kmk_sleep | |
140 | %attr(755,root,root) %{_bindir}/kmk_test | |
141 | %attr(755,root,root) %{_bindir}/kmk_time | |
142 | %dir %{_datadir}/%{name} | |
143 | %{_datadir}/%{name}/*.kmk | |
144 | %dir %{_datadir}/%{name}/msgstyles | |
145 | %{_datadir}/%{name}/msgstyles/*.kmk | |
146 | %dir %{_datadir}/%{name}/sdks | |
147 | %{_datadir}/%{name}/sdks/*.kmk | |
148 | %dir %{_datadir}/%{name}/templates | |
149 | %{_datadir}/%{name}/templates/*.kmk | |
150 | %dir %{_datadir}/%{name}/tools | |
151 | %{_datadir}/%{name}/tools/*.kmk | |
152 | %dir %{_datadir}/%{name}/units | |
153 | %{_datadir}/%{name}/units/*.kmk |