source: rtems/scripts/mkbinutils_subpackage_version @ 8c5e54b

4.104.114.84.95
Last change on this file since 8c5e54b was 8c5e54b, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 18, 1999 at 7:10:03 PM

Working on being able to cut RPMs. It now appears that the process
is working mostly for sparc at least.

There is one major problem -- the current process generates a unique
source file per RPM when in fact all of the source files are nearly
the same -- it is only the spec part of the rpm which differs.
The new file mkbinutils_subpackage_version is an attempt to
address this. It does part of the job right -- one source file
produces multiple binary RPMs. BUT the end user can not produce
the resulting RPMS themselves from SRPMS unless they also
build all targets.

  • Property mode set to 100755
File size: 5.6 KB
Line 
1#!/bin/sh
2#
3#  Usage: mktoolspec CPU
4#
5
6RTEMS_DIR=`dirname $0`
7RTEMS_VERSION=`grep Version ${RTEMS_DIR}/../VERSION | \
8sed -e 's%RTEMS[        ]*Version[      ]*\(.*\)[       ]*%\1%g'`
9
10# target_alias=$1
11TARGETS="i386-rtems sparc-rtems"
12# should be $*
13
14release=0
15
16# Some linux distributions use /usr/src/packages
17# redhat uses /usr/src/redhat
18# others might use /usr/src
19if test -d /usr/src/packages/SPECS; 
20then
21dst=/usr/src/packages/SPECS;
22elif test -d /usr/src/redhat/SPECS;
23 then
24dst=/usr/src/redhat/SPECS;
25elif test -d /usr/src/SPECS/; 
26then
27dst=/usr/src/SPECS;
28fi
29
30#  sed -e "s%@Version@%${RTEMS_VERSION}%g" \
31#  -e "s%@bsp@%${bsp}%g" \
32#  -e "s%@Release@%${release}%g" \
33#  -e "s%@target_alias@%${target_alias}%g" \
34#  < ${RTEMS_DIR}/binutils.spec.in \
35#  > ${dst}/$target_alias-binutils.spec
36
37(
38echo "#"
39echo "# spec file for package rtems"
40echo "# "
41echo "# Copyright  (c)  1999  OARCorp, Huntsville, AL"
42echo "#"
43echo "# please send bugfixes or comments to joel@OARcorp.com"
44echo "#"
45echo ""
46# echo "# neededforbuild  @target_alias@-binutils @target_alias@-gcc"
47echo ""
48echo "Vendor:       OAR Corporation"
49echo "Distribution: Linux"
50echo "Name:         rtems-binutils"
51echo "Release:      ${release}"
52echo "Copyright:    1999 OARCorp"
53echo "Group:        unsorted"
54echo "Provides:     binutils for RTEMS"
55echo ""
56echo "Autoreqprov:  on"
57echo "Packager:     corsepiu@faw.uni-ulm.de and joel@OARcorp.com"
58echo ""
59echo "Version:      ${RTEMS_VERSION}"
60echo "Summary:      binutils for RTEMS"
61echo "Source0:          binutils-990901.tar.gz"
62echo "Patch0:           binutils-990901-rtems-19991015.diff"
63echo ""
64echo "Buildroot:    /tmp"
65echo "# Patch:"
66echo "%description"
67echo "RTEMS is an open source operating system for embedded systems."
68echo ""
69echo "This is the GNU binutils for RTEMS targetting ${target_alias}."
70echo ""
71echo "Authors:"
72echo "--------"
73echo "    Joel Sherrill (joel@oarcorp.com)"
74echo "    ..."
75echo ""
76
77#
78#  This has to be unrolled in the file
79for target_alias in ${TARGETS}
80do
81  echo "%package ${target_alias}"
82  echo "Summary: binutils for ${target_alias}"
83  echo "Group:        unsorted"
84  echo ""
85  echo "%description ${target_alias}"
86  echo "binutils for ${target_alias}"
87  echo ""
88done
89
90echo "%prep"
91  echo "# untar the sources inside binutils-rtems"
92  echo "%setup -c -n binutils-rtems -a 0"
93  echo ""
94  echo "%patch0 -p0"
95  echo ""
96
97echo "%build"
98  echo "if [ X\${RTEMS_RPM_TARGETS} = X ] ; then"
99  echo "  RTEMS_RPM_TARGETS=\"${TARGETS}\""
100  echo "fi"
101  echo ""
102  echo "for target_alias in \${RTEMS_RPM_TARGETS}"
103  echo "do"
104  echo "  test -d build-\${target_alias} || mkdir build-\${target_alias}"
105  echo "  ( cd build-\${target_alias}"
106  echo "    ../binutils-990901/configure --target=\${target_alias} \\"
107  echo "      --verbose --prefix=/opt/rtems "
108  echo ""
109  echo "    test -d $RPM_BUILD_ROOT/opt \\"
110  echo "      || mkdir $RPM_BUILD_ROOT/opt"
111  echo "    test -d $RPM_BUILD_ROOT/opt/rtems \\"
112  echo "      || mkdir $RPM_BUILD_ROOT/opt/rtems"
113  echo ""
114  echo "    make all"
115  echo "    make info"
116  echo "  )"
117  echo "done"
118  echo ""
119
120echo "%install"
121  echo "if [ X\${RTEMS_RPM_TARGETS} = X ] ; then"
122  echo "  RTEMS_RPM_TARGETS=\"${TARGETS}\""
123  echo "fi"
124  echo ""
125  echo "for target_alias in \${RTEMS_RPM_TARGETS}"
126  echo "do"
127  echo "  ( cd build-\${target_alias}"
128  echo "    make prefix=\${RPM_BUILD_ROOT}/opt/rtems install"
129  echo "    make prefix=\${RPM_BUILD_ROOT}/opt/rtems install-info"
130  echo "  )"
131  echo "done"
132  echo ""
133
134for target_alias in ${TARGETS}
135do
136  echo "%files ${target_alias}"
137  echo "%doc /opt/rtems/info/as.info*"
138  echo "%doc /opt/rtems/info/bfd.info*"
139  echo "%doc /opt/rtems/info/binutils.info*"
140  echo "%doc /opt/rtems/info/ld.info*"
141  echo "%doc /opt/rtems/info/standards.info*"
142  echo "%doc /opt/rtems/man/man1/${target_alias}-ar.1"
143  echo "%doc /opt/rtems/man/man1/${target_alias}-nm.1"
144  echo "%doc /opt/rtems/man/man1/${target_alias}-objdump.1"
145  echo "%doc /opt/rtems/man/man1/${target_alias}-ranlib.1"
146  echo "%doc /opt/rtems/man/man1/${target_alias}-size.1"
147  echo "%doc /opt/rtems/man/man1/${target_alias}-strings.1"
148  echo "%doc /opt/rtems/man/man1/${target_alias}-strip.1"
149  echo "%doc /opt/rtems/man/man1/${target_alias}-objcopy.1"
150  echo "%doc /opt/rtems/man/man1/${target_alias}-addr2line.1"
151  echo "%doc /opt/rtems/man/man1/${target_alias}-nlmconv.1"
152  echo "%doc /opt/rtems/man/man1/${target_alias}-c++filt.1"
153  echo "%doc /opt/rtems/man/man1/${target_alias}-as.1"
154  echo "%doc /opt/rtems/man/man1/${target_alias}-ld.1"
155  echo ""
156  echo "/opt/rtems/bin/${target_alias}-addr2line"
157  echo "/opt/rtems/bin/${target_alias}-ar"
158  echo "/opt/rtems/bin/${target_alias}-as"
159  echo "/opt/rtems/bin/${target_alias}-c++filt"
160  echo "/opt/rtems/bin/${target_alias}-gasp"
161  echo "/opt/rtems/bin/${target_alias}-ld"
162  echo "/opt/rtems/bin/${target_alias}-nm"
163  echo "/opt/rtems/bin/${target_alias}-objcopy"
164  echo "/opt/rtems/bin/${target_alias}-objdump"
165  echo "/opt/rtems/bin/${target_alias}-ranlib"
166  echo "/opt/rtems/bin/${target_alias}-readelf"
167  echo "/opt/rtems/bin/${target_alias}-size"
168  echo "/opt/rtems/bin/${target_alias}-strings"
169  echo "/opt/rtems/bin/${target_alias}-strip"
170  echo "/opt/rtems/include/bfd.h"
171  echo "/opt/rtems/include/ansidecl.h"
172  echo "/opt/rtems/include/bfdlink.h"
173  echo "/opt/rtems/lib/libbfd*"
174  echo "/opt/rtems/lib/libiberty*"
175  echo "/opt/rtems/lib/libopcodes*"
176  echo "/opt/rtems/${target_alias}/bin/ar"
177  echo "/opt/rtems/${target_alias}/bin/as"
178  echo "/opt/rtems/${target_alias}/bin/ld"
179  echo "/opt/rtems/${target_alias}/bin/nm"
180  echo "/opt/rtems/${target_alias}/bin/ranlib"
181  echo "/opt/rtems/${target_alias}/bin/strip"
182  echo "/opt/rtems/${target_alias}/lib/ldscripts"
183  echo ""
184done
185)  > ${dst}/rtems-binutils.spec
186
187echo Generated ${dst}/rtems-binutils.spec.
Note: See TracBrowser for help on using the repository browser.