File: Makefile

package info (click to toggle)
rinse 1.7-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 280 kB
  • ctags: 34
  • sloc: perl: 873; sh: 762; makefile: 112
file content (135 lines) | stat: -rw-r--r-- 3,135 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
#
#  Makefile for rinse, the RPM installation entity
#
# Steve
# --
#


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


#
#  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 " "


#
#  Show what has been changed in the local copy vs. the remote repository.
#
diff:
	hg diff 2>/dev/null



#
#  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 install-manpage
	mkdir -p ${PREFIX}/etc/bash_completion.d
	mkdir -p ${PREFIX}/etc/rinse
	mkdir -p ${PREFIX}/usr/sbin
	mkdir -p ${PREFIX}/usr/lib/rinse
	mkdir -p ${PREFIX}/var/cache/rinse
	cp bin/rinse ${PREFIX}/usr/sbin/
	chmod 755 ${PREFIX}/usr/sbin/rinse
	cp etc/*.packages ${PREFIX}/etc/rinse
	cp etc/*.conf     ${PREFIX}/etc/rinse
	for i in scripts/*/; do name=`basename $$i`; if [ "$$name" != "CVS" ]; then mkdir -p ${PREFIX}/usr/lib/rinse/$$name  ; cp $$i/*.sh ${PREFIX}/usr/lib/rinse/$$name ; fi ; done
	cp misc/rinse ${PREFIX}/etc/bash_completion.d


install-manpage:
	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
	rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)/.hg*
	rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)/.release
	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/


#
#  Update the local copy from the remote repository.
#
#
update:
	hg pull --update


#
#  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