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