]> git.pld-linux.org Git - packages/kBuild.git/blob - kBuild.spec
- up to 0.1.9998, svn 2577; apply lflags; auto conf sed
[packages/kBuild.git] / kBuild.spec
1 #
2 # Conditional build:
3 %bcond_with     bootstrap               # build boostrap
4
5 %define         svnrev 2577
6 Summary:        A cross-platform build environment
7 Name:           kBuild
8 Version:        0.1.9998
9 Release:        1
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:        %{name}-r%{svnrev}.tar.bz2
15 # Source0-md5:  d2ae623626f1e464333c384a2465a77a
16 Source1:        get-source.sh
17 Patch0:         %{name}-0.1.3-escape.patch
18 Patch1:         %{name}-0.1.5-dprintf.patch
19 Patch2:         %{name}-0.1.5-pthread.patch
20 BuildRequires:  acl-devel
21 BuildRequires:  autoconf
22 BuildRequires:  automake
23 BuildRequires:  byacc
24 BuildRequires:  cvs
25 BuildRequires:  flex
26 BuildRequires:  gettext-devel
27 %{!?with_bootstrap:BuildRequires:       kBuild}
28 ExclusiveArch:  %{x8664} %{ix86}
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %ifarch %{x8664}
32 %define         kbuild_arch     amd64
33 %else
34 %define         kbuild_arch     x86
35 %endif
36
37 %description
38 This is a GNU make fork with a set of scripts to simplify complex
39 tasks and portable versions of various UNIX tools to ensure
40 cross-platform portability.
41
42 The goals of the kBuild framework:
43  - Similar behavior across all supported platforms
44 - Flexibility, don't create unnecessary restrictions preventing ad-hoc
45   solutions
46 - Makefiles can be simple to write and maintain
47 - One configuration file for a subtree automatically included
48 - Target configuration templates as the primary mechanism for makefile
49   simplification
50 - Tools and SDKs for helping out the templates with flexibility
51 - Non-recursive makefile method by using sub-makefiles
52
53 %prep
54 %setup -q -n %{name}
55 %patch0 -p1
56 %patch1 -p1
57 %patch2 -p1
58
59 cat > SvnInfo.kmk << EOF
60 KBUILD_SVN_REV := %{svnrev}
61 KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk
62 EOF
63
64 %{__sed} -i -e 's@_LDFLAGS\.%{kbuild_arch}*.*=@& %{rpmldflags}@g' Config.kmk
65
66 %build
67 %define bootstrap_mflags %{?_smp_mflags} \\\
68                 CC="%{__cc}" \\\
69                 TOOL_GCC3_CC="%{__cc}" \\\
70                 CFLAGS="%{rpmcflags}"                   \\\
71                 KBUILD_VERBOSE=2                                \\\
72                 KBUILD_VERSION_PATCH=999
73
74 %define mflags %{bootstrap_mflags}      \\\
75                 NIX_INSTALL_DIR=%{_prefix}        \\\
76                 BUILD_TYPE=release                        \\\
77                 MY_INST_MODE=0644                          \\\
78                 MY_INST_BIN_MODE=0755
79
80 ver=$(awk '/^KBUILD_VERSION =/{print $3}' Config.kmk)
81 test "$ver" = %{version}
82
83 cd src/kmk
84 %{__libtoolize}
85 %{__aclocal} -I config
86 %{__autoconf}
87 %{__autoheader}
88 %{__automake}
89 cd ../sed
90 %{__libtoolize}
91 %{__aclocal} -I config
92 %{__autoconf}
93 %{__autoheader}
94 %{__automake}
95 cd ../..
96
97 %if %{with bootstrap}
98 kBuild/env.sh --full \
99         %{__make} -f bootstrap.gmk %{bootstrap_mflags}
100 %endif
101
102 kBuild/env.sh kmk %{mflags} rebuild
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106 export KBUILD_VERBOSE=2
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.082211 seconds and 3 git commands to generate.