File: Makefile

package info (click to toggle)
rinse 3.3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 484 kB
  • sloc: sh: 1,520; perl: 851; makefile: 85
file content (115 lines) | stat: -rw-r--r-- 3,047 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
#
#  Makefile for rinse, the RPM installation entity


#
#  Only used to build distribution tarballs.
#
DIST_PREFIX = ${TMP}
BASE        = rinse
PREFIX      = ${DESTDIR}
DIST_PREFIX = ${DESTDIR}


include VERSION

#
#  Report on targets.
#
default:
	@echo " The following targets are available:"
	@echo " "
	@echo "  clean        - Remove editor backups"
	@echo "  install      - Install to ${PREFIX}"
	@echo "  test         - Run the tests"
	@echo "  test-verbose - Run the tests, verbosely"
	@echo "  uninstall    - Uninstall from ${PREFIX}"
	@echo " "

#
#  Clean edited files.
#
clean:
	@find . -name '*~' -delete
	@find . -name '.#*' -delete
	@find . -name 'build-stamp' -delete
	@find . -name 'configure-stamp' -delete
	@if [ -d debian/rinse ]; then rm -rf debian/rinse; fi
	@if [ -e ./bin/rinse.8.gz ]; then rm -f ./bin/rinse.8.gz; fi



#
#  Make sure our scripts are executable.
#
fixupperms:
	for i in scripts/*/*.sh; do chmod 755 $$i; done


#
#  Install software
#
install: fixupperms
	mkdir -p ${PREFIX}/usr/share/bash-completion/completions
	mkdir -p ${PREFIX}/etc/rinse
	mkdir -p ${PREFIX}/usr/sbin
	mkdir -p ${PREFIX}/usr/lib/rinse
	mkdir -p ${PREFIX}/usr/lib/rinse/common
	cp -p ./scripts.common/* ${PREFIX}/usr/lib/rinse/common
	chmod 755 ${PREFIX}/usr/lib/rinse/common/*.sh
	mkdir -p ${PREFIX}/var/cache/rinse
	cp -p bin/rinse ${PREFIX}/usr/sbin/
	perl -pi -e "s/XXUNRELEASEDXX/$(VERSION)/" $(PREFIX)/usr/sbin/rinse*
	chmod 755 ${PREFIX}/usr/sbin/rinse*
	cp -p etc/*.packages ${PREFIX}/etc/rinse
	cp -p etc/*.conf     ${PREFIX}/etc/rinse
	for i in scripts/*/; do name=`basename $$i`; mkdir -p ${PREFIX}/usr/lib/rinse/$$name  ; cp $$i/*.sh ${PREFIX}/usr/lib/rinse/$$name ; done
	cp -p misc/rinse ${PREFIX}/usr/share/bash-completion/completions
	pod2man --release=${VERSION} --official --section=8 ./bin/rinse ./bin/rinse.8
	gzip --force -9 bin/rinse.8
	-mkdir -p ${PREFIX}/usr/share/man/man8/
	mv ./bin/rinse.8.gz ${PREFIX}/usr/share/man/man8/

#
#  Make a new release tarball, and make a GPG signature.
#
release: clean
	rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)
	rm -f $(DIST_PREFIX)/$(BASE)-$(VERSION).tar.gz
	cp -R . $(DIST_PREFIX)/$(BASE)-$(VERSION)
	perl -pi -e "s/XXUNRELEASEDXX/$(VERSION)/g" $(DIST_PREFIX)/$(BASE)-$(VERSION)/bin/rinse*
	rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)/debian
	cd $(DIST_PREFIX) && tar -cvf $(DIST_PREFIX)/$(BASE)-$(VERSION).tar $(BASE)-$(VERSION)/
	gzip $(DIST_PREFIX)/$(BASE)-$(VERSION).tar
	mv $(DIST_PREFIX)/$(BASE)-$(VERSION).tar.gz .
	rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)
	gpg --armour --detach-sign $(BASE)-$(VERSION).tar.gz
	echo $(VERSION) > .version



#
#  Run the test suite.  (Minimal.)
#
test:
	prove --shuffle tests/


#
#  Run the test suite verbosely.  (Minimal.)
#
test-verbose:
	prove --shuffle --verbose tests/


#
#  Remove the software.
#
uninstall:
	rm -f  ${PREFIX}/usr/sbin/rinse
	rm -f  ${PREFIX}/etc/rinse/*.conf
	rm -f  ${PREFIX}/etc/rinse/*.packages
	rm -rf ${PREFIX}/var/cache/rinse
	rm -rf ${PREFIX}/usr/lib/rinse
	rm -f  ${PREFIX}/etc/bash_completion.d/rinse