]> git.pld-linux.org Git - packages/kBuild.git/blob - kBuild.spec
a47181c46d7df17d06e1220273de763a9a17374f
[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         ver     0.1.9998
7 %define         svnrev  2700
8 Summary:        A cross-platform build environment
9 Name:           kBuild
10 Version:        %{ver}.%{svnrev}
11 Release:        1
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
16 Source0:        %{name}-r%{svnrev}.tar.bz2
17 # Source0-md5:  7c394fbe248f903d0bc1aabd235dc0a9
18 Source1:        get-source.sh
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 Patch3:         re_string_fetch_byte_case-not-pure-attribute.patch
23 BuildRequires:  acl-devel
24 BuildRequires:  autoconf
25 BuildRequires:  automake
26 BuildRequires:  byacc
27 BuildRequires:  cvs
28 BuildRequires:  flex
29 BuildRequires:  gettext-tools
30 %{!?with_bootstrap:BuildRequires:       kBuild}
31 ExclusiveArch:  %{x8664} %{ix86}
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %ifarch %{x8664}
35 %define         kbuild_arch     amd64
36 %else
37 %define         kbuild_arch     x86
38 %endif
39
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
45 The goals of the kBuild framework:
46 - Similar behavior across all supported platforms
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
55
56 %prep
57 %setup -qc
58 mv %{name} .tmp; mv .tmp/* .
59 %patch0 -p1
60 %patch1 -p1
61 %patch2 -p1
62 %patch3 -p1
63
64 cat > SvnInfo.kmk << EOF
65 KBUILD_SVN_REV := %{svnrev}
66 KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk
67 EOF
68
69 %{__sed} -i -e 's@_LDFLAGS\.%{kbuild_arch}*.*=@& %{rpmldflags}@g' Config.kmk
70
71 %build
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 \\\
79                 MY_INST_BIN_MODE=0755
80
81 ver=$(awk '/^KBUILD_VERSION =/{print $3}' Config.kmk)
82 test "$ver" = %{ver}
83
84 %if %{with bootstrap}
85 cd src/kmk
86 %{__libtoolize}
87 %{__aclocal} -I config
88 %{__autoconf}
89 %{__autoheader}
90 %{__automake}
91 cd ../sed
92 %{__libtoolize}
93 %{__aclocal} -I config
94 %{__autoconf}
95 %{__autoheader}
96 %{__automake}
97 cd ../..
98
99 kBuild/env.sh --full \
100         %{__make} -f bootstrap.gmk %{bootstrap_mflags}
101
102 kBuild/env.sh kmk clean
103 %endif
104
105 kBuild/env.sh kmk %{mflags} all \
106         PATH_INS=$RPM_BUILD_ROOT
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
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)
121 %doc ChangeLog
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
This page took 0.073706 seconds and 2 git commands to generate.