summaryrefslogtreecommitdiffstats
path: root/scm.spec
blob: b3a8d19603919a578c7973f3e8852954f3f00e53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
%define name scm
%define version 5e2
%define release 1
%define implpath %{prefix}/lib/scm
%define slibpath %{prefix}/lib/slib
%define dumparch setarch i386
# rpm seems to require all on one line, bleah.
%define features cautious bignums arrays inexact dump dynamic-linking macro engineering-notation

Name:         %{name}
Release:      %{release}
Version:      %{version}
Packager:     Radey Shouman <shouman@ne.mediaone.net>

Copyright:    GPL
Vendor:       Aubrey Jaffer <agj @ alum.mit.edu>
Group:        Development/Languages
Provides:     scm
Requires:     slib

Summary: SCM Scheme implementation.
Source:       ftp://swiss.csail.mit.edu/pub/scm/scm%{version}.zip
URL:          http://swiss.csail.mit.edu/~jaffer/SCM
BuildRoot:    %{_tmppath}/%{name}%{version}
Prefix:       /usr

%description
Scm conforms to Revised^5 Report on the Algorithmic Language Scheme and
the IEEE P1178 specification.  Scm provides a machine independent
platform for JACAL, a symbolic algebra system.

This distribution requires libdl.so from the glibc-devel package and the
slib Scheme library package.  If your machine lacks XFree86 or readline,
install with --nodeps.

%define __os_install_post /usr/lib/rpm/brp-compress

%prep
rm -rf /var/tmp/%{name}%{version}
%setup -n scm -c -T
cd ..
unzip $RPM_SOURCE_DIR/scm%{version}.zip

%build
# SLIB is required to build SCM.
if [ -n "$SCHEME_LIBRARY_PATH" ]; then
  echo using SLIB $SCHEME_LIBRARY_PATH
elif [ -d %{slibpath} ]; then
  export SCHEME_LIBRARY_PATH=%{slibpath}/
elif [ -d %{prefix}/share/slib ]; then
  export SCHEME_LIBRARY_PATH=%{prefix}/share/slib/
fi
make scmlit
make clean
export PATH=.:$PATH   # to get scmlit in the path.

# Build the executable.
./build -h system -o udscm5 --compiler-options="-O3" -l debug -s %{implpath} -F %{features}
echo "(quit)" | ./udscm5 -no-init-file -r5 -o scm
make check

# Build dlls
make x.so
./build -h system -t dll -F curses --compiler-options="-O3"
./build -h system -t dll -c differ.c --compiler-options="-O3"
./build -h system -t dll -c sc2.c --compiler-options="-O3"
./build -h system -t dll -c rgx.c --compiler-options="-O3"
./build -h system -t dll -c record.c --compiler-options="-O3"
./build -h system -t dll -c gsubr.c --compiler-options="-O3"
./build -h system -t dll -c ioext.c --compiler-options="-O3"
./build -h system -t dll -c posix.c --compiler-options="-O3"
./build -h system -t dll -c unix.c --compiler-options="-O3"
./build -h system -t dll -c socket.c --compiler-options="-O3"
./build -h system -t dll -c ramap.c --compiler-options="-O3"
./build -h system -t dll -c byte.c --compiler-options="-O3"
./build -h system -t dll -F edit-line --compiler-options="-O3"
./build -h system -t dll -F x --compiler-options="-O3"

# Build libscm.a static library
./build -h system -F cautious bignums arrays inexact dynamic-linking -t lib \
	--compiler-options="-O3"

%install
mkdir -p ${RPM_BUILD_ROOT}%{prefix}/bin
mkdir -p ${RPM_BUILD_ROOT}%{prefix}/lib/scm
mkdir -p ${RPM_BUILD_ROOT}%{prefix}/man/man1
make prefix=${RPM_BUILD_ROOT}%{prefix}/  install
make prefix=${RPM_BUILD_ROOT}%{prefix}/  installlib
rm -f ${RPM_BUILD_ROOT}%{prefix}/bin/scm
cp udscm5 ${RPM_BUILD_ROOT}%{prefix}/bin/

# Assume SLIB is in %{slibpath}, as installed by the slib rpm.
cat > ${RPM_BUILD_ROOT}%{prefix}/lib/scm/require.scm <<EOF
(set! library-vicinity (lambda () "%{slibpath}/"))
EOF

