File: Makefile

package info (click to toggle)
chezscheme 9.5.4%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 61,640 kB
  • sloc: ansic: 17,508; sh: 759; makefile: 509; csh: 423
file content (84 lines) | stat: -rw-r--r-- 3,094 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
# Makefile
# Copyright 1984-2017 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

version = 9.5.4
release = 1
m := $(shell find ../bin/* -type d | xargs basename)
arch := $(shell if test "$(m)" == "i3le" ; then echo i686 ; elif test "$(m)" == "a6le" ; then echo x86_64 ; else echo UNKNOWN ; fi)
DOTUSER := $(shell ls -ld . | sed -e 's/[^ ]* *[^ ]* *\([^ ]*\).*/\1/')
DOTGROUP := $(shell ls -ldg . | sed -e 's/[^ ]* *[^ ]* *\([^ ]*\).*/\1/')
TMP := $(shell pwd)/tmp
SPEC = $(TMP)/ChezScheme-$(version)-$(arch)-$(release).spec
RELEASE = csv$(version)
TARBALL = $(RELEASE)-$(m).tar.gz
RPM = ChezScheme-$(version)-$(release).$(arch).rpm


$(RPM): $(TMP)/$(RPM)
	sudo install -m 644 -o $(DOTUSER) -g $(DOTGROUP) $(TMP)/${RPM} .

$(TMP)/$(RPM): $(SPEC) $(TMP)/$(TARBALL)
	sudo setarch $(arch) rpmbuild\
          --target $(arch)\
          --define "_topdir $(TMP)" \
          --define "_srcrpmdir $(TMP)" \
          --define "_rpmdir $(TMP)" \
          --define "_sourcedir $(TMP)" \
          --define "_builddir $(TMP)" \
          --define "_rpmfilename %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm" \
          --quiet -ba $(SPEC)

$(SPEC): $(TMP)
	echo 'Summary: Chez Scheme: A high-performance version of Scheme' > $(SPEC)
	echo 'Name: ChezScheme' >> $(SPEC)
	echo 'Version: $(version)' >> $(SPEC)
	echo 'Release: $(release)' >> $(SPEC)
	echo 'Provides: ChezScheme-runtime-{VERSION}' >> $(SPEC)
	echo 'License: Apache 2.0' >> $(SPEC)
	echo 'URL: http://github.com/cisco/chezscheme' >> $(SPEC)
	echo 'Group: Development/Languages' >> $(SPEC)
	echo 'Source0: $(TARBALL)' >> $(SPEC)
	echo 'BuildRoot: %{_tmppath}/%{name}' >> $(SPEC)
	echo '%description' >> $(SPEC)
	echo 'Chez Scheme is a programming language and an implementation of that language,' >> $(SPEC)
	echo 'with supporting tools and documentation.' >> $(SPEC)
	echo '' >> $(SPEC)
	echo '%prep' >> $(SPEC)
	echo '' >> $(SPEC)
	echo '%setup -T -b 0 -n $(RELEASE)' >> $(SPEC)
	echo '' >> $(SPEC)
	echo '#%build' >> $(SPEC)
	echo '' >> $(SPEC)
	echo '%install' >> $(SPEC)
	echo 'make install TempRoot=%{buildroot}' >> $(SPEC)
	echo '' >> $(SPEC)
	echo '%files' >> $(SPEC)
	echo '#%doc NOTICE' >> $(SPEC)
	echo '#%doc LICENSE' >> $(SPEC)
	echo '/usr/lib/$(RELEASE)' >> $(SPEC)
	echo '/usr/bin/petite' >> $(SPEC)
	echo '/usr/bin/scheme' >> $(SPEC)
	echo '/usr/bin/scheme-script' >> $(SPEC)
	echo '/usr/share/man/man1/petite.1.gz' >> $(SPEC)
	echo '/usr/share/man/man1/scheme.1.gz' >> $(SPEC)

$(TMP)/$(TARBALL): $(TMP) ../bintar/$(TARBALL)
	cp ../bintar/$(TARBALL) $(TMP)

$(TMP):
	mkdir $(TMP)

clean:
	rm -rf $(TMP) $(RPM)