source: spec/trunk/SPECS/libc.spec@ 1628

Last change on this file since 1628 was 1600, checked in by dmik, 7 years ago

spec: libc: Release version 0.1.1-1.

  • Property svn:eol-style set to native
File size: 12.0 KB
Line 
1# Defines the major version (used in the DLL name)
2%define ver_maj 0
3
4# Disable .dbg creation for forwaders and compression fo the main DLL
5# (will be done manually with special compression options)
6%define _strip_opts --debuginfo -x "libc*.dll" --compress -x "libcn%{ver_maj}.dll"
7
8# New Epoch to signify rebranding from kLIBC to LIBC Next with its own versioning
9Epoch: 1
10
11Name: libc
12License: BSD; GPL v2 or later; LGPL v2.1 or later
13Summary: Standard Shared Libraries
14Group: System/Libraries
15Version: %{ver_maj}.1.1
16Release: 1%{?dist}
17Vendor: bww bitwise works GmbH
18Url: https://github.com/bitwiseworks/libc
19
20%scm_source github https://github.com/bitwiseworks/libc %{version}
21#scm_source git file://D:/Coding/libc/master HEAD
22
23BuildRequires: rexx_exe kbuild
24BuildRequires: gcc unzip sed gawk
25
26# for libiberty
27BuildRequires: binutils-devel >= 2.27-3
28
29# Require kLIBC user management to make programs using Unix user management API
30# (getpwuid() and friends) work correctly.
31Requires: klusrmgr
32
33%description
34kLIBC is a C runtime library in which the coder is exploring The Single Unix
35Specification (SUS) and various *BSD, Sun and Linux interfaces used in 'portable'
36software. While implementing SUS completely and providing a great range of special
37BSD, Sun and Linux APIs is a kind of ultimate goal, the main focus is on what is
38interesting to play with and what is requested by porters using kLIBC.
39
40
41%package devel
42License: BSD; GPL v2 or later; LGPL v2.1 or later
43Summary: Include Files and Libraries Mandatory for Development
44Group: Development/Libraries/C and C++
45Requires: libc = %{epoch}:%{version}-%{release}
46Obsoletes: libc-kprofile < %{version}
47
48%description devel
49These libraries are needed to develop programs which use the standard C
50library.
51
52
53%package db1-devel
54License: BSD; GPL v2 or later; LGPL v2.1 or later
55Summary: Include Files and Libraries Mandatory for Development (db headers)
56Group: Development/Libraries/C and C++
57Requires: libc = %{epoch}:%{version}-%{release}
58Provides: db1-devel = %{epoch}:%{version}-%{release}
59Obsoletes: db1-devel < %{epoch}:%{version}-%{release}
60
61%description db1-devel
62These libraries are needed to develop programs which use the standard C
63library (db headers).
64
65
66%package gettext-devel
67License: BSD; GPL v2 or later; LGPL v2.1 or later
68Summary: Include Files and Libraries Mandatory for Development (gettext headers)
69Group: Development/Libraries/C and C++
70Provides: gettext-devel
71Requires: libc = %{epoch}:%{version}-%{release}
72
73%description gettext-devel
74These libraries are needed to develop programs which use the standard C
75library (gettext headers).
76
77
78%debug_package
79
80
81%prep
82
83%scm_setup
84
85# Check that package version matches the version from the sources
86test "`grep -P -o '(?<=(VH|VM|VL) = )([0-9]+)' < src/emx/version.smak | tr \\\n .`" = "%{version}."
87
88
89%build
90
91# TODO: For now, we still build only a i686 RPM of LIBC even though we could
92# do multiplatform builds by overriding OPTIMIZE_FLAGS. The reason is that
93# LIBC isn't stable with -march=pentium4. See https://github.com/bitwiseworks/libc/issues/30
94# for details. Once we fix that, we should set OPTIMIZE_FLAGS as follows
95# (note -O2 override with -O3 as LIBC wants this):
96#
97#OPTIMIZE_FLAGS="%{lua: print((string.gsub(rpm.expand('%{optflags}'), '-O2', '-O3')))}"
98
99%define kmk_flags \\\
100 NO_STRIP=1 \\\
101 INS="%{buildroot}/@unixroot/usr/" \\\
102 OUT=out/ \\\
103 ASM="%{_builddir}/%{?buildsubdir}/bin/ml.exe -c" \\\
104 SHELL=/@unixroot/usr/bin/sh.exe \\\
105 BUILD_ID="%{lua: print(string.sub(rpm.expand('%{__source_rev}'), 1, 7))}-git" \\\
106 OFFICIAL_VERSION=1
107
108# boostrap everything using the system LIBC build
109kmk -C src/emx MODE=opt %{kmk_flags} tools
110# NOTE: There is a bug in kmk's .NOTPARALLEL processing triggered by $(_STD_WILDWILD) deps for
111# $.stmp-libc-std that causes it to generate libc-std.h out of order so that files including it
112# build earlier. A workaround is to generate this file up front in a separate invocation.
113kmk -C src/emx MODE=opt %{kmk_flags} -f libonly.gmk libc-std.h
114kmk -C src/emx MODE=opt %{kmk_flags} libs
115kmk -C src/emx MODE=opt %{kmk_flags} install
116
117# check that install uses the right dirs
118test -d "%{buildroot}%{_bindir}" -a -d "%{buildroot}%{_libdir}" -a -d "%{buildroot}%{_includedir}"
119
120# build everything again from scratch using the bootstrap LIBC
121%{__rm} -rf out/
122export PATH="%{buildroot}%{_bindir};$PATH"
123export LIBRARY_PATH="%{buildroot}%{_libdir};$LIBRARY_PATH"
124export C_INCLUDE_PATH="%{buildroot}%{_includedir};$C_INCLUDE_PATH"
125export BEGINLIBPATH="%{buildroot}%{_libdir};$BEGINLIBPATH"
126# NOTE: we'd like to use LIBPATHSTRICT, but this will lead to problems because processes will end up
127# having two LIBC DLLs in memory (the old one from the boot runtime dragged in by other dependent DLLs
128# which are not also on BEGINLIBPATH) and the just-built one (which will lack calls from these other
129# DLLs). This in turn will lead to a number of side effects and the execution will most likely fail.
130# Therefore we just hope that the boot DLL has all necessary exports. If not, the newly-built one
131# will have to be manually installed and rebooted with in order for the build to complete.
132#export LIBPATHSTRICT=T
133kmk -C src/emx MODE=opt %{kmk_flags} tools
134kmk -C src/emx MODE=opt %{kmk_flags} -f libonly.gmk libc-std.h
135kmk -C src/emx MODE=opt %{kmk_flags} libs
136
137%install
138
139%{__rm} -rf %{buildroot}
140kmk -C src/emx MODE=opt %{kmk_flags} install
141
142# use special lxlite flags for the main LIBC DLL (see LXLITE.FLAGS in
143# Makefile.gmk for reasoning) - note that we have to strip ourselves too
144# TODO: add a _strip_opts option to override compression options
145emxomfstrip -D %{buildroot}%{_libdir}/libcn%{ver_maj}.dbg %{buildroot}%{_libdir}/libcn%{ver_maj}.dll
146lxlite /F+ /AP:4096 /MRN /MLN /MF1 %{buildroot}%{_libdir}/libcn%{ver_maj}.dll
147
148# don't need this (not used)
149%{__rm} -rf %{buildroot}/@unixroot/usr/i386-pc-os2-emx
150
151# don't need this (some Innotek helper DLL)
152%{__rm} -f %{buildroot}%{_libdir}/innidm.dll
153
154# remove .map files
155%{__rm} -f %{buildroot}%{_libdir}/*.map
156
157# remove ELH and PRF DLLs due to missing kdbglib.dll and kprofile.dll
158# (http://trac.netlabs.org/rpm/ticket/196)
159%{__rm} -f %{buildroot}%{_libdir}/libc*.elh
160%{__rm} -f %{buildroot}%{_libdir}/libc*.prf
161
162# remove CHKLOG and PRF versions of utility libraries (not used)
163%{__rm} -f %{buildroot}%{_libdir}/lib*_l.*
164%{__rm} -f %{buildroot}%{_libdir}/tcpipv4/lib*_l.*
165%{__rm} -f %{buildroot}%{_libdir}/lib*_p.*
166%{__rm} -f %{buildroot}%{_libdir}/tcpipv4/lib*_p.*
167
168# remove static versions of LIBC (not supported)
169%{__rm} -f %{buildroot}%{_libdir}/lib*_s.*
170%{__rm} -f %{buildroot}%{_libdir}/libc_app.*
171%{__rm} -f %{buildroot}%{_libdir}/libc_app_*.*
172
173# remove sys/mman.h (provided by libcx-devel)
174%{__rm} -f %{buildroot}%{_includedir}/sys/mman.h
175
176# convert & install dllar
177rexx2vio src/misc/dllar.cmd %{buildroot}%{_bindir}/dllar.exe
178
179# build omf libraries
180src/misc/MakeOmfLibs.cmd %{buildroot}%{_libdir}
181
182
183%clean
184
185rm -rf "%{buildroot}"
186
187
188%files
189%doc README.md CHANGELOG.md
190%doc doc/COPYING.* doc/*.os2
191%{_libdir}/libc*.dll
192
193
194%files devel -f %{debug_package_exclude_files}
195%{_bindir}
196%{_includedir}
197%exclude %{_includedir}/db.h
198%exclude %{_includedir}/ndbm.h
199%exclude %{_includedir}/libintl.h
200%{_libdir}
201%exclude %{_libdir}/libc*.dll
202
203
204%files db1-devel
205%{_includedir}/db.h
206%{_includedir}/ndbm.h
207
208
209%files gettext-devel
210%{_includedir}/libintl.h
211
212
213%changelog
214* Sun Feb 24 2019 Dmitriy Kuminov <coding@dmik.org> 1:0.1.1-1
215- Release LIBC Next version 0.1.1
216 (https://github.com/bitwiseworks/libc/blob/0.1.1/CHANGELOG.md).
217- Disable setting LIBPATHSTRICT as it may screw up the build.
218
219* Fri Feb 15 2019 Dmitriy Kuminov <coding@dmik.org> 1:0.1.0-1
220- Fork kLIBC and rebrand it to LIBC Next with a new versioning scheme and epoch.
221- Release LIBC Next version 0.1.0
222 (https://github.com/bitwiseworks/libc/blob/0.1.0/CHANGELOG.md).
223- Use scm_source macros.
224- Remove a lot of (unused and unneeded) static libs from the devel package.
225
226* Fri Jan 11 2019 Dmitriy Kuminov <coding@dmik.org> 0.6.6-40
227- Remove (old) libiberty headers (provided by binutils-devel now).
228
229* Mon Dec 31 2018 Dmitriy Kuminov <coding@dmik.org> 0.6.6-39
230- Make readdir return DT_LNK for symlinks (GH #9).
231- Make sure SIGCHLD is raised after a zombie for wait[pid] is created (GH #10).
232- Make reaplath fail on non-existing paths (GH #11).
233- Make stat succeed on file names with trailing spaces (GH #12).
234- Make [f]close return 0 regardless of DosClose result if LIBC handle is freed.
235- Fix typo in dlclose backend that would result in random return values (GH #14).
236- Increase dlerror buffer to 260+64 chars.
237
238* Tue Jun 5 2018 Dmitriy Kuminov <coding@dmik.org> 0.6.6-38
239- Fix resetting file access mode to O_WRONLY if opened with O_NOINHERIT. GitHub #2.
240- Define __LONG_LONG_SUPPORTED on modern C++ (C++11 and above). GitHub #6.
241
242* Mon May 21 2018 Dmitriy Kuminov <coding@dmik.org> 0.6.6-37
243- Make libc-devel not provide libXXX.dll (it's provided by libc).
244
245* Tue Apr 17 2018 Dmitriy Kuminov <coding@dmik.org> 0.6.6-36
246- Apply patch from ticket #384 to fix DosAllocMemEx(OBJ_LOCATION) bug.
247
248* Tue Aug 29 2017 Dmitriy Kuminov <coding@dmik.org> 0.6.6-35
249- Apply patch from ticket #366 to allow using LIBC in fork() callbacks.
250
251* Sat Jun 10 2017 Dmitriy Kuminov <coding@dmik.org> 0.6.6-34
252- Remove BSD defines from sys/param.h and types.h to avoid mistreating OS/2
253 as BSD (e.g. by LIBICU's unicode/platform.h).
254
255* Tue Jun 6 2017 Dmitriy Kuminov <coding@dmik.org> 0.6.6-33
256- Provide patched emxomfld.exe that fixes Invalid WKEXT record errors.
257
258* Fri Apr 7 2017 Dmitriy Kuminov <coding@dmik.org> 0.6.6-32
259- Require kLIBC user management (klusrmgr) to make programs using Unix user
260 management API (getpwuid() and friends) work correctly.
261- Move debug libraries from libc-devel to libc-debug (saves a lot of space).
262
263* Thu Sep 22 2016 Dmitriy Kuminov <coding@dmik.org> 0.6.6-31
264- Remove sys/mman.h which is now provided by libcx-devel.
265
266* Fri Sep 02 2016 yd <yd@os2power.com> 0.6.6-30
267- Fix path definitions in paths.h header. ticket#200.
268
269* Sat Aug 20 2016 Dmitriy Kuminov <coding@dmik.org> 0.6.6-29
270- Remove libcXXX.elh and libcXXX.prf from libc-devel due to missing
271 dependnencies (klibdbg.dll and kprofile.dll). This also obsoletes
272 the libc-kprofile dummy package.
273
274* Mon Aug 8 2016 Dmitriy Kuminov <coding@dmik.org> 0.6.6-28
275- Apply patches from tickets #361-365 to make fork() work in dash
276 and similar cases and other minor improvements.
277
278* Tue Jun 14 2016 yd <yd@os2power.com> 0.6.6-27
279- removed libiberty.h since it is already in binutils-devel. ticket#103 and ticket#188.
280
281* Sat Feb 07 2015 yd 0.6.6-26
282- r3946, readded SafeWinUpper.
283- removed asterisk patch from emxomf.
284
285* Fri Jan 23 2015 yd 0.6.6-25
286- added builtin.h and stddef.h patches required for building gcc 4.9.x.
287
288* Sun Jan 18 2015 yd
289- added new SafeDos* wrappers from trunk r3944.
290
291* Sun Jan 11 2015 yd
292- removed ansidecl.h since it is already in binutils-devel. ticket#103.
293
294* Fri Jan 09 2015 yd
295- added new SafeDos* wrappers from trunk r3942 and r3943.
296- added emxomfstrip binary from trunk.
297
298* Tue Jan 06 2015 yd 0.6.6-21
299- update to libc 0.6.6-csd6, added omf libraries.
300
301* Tue Aug 19 2014 Dmitriy Kuminov <coding@dmik.org> 0.6.5-20
302- Merged emxomf-remove-asterick.diff from libc ticket #220.
303- Made libc-devel and libc-gettext-devel strictly depend on current libc.
304
305* Wed Jun 25 2014 yd
306- emxomf, merged libc tickets #251, #293, #295.
307
308* Wed Sep 11 2013 yd
309- ticket#63: remove gcc335.dll from devel distribution.
310
311* Thu Mar 21 2013 yd
312- renamed gettext-devel to libc-gettext-devel to make it more visible.
313
314* Thu Dec 13 2012 yd
315- remove gcc 3.x stdc++/supc++ static libraries.
316
317* Fri May 11 2012 yd
318- remove obsolete binutil headers/libs
319
320* Tue Apr 17 2012 yd
321- update to csd5
322
323* Mon Jan 09 2012 yd
324- commented out sbrk/_sbrk definitions in stdlib.h (use unistd.h ones).
325
326* Fri Dec 16 2011 yd
327- restored stdarg.h/cdefs.h from original libc distribution.
328
329* Thu Oct 20 2011 yd
330- included emxomf.exe by dmik to workaround gcc/wlink bugs.
331
332* Wed Oct 12 2011 yd
333- fixed mmap include
334
335* Mon Sep 05 2011 yd
336- removed binutils
337
338* Sun Sep 04 2011 yd
339- update to csd4
Note: See TracBrowser for help on using the repository browser.