File: rules

package info (click to toggle)
gitolite 2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,368 kB
  • sloc: perl: 2,868; sh: 1,249; python: 143; makefile: 81
file content (102 lines) | stat: -rwxr-xr-x 2,627 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
#!/usr/bin/make -f
# debian/rules for gitolite package
# Copyright 2010-2011 by Gerfried Fuchs <rhonda@debian.org>
# Licenced under WTFPLv2

PKG = gitolite
TMP = $(CURDIR)/debian/$(PKG)

INSTALL = install
INSTALL_FILE    = $(INSTALL) -p    -oroot -groot -m644
INSTALL_PROGRAM = $(INSTALL) -p    -oroot -groot -m755
INSTALL_SCRIPT  = $(INSTALL) -p    -oroot -groot -m755
INSTALL_DIR     = $(INSTALL) -p -d -oroot -groot -m755

GL_VERSION = $(shell dpkg-parsechangelog | sed -n -e 's/^Version: \(.*\)/\1 (Debian)/p')

include /usr/share/quilt/quilt.make

clean: unpatch
	$(checkdir)
	$(checkroot)

	-rm -rf $(TMP) debian/files conf/VERSION


conf/VERSION:
	printf "%s\n" "$(GL_VERSION)" > $@


build: build-arch build-indep
build-arch:
build-indep:
	# uhm, build for a binary-indep package?  Don't try to be funny ;)


install: patch conf/VERSION
	$(checkdir)
	$(checkroot)

	-rm -rf $(TMP) src/gl-easy-install
	$(INSTALL_DIR) $(TMP)
	cd $(TMP) && $(INSTALL_DIR) usr/share/$(PKG)/conf \
		usr/bin usr/share/$(PKG)/hooks \
		usr/share/doc/$(PKG)/examples
	$(INSTALL_FILE) README.mkd doc/* \
		$(TMP)/usr/share/doc/$(PKG)
	$(INSTALL_FILE) conf/* \
		$(TMP)/usr/share/$(PKG)/conf
	cp -a hooks/* \
		$(TMP)/usr/share/$(PKG)/hooks
	mv $(TMP)/usr/share/doc/$(PKG)/CHANGELOG \
		$(TMP)/usr/share/doc/$(PKG)/changelog
	rm $(TMP)/usr/share/doc/$(PKG)/COPYING
	for i in $$(ls src); do \
		$(INSTALL_SCRIPT) src/$$i $(TMP)/usr/share/$(PKG); \
		done
	chmod -x $(TMP)/usr/share/$(PKG)/gitolite.pm
	cp -a contrib/* $(TMP)/usr/share/doc/$(PKG)/examples
	$(INSTALL_SCRIPT) debian/gl-setup $(TMP)/usr/bin
	gzip -9 $(TMP)/usr/share/doc/$(PKG)/changelog \
		$(TMP)/usr/share/doc/$(PKG)/*.mkd 



binary-indep: install
	$(checkdir)
	$(checkroot)

	$(INSTALL_DIR) $(TMP)/DEBIAN
	$(INSTALL_FILE) debian/copyright debian/README.Debian \
		$(TMP)/usr/share/doc/$(PKG)
	$(INSTALL_FILE) debian/changelog \
		$(TMP)/usr/share/doc/$(PKG)/changelog.Debian
	cd $(TMP)/usr/share/doc/$(PKG) && gzip -9 \
		changelog.Debian
	$(INSTALL_SCRIPT) debian/postinst debian/postrm debian/config \
		debian/preinst $(TMP)/DEBIAN
	po2debconf debian/templates > $(TMP)/DEBIAN/templates
	dpkg-gencontrol -ldebian/changelog -isp -p$(PKG) -P$(TMP)
	cd $(TMP) && find * -type f ! -regex '^DEBIAN/.*' -print0 | \
		xargs -r0 md5sum > DEBIAN/md5sums
	find $(TMP) ! -type l -print0 2>/dev/null | xargs -0r \
		chmod go=rX,u+rw,a-s
	dpkg --build $(TMP) ..


binary-arch:
	# We have nothing to do here.


binary: binary-indep


define checkdir
	test -f debian/rules
endef

define checkroot
	test root = "`whoami`"
endef

.PHONY: build clean binary-indep binary-arch binary install