[go: up one dir, main page]

File: spec.sh

package info (click to toggle)
cook 2.19-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,316 kB
  • ctags: 3,969
  • sloc: ansic: 50,331; sh: 13,190; makefile: 4,542; yacc: 3,174; perl: 224; awk: 154
file content (238 lines) | stat: -rw-r--r-- 5,902 bytes parent folder | download
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
#!/bin/sh
#
#	cook - file construction tool
#	Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2001 Peter Miller;
#	All rights reserved.
#
#	This program is free software; you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#	the Free Software Foundation; either version 2 of the License, or
#	(at your option) any later version.
#
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#
#	You should have received a copy of the GNU General Public License
#	along with this program; if not, write to the Free Software
#	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
#
# MANIFEST: shell script to generate RedHat spec file
#
version=${version-0.0.0}
echo 'Summary: a file construction tool'
echo 'Name: cook'
echo "Version: ${version}"
echo 'Release: 1'
echo 'Copyright: GPL'
echo 'Group: Development/Building'
echo "Source: http://www.canb.auug.org.au/~millerp/cook/cook-${version}.tar.gz"
echo 'URL: http://www.canb.auug.org.au/~millerp/cook/'
echo 'BuildRoot: /tmp/cook-build-root'
echo 'Icon: cook.gif'

prefix=/usr
#
# RPM only has install-time relocatable packages.  It has no support for
# build-time relocatable packages.  Therefore, we must NOT specify a Spec
# prefix, or the installed locations will not match the built locations.
#
#echo "Prefix: $prefix"

echo ''

cat << 'fubar'
%description
Cook is a tool for constructing files. It is given a set of files to
create, and recipes of how to create them. In any non-trivial program
there will be prerequisites to performing the actions necessary to
creating any file, such as include files.  The cook program provides a
mechanism to define these.

When a program is being developed or maintained, the programmer will
typically change one file of several which comprise the program.  Cook
examines the last-modified times of the files to see when the
prerequisites of a file have changed, implying that the file needs to be
recreated as it is logically out of date.

Cook also provides a facility for implicit recipes, allowing users to
specify how to form a file with a given suffix from a file with a
different suffix.  For example, to create filename.o from filename.c

* Cook is a replacement for the traditional make(1) tool.  However, it
  is necessary to convert makefiles into cookbooks using the make2cook
  utility included in the distribution.

* Cook has a simple but powerful string-based description language with
  many built-in functions.  This allows sophisticated filename
  specification and manipulation without loss of readability or
  performance.

* Cook is able to use fingerprints to supplement file modification
  times.  This allows build optimization without contorted rules.

* Cook is able to build your project with multiple parallel threads,
  with support for rules which must be single threaded.  It is possible
  to distribute parallel builds over your LAN, allowing you to turn your
  network into a virtual parallel build engine.

If you are putting together a source-code distribution and planning to
write a makefile, consider writing a cookbook instead.  Although Cook
takes a day or two to learn, it is much more powerful and a bit more
intuitave than the traditional make(1) tool.  And Cook doesn't interpret
tab differently to 8 space characters!

%package psdocs
Summary: Cook documentation, PostScript format
Group: Development/Building

%description psdocs
Cook documentation in PostScript format.

%package dvidocs
Summary: Cook documentation, DVI format
Group: Development/Building

%description dvidocs
Cook documentation in DVI format.

%prep
fubar

#
# set the prefix here
#
echo '%setup'
echo "./configure --prefix=$prefix"
echo ''
echo '%build'
echo 'make'
echo ''
echo '%install'
echo 'make RPM_BUILD_ROOT=$RPM_BUILD_ROOT install'

#
# remember things for the %files section
#
files=
binfiles=
psdocs=
dvidocs=

remember_prog()
{
	if eval "test \"\${prog_${1}-no}\" != yes"
	then
		eval "prog_${1}=yes"
		binfiles="$binfiles $prefix/bin/${1}"
	fi
}

for file in $*
do
	case $file in

	common/*)
		;;
	fstrcmp/* | file_check/*)
		;;
	etc/*)
		;;

	*/main.c)
		dir=`echo $file | sed 's|/.*||'`
		remember_prog $dir
		;;

	test/*/*)
		;;
	lib/*/building/*)
		;;
	lib/*/lsm/*)
		;;
	lib/*/readme/*)
		;;
	lib/*/release/*)
		;;

	lib/*/LC_MESSAGES/common.po)
		;;
	lib/*/LC_MESSAGES/fstrcmp.po)
		;;

	lib/*.po)
		stem=`echo $file | sed 's|^lib/\(.*\)\.po$|\1|'`
		dst="$prefix/lib/cook/$stem.mo"
		files="$files $dst"
		;;

	lib/*/*/*.so)
		;;
	lib/*/*/*.pic)
		;;

	lib/*/man?/*)
		# some versions of RPM gzip man pages for free, so use a
		# wild card to find them, rather than an exact name.  Sigh.
		stem=`echo $file | sed 's|^lib/||'`
		files="$files $prefix/share/cook/${stem}*"

		case $file in
		lib/en/*)
			stem2=`echo $file | sed 's|^lib/en/||'`
			files="$files $prefix/man/${stem2}*"
			;;
		esac
		;;

	lib/*/*/main.*)
		stem=`echo $file | sed 's|^lib/\(.*\)/main.*$|\1|'`
		psdocs="$psdocs $prefix/share/cook/$stem.ps"
		dvidocs="$dvidocs $prefix/share/cook/$stem.dvi"
		txtdocs="$txtdocs $prefix/share/cook/$stem.txt"
		;;

	lib/*)
		rest=`echo $file | sed 's|^lib/||'`
		dst="$prefix/share/cook/$rest"
		files="$files $dst"
		;;

	*)
		;;
	esac
done

echo ''
echo '%files'
for file in $binfiles
do
	echo "%attr(0755,root,bin) $file"
done
for file in $files
do
	echo "%attr(0644,root,bin) $file"
done
for file in $txtdocs
do
	echo "%attr(0644,root,bin) $file"
done

echo ''
echo '%files psdocs'
for file in $psdocs
do
	echo "%attr(0644,root,bin) $file"
done

echo ''
echo '%files dvidocs'
for file in $dvidocs
do
	echo "%attr(0644,root,bin) $file"
done

echo ''
echo '%clean'
echo 'rm -rf $RPM_BUILD_ROOT'