summaryrefslogtreecommitdiffstats
path: root/rules/cvs.make
blob: 23b1e17a43456a1ab25b807dc7cc0af213c0d310 (plain)
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
# -*-makefile-*-
# $Id: template 6001 2006-08-12 10:15:00Z mkl $
#
# Copyright (C) 2006 by Juergen Beisert
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_CVS) += cvs

#
# Paths and names
#
CVS_VERSION	:= 1.11.22
CVS		:= cvs-$(CVS_VERSION)
CVS_SUFFIX	:= tar.bz2
CVS_URL		:= ftp://ftp.gnu.org/non-gnu/cvs/source/stable/$(CVS_VERSION)/$(CVS).$(CVS_SUFFIX)
CVS_SOURCE	:= $(SRCDIR)/$(CVS).$(CVS_SUFFIX)
CVS_DIR		:= $(BUILDDIR)/$(CVS)

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

$(CVS_SOURCE):
	@$(call targetinfo)
	@$(call get, CVS)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

CVS_PATH	:= PATH=$(CROSS_PATH)
CVS_ENV 	:= $(CROSS_ENV)

#
# autoconf
#
CVS_AUTOCONF := $(CROSS_AUTOCONF_USR) \
	--prefix=/usr \
	--disable-dependency-tracking \
	--enable-case-sensitivity

ifdef PTXCONF_CVS_NDBM
	CVS_AUTOCONF += --enable-cvs-ndbm
else
	CVS_AUTOCONF += --disable-cvs-ndbm
endif

ifdef PTXCONF_CVS_CLIENT
	CVS_AUTOCONF += --enable-client
else
	CVS_AUTOCONF += --disable-client
endif

ifdef PTXCONF_CVS_PSSWRD_CLIENT
	CVS_AUTOCONF += --enable-password-authenticated-client
else
	CVS_AUTOCONF += --disable-password-authenticated-client
endif

ifdef PTXCONF_CVS_SERVER
	CVS_AUTOCONF += --enable-server
else
	CVS_AUTOCONF += --disable-server
endif

ifdef PTXCONF_CVS_FLOW_CONTROL
	CVS_AUTOCONF += --enable-server-flow-control=1M,2M
else
	CVS_AUTOCONF += --disable-server-flow-control
endif

ifdef PTXCONF_CVS_ENCRYPTION
	CVS_AUTOCONF += --enable-encryption
else
	CVS_AUTOCONF += --disable-encryption
endif

ifdef PTXCONF_CVS_ROOTCOMMIT
	CVS_AUTOCONF += --enable-rootcommit
else
	CVS_AUTOCONF += --disable-rootcommit
endif

#
# if we are sure we have a tmp/ directory we
# forward cvs to use it
# If not, cvs probes at runtime
#
ifdef PTXCONF_ROOTFS_TMP
	CVS_AUTOCONF += --with-tmpdir=/tmp
endif

# missing switches yet
# --with-rsh
# --with-umask
# --with-cvs-admin-group=GROUP
#

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

#
# This is a list of files cvs will call
# when specific actions occure
#
CVS_CVSROOT_FILES := commitinfo cvsignore cvswrappers editinfo history loginfo \
	modules rcsinfo taginfo

$(STATEDIR)/cvs.targetinstall:
	@$(call targetinfo)

	@$(call install_init, cvs)
	@$(call install_fixup,cvs,PACKAGE,cvs)
	@$(call install_fixup,cvs,PRIORITY,optional)
	@$(call install_fixup,cvs,VERSION,$(CVS_VERSION))
	@$(call install_fixup,cvs,SECTION,base)
	@$(call install_fixup,cvs,AUTHOR,"Juergen Beisert <j.beisert@pengutronix.de>")
	@$(call install_fixup,cvs,DEPENDS,)
	@$(call install_fixup,cvs,DESCRIPTION,missing)

ifdef PTXCONF_CVS_INETD
	@$(call install_alternative, cvs, 0, 0, 0644, /etc/inetd.conf.d/cvs, n)
ifneq ($(call remove_quotes, $(PTXCONF_CVS_SERVER_REPOSITORY)),)
#	# add info about repository's root
	@$(call install_replace, cvs, /etc/inetd.conf.d/cvs, \
		@ROOT@, \
		"--allow-root=$(PTXCONF_CVS_SERVER_REPOSITORY)" )
else
#	# use cvs' default if not otherwise specified
	@$(call install_replace, cvs, /etc/inetd.conf.d/cvs, \
		@ROOT@, )
endif
endif

ifdef PTXCONF_INITMETHOD_BBINIT
ifdef PTXCONF_CVS_STARTSCRIPT
	@$(call install_alternative, cvs, 0, 0, 0755, /etc/init.d/cvs, n)
endif
endif

ifneq ($(call remove_quotes, $(PTXCONF_CVS_SERVER_REPOSITORY)),)
	@$(call install_copy, cvs, 0, 0, 0755, $(PTXCONF_CVS_SERVER_REPOSITORY))

#	#
#	# install only existing files
#	#
ifdef PTXCONF_CVS_SERVER_POPULATE_CVSROOT
	@$(call install_copy, cvs, 0, 0, 0750, \
		$(PTXCONF_CVS_SERVER_REPOSITORY)/CVSROOT)
	@for i in ${CVS_CVSROOT_FILES}; do \
		if [ -f $(PTXDIST_WORKSPACE)/projectroot/cvsroot/$$i ]; then \
			$(call install_copy, cvs, 0, 0,0750, \
				${PTXDIST_WORKSPACE}/projectroot/cvsroot/$$i, \
				$(PTXCONF_CVS_SERVER_REPOSITORY)/CVSROOT/$$i,n); \
		fi; \
	done;

	@for i in config passwd readers writers; do \
		if [ -f $(PTXDIST_WORKSPACE)/projectroot/cvsroot/$$i ]; then \
			$(call install_copy, cvs, 0, 0,0640, \
				${PTXDIST_WORKSPACE}/projectroot/cvsroot/$$i, \
				$(PTXCONF_CVS_SERVER_REPOSITORY)/CVSROOT/$$i,n); \
		fi; \
	done;
endif
endif

	@$(call install_copy, cvs, 0, 0, 0755, $(CVS_DIR)/src/cvs, /usr/bin/cvs)

	@$(call install_finish,cvs)

	@$(call touch)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

cvs_clean:
	rm -rf $(STATEDIR)/cvs.*
	rm -rf $(PKGDIR)/cvs_*
	rm -rf $(CVS_DIR)

# vim: syntax=make