mkdir -p ${RPM_BUILD_ROOT}%{prefix}/info/
gzip *.info
cp *.info.gz ${RPM_BUILD_ROOT}%{prefix}/info/

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/install-info %{prefix}/info/scm.info.gz %{prefix}/info/dir
/sbin/install-info %{prefix}/info/hobbit.info.gz %{prefix}/info/dir
/sbin/install-info %{prefix}/info/Xlibscm.info.gz %{prefix}/info/dir
echo "(quit)" | %{dumparch} %{prefix}/bin/udscm5 -no-init-file -r5 -o %{prefix}/bin/scm
ln -s %{prefix}/bin/scm %{prefix}/local/bin/scm
ln -s %{prefix}/lib/scm %{prefix}/local/lib/
%{prefix}/bin/scm -c "(require 'new-catalog)"

%verifyscript
cp -f %{prefix}/lib/scm/r4rstest.scm /tmp/
(cd /tmp
    %{prefix}/bin/scm -fr4rstest.scm -e'(test-sc4)(test-cont)(test-delay)(gc)')

%preun
rm -f %{prefix}/lib/scm/slibcat %{prefix}/lib/scm/implcat
if [ -L %{prefix}/local/bin/scm ] && \
    ls -l %{prefix}/local/bin/scm | grep -q "> %{prefix}/bin/scm"; then
  rm -f %{prefix}/local/bin/scm
fi
if [ -L %{prefix}/local/lib/scm ] && \
    ls -l %{prefix}/local/lib/scm | grep -q "> %{prefix}/lib/scm"; then
  rm -f %{prefix}/local/lib/scm
fi
rm -f %{prefix}/bin/scm

%files
%defattr(-, root, root)
%{prefix}/bin/scmlit
%{prefix}/bin/udscm5
%dir %{prefix}/lib/scm
# No wildcards here because we need to segregate files by package.
%{prefix}/lib/scm/crs.so
%{prefix}/lib/scm/gsubr.so
%{prefix}/lib/scm/posix.so
%{prefix}/lib/scm/record.so
%{prefix}/lib/scm/sc2.so
%{prefix}/lib/scm/unix.so
%{prefix}/lib/scm/ioext.so
%{prefix}/lib/scm/ramap.so
%{prefix}/lib/scm/socket.so
%{prefix}/lib/scm/rgx.so
%{prefix}/lib/scm/Init%{version}.scm
%{prefix}/lib/scm/require.scm
%{prefix}/lib/scm/Macexp.scm
%{prefix}/lib/scm/Macro.scm
%{prefix}/lib/scm/Tscript.scm
%{prefix}/lib/scm/Transcen.scm
%{prefix}/lib/scm/mkimpcat.scm
%{prefix}/lib/scm/Link.scm
%{prefix}/lib/scm/compile.scm
%{prefix}/lib/scm/hobbit.scm
%{prefix}/lib/scm/scmhob.scm
%{prefix}/lib/scm/scmhob.h
%{prefix}/lib/scm/patchlvl.h
%{prefix}/lib/scm/build.scm
%{prefix}/lib/scm/build
%{prefix}/lib/scm/Iedline.scm
%{prefix}/lib/scm/edline.so
%{prefix}/lib/scm/Idiffer.scm
%{prefix}/lib/scm/differ.so
%{prefix}/lib/scm/x.so
%{prefix}/lib/scm/xevent.scm
%{prefix}/lib/scm/xatoms.scm
%{prefix}/lib/scm/x11.scm
%{prefix}/lib/scm/keysymdef.scm
%{prefix}/lib/scm/r4rstest.scm
%{prefix}/lib/scm/byte.so
%{prefix}/lib/scm/db.so
%{prefix}/lib/scm/wbtab.scm
%{prefix}/lib/scm/rwb-isam.scm
%{prefix}/lib/scm/COPYING
%{prefix}/info/Xlibscm.info.gz
%{prefix}/info/hobbit.info.gz
%{prefix}/info/scm.info.gz
%{prefix}/man/man1/scm.1.gz

%{prefix}/lib/libscm.a
%{prefix}/include/scm.h
%{prefix}/include/scmfig.h
%{prefix}/include/scmflags.h

%doc ANNOUNCE COPYING QUICKREF README ChangeLog

%changelog