File: slmodem.spec

package info (click to toggle)
sl-modem 2.9.9d%2Be-pre2-7etch2
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 2,436 kB
  • ctags: 1,719
  • sloc: ansic: 10,780; sh: 548; makefile: 256; perl: 11
file content (285 lines) | stat: -rw-r--r-- 8,032 bytes parent folder | download | duplicates (10)
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# Generate version information for kernel module
%define kname %(echo `uname -r`)
%define kver  %(echo %{kname} | sed -e 's/smp//' -e 's/bigmem//' -e 's/enterprise//')
%define ktype %(echo kernel-%{kname}|sed -e 's/%{kver}//' -e 's/-$//')
%define krel  %(echo %{kname} | sed -e 's/-/_/g')

###############################################################################
#
# Common Package Information
#
###############################################################################
Name: slmodem
Version: 2.9.4
Release: 2
Distribution: Unknown
License: SmartLink
URL: ftp://ftp.smlink.com/linux/unsupported/
# Alternative: URL: http://linmodems.technion.ac.il/packages/smartlink/
Vendor: Smart Link Ltd.

#
# Source files (taken from $RPM_SOURCE_DIR)
#
Source0: %{name}-%{version}.tar.gz
Source1: slmodemd

#
# Patches (taken from $RPM_SOURCE_DIR))
#
#Patch0: XYZ.patch

#
# Build Requirements
#
#buildarch: noarch
BuildRequires: kernel-source = %{kver}

# Package preparation area
BuildRoot: %{_tmppath}/%{name}

###############################################################################
#
# Package Information (Main)
#
###############################################################################
Summary: Driver for Smart Link HAMR5600 winmodem (user space)
Group: System Environment/Driver

AutoReq: 1
#PreReq:   Describe dependencies to install this package (see %pre/%post)
#Requires: Describe dependencies to use this package
AutoProv: 1
#Provides: Describe what this package provides

%description
This is the Linux driver for the Smart Link Soft Modem HAMR5600 hardware.
It provides a full-featured 56K Voice Fax Modem.

This winmodem hardware is used e.g. in the IBM ThinkPad T30.

This package includes the generic application (slmodemd) and the init script
for it.

%package -n kernel-module-%{name}
###############################################################################
#
# Subpackage Information (kernel module)
#
###############################################################################
Summary: Driver for Smart Link HAMR5600 winmodem (kernel space)
Group: System Environment/Kernel
Release: %{krel}

AutoReq: 0
#PreReq:   Describe dependencies to install this subpackage (see %pre/%post)
Requires: %{name} = %{version}
Requires: %{ktype} = %{kver}
AutoProv: 0
#Provides: Describe what this subpackage provides

%description -n kernel-module-%{name}
This is the Linux driver for the Smart Link Soft Modem HAMR5600 hardware.
It provides a full-featured 56K Voice Fax Modem.

This winmodem hardware is used e.g. in the IBM ThinkPad T30.

This package includes the hardware specific kernel-space drivers (slamr,
slusb) and the device nodes for them.

###############################################################################
#
# Build Phase Information
#
###############################################################################
# Define %_make_cmd in $HOME/.rpmmacros to override the standard make
%if !%{?_make_cmd:1}0
%define _make_cmd make
%endif

# Use '--define "_skip_build 1"' during package testing to skip build phases
%if !%{?_skip_build:1}0

%prep
#
# Preparation (-bp): Unpack the source files to $RPM_BUILD_DIR...
#
%setup -q

# ... apply patches
#%patch0 -p1 -b .XYZ

%build
#
# Compilation (-bc): Configure and build sources in $RPM_BUILD_DIR
#
export KERNEL_VER=%{kver}
%{_make_cmd} KERNEL_DIR=/lib/modules/%{kname}/build

%install
#
# Installation (-bi): Copy data from build $RPM_BUILD_DIR to
#                     package preparation area %{buildroot}
#
# "install" from Makefile is broken, so do everything by hand...
rm -rf %{buildroot}
install -D -m 755 modem/slmodemd %{buildroot}/usr/sbin/slmodemd
install -D -m 755 -d %{buildroot}/var/lib/slmodemd
install -D -m 644 drivers/slamr.o %{buildroot}/lib/modules/%{kname}/misc/slamr.o
install -D -m 644 drivers/slusb.o %{buildroot}/lib/modules/%{kname}/misc/slusb.o

# Hack device for kppp
mkdir -p %{buildroot}/dev
ln -sf /dev/ttySL0 %{buildroot}/dev/modem

