Ignore:
Timestamp:
Feb 15, 2019, 4:11:06 PM (6 years ago)
Author:
dmik
Message:

spec: libc: Release version 0.1.0-1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • spec/trunk/SPECS/libc.spec

    r1557 r1591  
    1 #disable lxlite strip & debug info generation
    2 %define __os_install_post       %{nil}
     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
    310
    411Name:           libc
     
    613Summary:        Standard Shared Libraries
    714Group:          System/Libraries
    8 Version:        0.6.6
    9 Release:        40%{?dist}
    10 Url:            http://svn.netlabs.org/libc
    11 
    12 Source:         libc-%{version}.zip
    13 Source1:        libc-emxomf-20150207.zip
    14 # This contains binary build of LIBC with patches from kLIBC tickets (see Patch section below)
    15 Source2:        libc-hotfix-20181231.zip
    16 # This contains binary build of emxomfld with patches from ticket #376
    17 Source3:        libc-emxomfld-20170411.zip
    18 
    19 Patch0:         libc.patch
    20 
    21 # http://trac.netlabs.org/libc/ticket/377
    22 Patch1:         libc-dmik-no-bsd.diff
    23 # http://trac.netlabs.org/libc/ticket/366 (header only)
    24 Patch2:         libc-dmik-fork_completion_callback-header.diff
    25 # https://github.com/bitwiseworks/libc/commit/ac12fd8873a2016779f9f08c04bf0498b91bc9ee
    26 Patch3:         libc-dmik-LONG_LONG_SUPPORTED.diff
    27 # https://github.com/bitwiseworks/libc commits 516ae41..8e96b78 (headers only)
    28 Patch4:         libc-ac12fd8-8e96b78.diff
    29 
    30 # These patches are not actually applied but they record what needs to be done
    31 # to the stock LIBC 0.6 source in order to build emxomf.exe contained in
    32 # libc-emxomf.zip and to build the LIBC DLL itself. Note that starting from our
    33 # move of the kLIBC fork to https://github.com/bitwiseworks/libc, the LIBC DLL
    34 # provided by our RPMs contains all patches from the commits in that repo
    35 # (except those parts applied to headers by the patches above), but the repo
    36 # itself still misses the patches below (and some of the above). This mess will
    37 # be sorted out once we bulid it completely from sources (soon).
    38 Patch101:       libc-dmik-emxomf-02-remove-asterisk.diff
    39 Patch102:       libc-yuri-emxomf-verbose-warnings-3.patch
    40 Patch103:       libc-dmik-fork_completion_callback.diff
    41 
    42 BuildRequires:  rexx_exe
     15Version:        %{ver_maj}.1.0
     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
    4328
    4429# Require kLIBC user management to make programs using Unix user management API
     
    5843Summary:        Include Files and Libraries Mandatory for Development
    5944Group:          Development/Libraries/C and C++
    60 Requires:       libc = %{version}-%{release}
     45Requires:       libc = %{epoch}:%{version}-%{release}
    6146Obsoletes:      libc-kprofile < %{version}
    6247
     
    6651
    6752
    68 %package -n db1-devel
     53%package db1-devel
    6954License:        BSD; GPL v2 or later; LGPL v2.1 or later
    7055Summary:        Include Files and Libraries Mandatory for Development (db headers)
    7156Group:          Development/Libraries/C and C++
    72 
    73 %description -n db1-devel
     57Requires:       libc = %{epoch}:%{version}-%{release}
     58Provides:       db1-devel = %{epoch}:%{version}-%{release}
     59Obsoletes:      db1-devel < %{epoch}:%{version}-%{release}
     60
     61%description db1-devel
    7462These libraries are needed to develop programs which use the standard C
    7563library (db headers).
     
    8169Group:          Development/Libraries/C and C++
    8270Provides:       gettext-devel
    83 Requires:       libc = %{version}-%{release}
     71Requires:       libc = %{epoch}:%{version}-%{release}
    8472
    8573%description gettext-devel
     
    8876
    8977
    90 %package debug
    91 Summary: HLL debug data for exception handling support.
    92 
    93 %description debug
    94 HLL debug data for exception handling support.
     78%debug_package
    9579
    9680
    9781%prep
    98 %setup -q -c -a 1 -a 2 -a 3
    99 %patch0
    100 %patch1
    101 %patch2
    102 %patch3
    103 %patch4
    104 
    105 #replace paths.h wrong macros
    106 sed -i 's,"/@unixroot/bin,"/@unixroot/usr/bin,g' usr/include/paths.h
     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"
     126export LIBPATHSTRICT=T
     127kmk -C src/emx MODE=opt %{kmk_flags} tools
     128kmk -C src/emx MODE=opt %{kmk_flags} -f libonly.gmk libc-std.h
     129kmk -C src/emx MODE=opt %{kmk_flags} libs
    107130
    108131%install
    109 rm -rf $RPM_BUILD_ROOT
    110 mkdir -p %{buildroot}%{_bindir}
    111 mkdir -p %{buildroot}%{_includedir}
    112 mkdir -p %{buildroot}%{_libdir}
    113 mkdir -p %{buildroot}%{_usr}/man
    114 mkdir -p %{buildroot}%{_usr}/info
    115 
    116 cp -p -r usr/bin/* %{buildroot}%{_bindir}
    117 cp -p -r usr/include/* %{buildroot}%{_includedir}
    118 cp -p -r usr/lib/* %{buildroot}%{_libdir}
    119 cp -p -r usr/man/* %{buildroot}%{_usr}/man
    120 cp -p -r usr/man/* %{buildroot}%{_usr}/info
    121 
    122 # add new files
    123 cp -p -r emxomf.exe %{buildroot}%{_bindir}
    124 cp -p -r emxomfstrip.exe %{buildroot}%{_bindir}
    125 cp -p -r os2safe.h %{buildroot}%{_includedir}
    126 cp -p -r libos2.a %{buildroot}%{_libdir}
    127 
    128 cp -p -r emxomfld.exe %{buildroot}%{_bindir}
    129 
    130 # add hotfix DLLs
    131 cp -p -r libc066.* %{buildroot}%{_libdir}
     132
     133%{__rm} -rf %{buildroot}
     134kmk -C src/emx MODE=opt %{kmk_flags} install
     135
     136# use special lxlite flags for the main LIBC DLL (see LXLITE.FLAGS in
     137# Makefile.gmk for reasoning) - note that we have to strip ourselves too
     138# TODO: add a _strip_opts option to override compression options
     139emxomfstrip -D %{buildroot}%{_libdir}/libcn%{ver_maj}.dbg %{buildroot}%{_libdir}/libcn%{ver_maj}.dll
     140lxlite /F+ /AP:4096 /MRN /MLN /MF1 %{buildroot}%{_libdir}/libcn%{ver_maj}.dll
     141
     142# don't need this (not used)
     143%{__rm} -rf %{buildroot}/@unixroot/usr/i386-pc-os2-emx
     144
     145# don't need this (some Innotek helper DLL)
     146%{__rm} -f %{buildroot}%{_libdir}/innidm.dll
     147
     148# remove .map files
     149%{__rm} -f %{buildroot}%{_libdir}/*.map
    132150
    133151# remove ELH and PRF DLLs due to missing kdbglib.dll and kprofile.dll
    134152# (http://trac.netlabs.org/rpm/ticket/196)
    135 rm -f %{buildroot}%{_libdir}/libc*.elh
    136 rm -f %{buildroot}%{_libdir}/libc*.elh.map
    137 rm -f %{buildroot}%{_libdir}/libc*.prf
    138 rm -f %{buildroot}%{_libdir}/libc*.prf.map
    139 
    140 #remove (old) binutils headers/libs
    141 rm -f %{buildroot}%{_includedir}/ansidecl.h
    142 rm -f %{buildroot}%{_includedir}/bfd.h
    143 rm -f %{buildroot}%{_includedir}/bfdlink.h
    144 rm -f %{buildroot}%{_includedir}/dis-asm.h
    145 rm -f %{buildroot}%{_includedir}/libiberty.h
    146 rm -f %{buildroot}%{_includedir}/symcat.h
    147 rm -f %{buildroot}%{_libdir}/libbfd.*
    148 rm -f %{buildroot}%{_libdir}/libopcodes.*
    149 
    150 #remove (old) libiberty headers/libs
    151 rm -f %{buildroot}%{_includedir}/libiberty.h
    152 rm -f %{buildroot}%{_includedir}/demangle.h
    153 rm -f %{buildroot}%{_includedir}/dyn-string.h
    154 rm -f %{buildroot}%{_includedir}/fibheap.h
    155 rm -f %{buildroot}%{_includedir}/floatformat.h
    156 rm -f %{buildroot}%{_includedir}/hashtab.h
    157 rm -f %{buildroot}%{_includedir}/objalloc.h
    158 rm -f %{buildroot}%{_includedir}/partition.h
    159 rm -f %{buildroot}%{_includedir}/sort.h
    160 rm -f %{buildroot}%{_includedir}/splay-tree.h
    161 rm -f %{buildroot}%{_includedir}/ternary.h
    162 rm -f %{buildroot}%{_libdir}/libiberty.*
    163 
    164 #remove libstdc++/supc++ static libs (built with gcc 3.x)
    165 rm -f %{buildroot}%{_libdir}/libstdc++.*
    166 rm -f %{buildroot}%{_libdir}/libsupc++.*
    167 
    168 #remove sys/mman.h (provided by libcx-devel)
    169 rm -f %{buildroot}%{_includedir}/sys/mman.h
    170 
    171 rexx2vio $RPM_BUILD_ROOT%{_bindir}/dllar.cmd $RPM_BUILD_ROOT%{_bindir}/dllar.exe
     153%{__rm} -f %{buildroot}%{_libdir}/libc*.elh
     154%{__rm} -f %{buildroot}%{_libdir}/libc*.prf
     155
     156# remove CHKLOG and PRF versions of utility libraries (not used)
     157%{__rm} -f %{buildroot}%{_libdir}/lib*_l.*
     158%{__rm} -f %{buildroot}%{_libdir}/tcpipv4/lib*_l.*
     159%{__rm} -f %{buildroot}%{_libdir}/lib*_p.*
     160%{__rm} -f %{buildroot}%{_libdir}/tcpipv4/lib*_p.*
     161
     162# remove static versions of LIBC (not supported)
     163%{__rm} -f %{buildroot}%{_libdir}/lib*_s.*
     164%{__rm} -f %{buildroot}%{_libdir}/libc_app.*
     165%{__rm} -f %{buildroot}%{_libdir}/libc_app_*.*
     166
     167# remove sys/mman.h (provided by libcx-devel)
     168%{__rm} -f %{buildroot}%{_includedir}/sys/mman.h
     169
     170# convert & install dllar
     171rexx2vio src/misc/dllar.cmd %{buildroot}%{_bindir}/dllar.exe
    172172
    173173# build omf libraries
    174 cd %{buildroot}%{_libdir}
    175 cmd /c "@MakeOmfLibs.cmd"
     174src/misc/MakeOmfLibs.cmd %{buildroot}%{_libdir}
     175
    176176
    177177%clean
    178 rm -rf $RPM_BUILD_ROOT
     178
     179rm -rf "%{buildroot}"
    179180
    180181
    181182%files
    182 %defattr(-,root,root)
    183 %doc usr/doc/gcc-3.3.5/*
    184 %{_libdir}/libc06*.dll
    185 
    186 %files devel
    187 %defattr(-,root,root)
    188 %doc %{_prefix}/man/man1/*
    189 %doc %{_prefix}/man/man7/*
     183%doc README.md CHANGELOG.md
     184%doc doc/COPYING.* doc/*.os2
     185%{_libdir}/libc*.dll
     186
     187
     188%files devel -f %{debug_package_exclude_files}
    190189%{_bindir}
    191 %exclude %{_bindir}/*.dbg
    192190%{_includedir}
    193191%exclude %{_includedir}/db.h
    194192%exclude %{_includedir}/ndbm.h
    195193%exclude %{_includedir}/libintl.h
    196 %{_usr}/info
    197194%{_libdir}
    198 %exclude %{_libdir}/libc06*.dll
    199 %exclude %{_libdir}/*.dbg
    200 %exclude %{_libdir}/dbg
    201 %exclude %{_libdir}/tcpipv4/dbg
    202 %exclude %{_libdir}/gcc335.dll
    203 
    204 %files -n db1-devel
    205 %defattr(-,root,root)
     195%exclude %{_libdir}/libc*.dll
     196
     197
     198%files db1-devel
    206199%{_includedir}/db.h
    207200%{_includedir}/ndbm.h
    208201
     202
    209203%files gettext-devel
    210 %defattr(-,root,root)
    211204%{_includedir}/libintl.h
    212205
    213 %files debug
    214 %defattr(-,root,root)
    215 %{_bindir}/*.dbg
    216 %{_libdir}/*.dbg
    217 %{_libdir}/dbg
    218 %{_libdir}/tcpipv4/dbg
    219206
    220207%changelog
    221 * Tue Jan 15 2019 Dmitriy Kuminov <coding@dmik.org> 0.6.6-40
     208* Fri Feb 15 2019 Dmitriy Kuminov <coding@dmik.org> 1:0.1.0-1
     209- Fork kLIBC and rebrand it to LIBC Next with a new versioning scheme and epoch.
     210- Release LIBC Next version 0.1.0
     211  (https://github.com/bitwiseworks/libc/blob/0.1.0/CHANGELOG.md).
     212- Use scm_source macros.
     213- Remove a lot of (unused and unneeded) static libs from the devel package.
     214
     215* Fri Jan 11 2019 Dmitriy Kuminov <coding@dmik.org> 0.6.6-40
    222216- Remove (old) libiberty headers (provided by binutils-devel now).
    223217
     
    287281- removed ansidecl.h since it is already in binutils-devel. ticket#103.
    288282
    289 * Thu Jan 09 2015 yd
     283* Fri Jan 09 2015 yd
    290284- added new SafeDos* wrappers from trunk r3942 and r3943.
    291285- added emxomfstrip binary from trunk.
     
    301295- emxomf, merged libc tickets #251, #293, #295.
    302296
    303 * Thu Sep 11 2013 yd
     297* Wed Sep 11 2013 yd
    304298- ticket#63: remove gcc335.dll from devel distribution.
    305299
     
    310304- remove gcc 3.x stdc++/supc++ static libraries.
    311305
    312 * Mon May 11 2012 yd
     306* Fri May 11 2012 yd
    313307- remove obsolete binutil headers/libs
    314308
     
    328322- fixed mmap include
    329323
    330 * Wed Sep 05 2011 yd
     324* Mon Sep 05 2011 yd
    331325- removed binutils
    332326
    333 * Tue Sep 04 2011 yd
     327* Sun Sep 04 2011 yd
    334328- update to csd4
Note: See TracChangeset for help on using the changeset viewer.