]> git.pld-linux.org Git - packages/kBuild.git/blob - kBuild.spec
3ffb42a3a7b0ca7b148f770574f56937edc4b153
[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:        3
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 Source0:        %{name}-r%{svnrev}.tar.bz2
16 # Source0-md5:  7c394fbe248f903d0bc1aabd235dc0a9
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 Patch3:         re_string_fetch_byte_case-not-pure-attribute.patch
22 Patch4:         x32.patch
23 URL:            http://svn.netlabs.org/kbuild
24 BuildRequires:  acl-devel
25 BuildRequires:  byacc
26 BuildRequires:  flex
27 %if %{with bootstrap}
28 BuildRequires:  autoconf
29 BuildRequires:  automake
30 BuildRequires:  gettext-autopoint
31 BuildRequires:  libtool
32 BuildRequires:  texinfo
33 %else
34 BuildRequires:  kBuild
35 %endif
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %ifarch %{x8664} x32
39 %define         kbuild_arch     amd64
40 %else
41 %define         kbuild_arch     x86
42 %endif
43
44 %description
45 This is a GNU make fork with a set of scripts to simplify complex
46 tasks and portable versions of various UNIX tools to ensure
47 cross-platform portability.
48
49 The goals of the kBuild framework:
50 - Similar behavior across all supported platforms
51 - Flexibility, don't create unnecessary restrictions preventing ad-hoc
52   solutions
53 - Makefiles can be simple to write and maintain
54 - One configuration file for a subtree automatically included
55 - Target configuration templates as the primary mechanism for makefile
56   simplification
57 - Tools and SDKs for helping out the templates with flexibility
58 - Non-recursive makefile method by using sub-makefiles
59
60 %prep
61 %setup -qc
62 mv %{name} .tmp; mv .tmp/* .
63 %patch0 -p1
64 %patch1 -p1
65 %patch2 -p1
66 %patch3 -p1
67 %patch4 -p1
68
69 cat > SvnInfo.kmk << EOF
70 KBUILD_SVN_REV := %{svnrev}
71 KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk
72 EOF
73
74 %{__sed} -i -e 's@_LDFLAGS\.%{kbuild_arch}*.*=@& %{rpmldflags}@g' Config.kmk
75
76 %ifarch x32
77 # probably should add full x32 configuration
78 # but can't find place to submit code upstream, so this will do for now.
79 # but then again, forcing -m64 is bad and pointless
80 sed -i -e 's/-m64//' kBuild/tools/GCC64.kmk kBuild/tools/GXX64.kmk tests/Config.kmk Config.kmk
81 %endif
82
83 %build
84 %define bootstrap_mflags %{?_smp_mflags} %{?with_verbose:KBUILD_VERBOSE=2} \\\
85                 CC="%{__cc}" TOOL_GCC3_CC="%{__cc}" CFLAGS="%{rpmcflags}"
86
87 %define mflags %{bootstrap_mflags} \\\
88                 NIX_INSTALL_DIR=%{_prefix} \\\
89                 BUILD_TYPE=release \\\
90                 MY_INST_MODE=0644 \\\
91                 MY_INST_BIN_MODE=0755
92
93 ver=$(awk '/^KBUILD_VERSION =/{print $3}' Config.kmk)
94 test "$ver" = %{ver}
95
96 %if %{with bootstrap}
97 cd src/kmk
98 %{__libtoolize}
99 %{__aclocal} -I config
100 %{__autoconf}
101 %{__autoheader}
102 %{__automake}
103 cd ../sed
104 %{__libtoolize}
105 %{__aclocal} -I config
106 %{__autoconf}
107 %{__autoheader}
108 %{__automake}
109 cd ../..
110
111 kBuild/env.sh --full \
112         %{__make} -f bootstrap.gmk %{bootstrap_mflags}
113
114 kBuild/env.sh kmk clean
115 %endif
116
117 kBuild/env.sh kmk %{mflags} all \
118         PATH_INS=$RPM_BUILD_ROOT
119
120 %install
121 rm -rf $RPM_BUILD_ROOT
122 kBuild/env.sh kmk %{mflags} install \
123         PATH_INS=$RPM_BUILD_ROOT
124
125 # These are included later in files section
126 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
127
128 %clean
129 rm -rf $RPM_BUILD_ROOT
130
131 %files
132 %defattr(644,root,root,755)
133 %doc ChangeLog
134 %doc kBuild/doc/COPYING-FDL-1.3 kBuild/doc/QuickReference*
135 %attr(755,root,root) %{_bindir}/kDepIDB
136 %attr(755,root,root) %{_bindir}/kDepObj
137 %attr(755,root,root) %{_bindir}/kDepPre
138 %attr(755,root,root) %{_bindir}/kObjCache
139 %attr(755,root,root) %{_bindir}/kmk
140 %attr(755,root,root) %{_bindir}/kmk_append
141 %attr(755,root,root) %{_bindir}/kmk_ash
142 %attr(755,root,root) %{_bindir}/kmk_cat
143 %attr(755,root,root) %{_bindir}/kmk_chmod
144 %attr(755,root,root) %{_bindir}/kmk_cmp
145 %attr(755,root,root) %{_bindir}/kmk_cp
146 %attr(755,root,root) %{_bindir}/kmk_echo
147 %attr(755,root,root) %{_bindir}/kmk_expr
148 %attr(755,root,root) %{_bindir}/kmk_gmake
149 %attr(755,root,root) %{_bindir}/kmk_install
150 %attr(755,root,root) %{_bindir}/kmk_ln
151 %attr(755,root,root) %{_bindir}/kmk_md5sum
152 %attr(755,root,root) %{_bindir}/kmk_mkdir
153 %attr(755,root,root) %{_bindir}/kmk_mv
154 %attr(755,root,root) %{_bindir}/kmk_printf
155 %attr(755,root,root) %{_bindir}/kmk_redirect
156 %attr(755,root,root) %{_bindir}/kmk_rm
157 %attr(755,root,root) %{_bindir}/kmk_rmdir
158 %attr(755,root,root) %{_bindir}/kmk_sed
159 %attr(755,root,root) %{_bindir}/kmk_sleep
160 %attr(755,root,root) %{_bindir}/kmk_test
161 %attr(755,root,root) %{_bindir}/kmk_time
162 %dir %{_datadir}/%{name}
163 %{_datadir}/%{name}/*.kmk
164 %dir %{_datadir}/%{name}/msgstyles
165 %{_datadir}/%{name}/msgstyles/*.kmk
166 %dir %{_datadir}/%{name}/sdks
167 %{_datadir}/%{name}/sdks/*.kmk
168 %dir %{_datadir}/%{name}/templates
169 %{_datadir}/%{name}/templates/*.kmk
170 %dir %{_datadir}/%{name}/tools
171 %{_datadir}/%{name}/tools/*.kmk
172 %dir %{_datadir}/%{name}/units
173 %{_datadir}/%{name}/units/*.kmk
This page took 0.092797 seconds and 3 git commands to generate.