# Install service file
install -D -m 755 %{SOURCE1} %{buildroot}/etc/init.d/slmodemd


%clean
#
# Installation cleanup: Delete package preparation area %{buildroot}
#
rm -rf %{buildroot}

%else # !%{_skip_build}
# Fix environment when build phases are skipped...
%define _builddir %{_topdir}/BUILD/%{name}-%{version}
%endif # !%{_skip_build}

%files
###############################################################################
#
# Packaging Phase Information (Main)
#
###############################################################################
#
# Package Content
#
%defattr (-,root,root)

# Directories owned by this package
%dir /var/lib/slmodemd

# Files owned by this package (taken from %{buildroot}
/usr/sbin/slmodemd
/etc/init.d/slmodemd

# Documentation for this package (taken from $RPM_BUILD_DIR)
%doc README
%doc README.1st

#
# Package Installation Scripts
#
# NOTE: During "update" of a package the order of execution is
#
#        %pre       (NEW)
#        %post      (NEW)
#        %preun     (OLD)
#        %postun    (OLD)
#
#%pre
# Commands to execute before package is installed (see also Prereq:)
# Parameter $1:  1 = install, 2 = update

#%post
# Commands to execute after package is installed (see also Prereq:)
# Parameter $1:  1 = install, 2 = update

#%preun
# Commands to execute before package is uninstalled
# Parameter $1:  0 = remove, 1 = update

#%postun
# Commands to execute after package is uninstalled
# Parameter $1:  0 = remove, 1 = update

%files -n kernel-module-%{name}
###############################################################################
#
# Packaging Phase Information (Subpackage kernel module)
#
###############################################################################
#
# Package Content
#
%defattr (-,root,root)

# Directories owned by this package
#%dir %{_datadir}/...

# Files owned by this package (taken from %{buildroot})
/lib/modules/%{kname}/misc/slamr.o
/lib/modules/%{kname}/misc/slusb.o

# Devices
%defattr (600,root,root)
%dev (c, 212, 0) /dev/slamr0
%dev (c, 212, 1) /dev/slamr1
%dev (c, 212, 2) /dev/slamr2
%dev (c, 212, 3) /dev/slamr3
%dev (c, 213, 0) /dev/slusb0
%dev (c, 213, 1) /dev/slusb1
%dev (c, 213, 2) /dev/slusb2
%dev (c, 213, 3) /dev/slusb3
/dev/modem

# Documentation for this package (taken from $RPM_BUILD_DIR)
#%doc ChangeLog

#
# Package Installation Scripts
#
# NOTE: During "update" of a package the order of execution is
#
#        %pre       (NEW)
#        %post      (NEW)
#        %preun     (OLD)
#        %postun    (OLD)
#
#%pre -n kernel-module-%{name}
# Commands to execute before package is installed (see also Prereq:)
# Parameter $1:  1 = install, 2 = update

%post -n kernel-module-%{name}
# Commands to execute after package is installed (see also Prereq:)
# Parameter $1:  1 = install, 2 = update
if [ $1 = 1 ]; then
	cat << EOF >> /etc/modules.conf
# added by kernel-module-slmodem package
alias char-major-212 slamr
alias char-major-213 slusb
EOF
fi
/sbin/depmod -A

%preun -n kernel-module-%{name}
# Commands to execute before package is uninstalled
# Parameter $1:  0 = remove, 1 = update
service slmodemd stop
modprobe -r slamr slusb
if [ $1 = 0 ]; then
	rm -f /dev/ttySL*
	egrep -ve 'added by kernel-module-slmodem package|alias char-major-212 slamr|alias char-major-213 slusb' /etc/modules.conf >/tmp/modules.conf.slmodem$$
	mv /tmp/modules.conf.slmodem$$ /etc/modules.conf
fi
/sbin/depmod -A

#%postun -n kernel-module-%{name}
# Commands to execute after package is uninstalled
# Parameter $1:  0 = remove, 1 = update

%changelog
###############################################################################
#
# Package Change History
#
###############################################################################
* Tue Nov 05 2003 Stefan Becker <Stefan.Becker@nokia.com>
- The HW doesn't seem to like suspend. Added removal of the kernel modules
  when slmodemd is stopped, so HW can be kicked by restarting the service.

* Mon Nov 04 2003 Stefan Becker <Stefan.Becker@nokia.com>
- Initial version based on slmodem-2.9.2