summaryrefslogtreecommitdiffstats
path: root/rules/rsync.make
blob: f27faf8621975ad2704c61c52242861f92055293 (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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2003 by wschmitt@envicomp.de
#
# 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_RSYNC) += rsync

#
# Paths and names
#
RSYNC_VERSION	= 2.6.8
RSYNC		= rsync-$(RSYNC_VERSION)
RSYNC_SUFFIX	= tar.gz
RSYNC_URL	= http://samba.anu.edu.au/ftp/rsync/$(RSYNC).$(RSYNC_SUFFIX)
RSYNC_SOURCE	= $(SRCDIR)/$(RSYNC).$(RSYNC_SUFFIX)
RSYNC_DIR	= $(BUILDDIR)/$(RSYNC)


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

rsync_get: $(STATEDIR)/rsync.get

$(STATEDIR)/rsync.get: $(rsync_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(RSYNC_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, RSYNC)

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

rsync_extract: $(STATEDIR)/rsync.extract

$(STATEDIR)/rsync.extract: $(rsync_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(RSYNC_DIR))
	@$(call extract, RSYNC)
	@$(call patchin, RSYNC)
	@$(call touch, $@)

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

rsync_prepare: $(STATEDIR)/rsync.prepare

RSYNC_PATH	=  PATH=$(CROSS_PATH)
RSYNC_ENV 	=  rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes $(CROSS_ENV)

#
# autoconf
#
RSYNC_AUTOCONF  =  $(CROSS_AUTOCONF_USR) \
	--target=$(PTXCONF_GNU_TARGET) \
	--with-included-popt \
	--disable-debug \
	--disable-locale

ifdef PTXCONF_RSYNC_LARGE_FILE
RSYNC_AUTOCONF += --enable-largefile
else
RSYNC_AUTOCONF += --disable-largefile
endif

ifdef PTXCONF_RSYNC_IPV6
RSYNC_AUTOCONF += --enable-ipv6
else
RSYNC_AUTOCONF += --disable-ipv6
endif

ifneq ($(call remove_quotes,$(PTXCONF_RSYNC_CONFIG_FILE)),)
RSYNC_AUTOCONF += --with-rsyncd-conf=$(PTXCONF_RSYNC_CONFIG_FILE)
endif

$(STATEDIR)/rsync.prepare: $(rsync_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(RSYNC_BUILDDIR))
	cd $(RSYNC_DIR) && \
		$(RSYNC_PATH) $(RSYNC_ENV) \
		./configure $(RSYNC_AUTOCONF)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

rsync_compile: $(STATEDIR)/rsync.compile

$(STATEDIR)/rsync.compile: $(rsync_compile_deps_default)
	@$(call targetinfo, $@)
	$(RSYNC_PATH) make -C $(RSYNC_DIR)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

rsync_install: $(STATEDIR)/rsync.install

$(STATEDIR)/rsync.install: $(rsync_install_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

rsync_targetinstall: $(STATEDIR)/rsync.targetinstall

$(STATEDIR)/rsync.targetinstall: $(rsync_targetinstall_deps_default)
	@$(call targetinfo, $@)

	@$(call install_init, rsync)
	@$(call install_fixup, rsync,PACKAGE,rsync)
	@$(call install_fixup, rsync,PRIORITY,optional)
	@$(call install_fixup, rsync,VERSION,$(RSYNC_VERSION))
	@$(call install_fixup, rsync,SECTION,base)
	@$(call install_fixup, rsync,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup, rsync,DEPENDS,)
	@$(call install_fixup, rsync,DESCRIPTION,missing)

	@$(call install_copy, rsync, 0, 0, 0755, \
		$(RSYNC_DIR)/rsync, \
		/usr/bin/rsync)

ifdef PTXCONF_RSYNC_CONFIG_FILE_DEFAULT
ifneq ($(call remove_quotes,$(PTXCONF_RSYNC_CONFIG_FILE)),)
	@$(call install_copy, rsync, 0, 0, 0644, \
		$(PTXDIST_TOPDIR)/generic/etc/rsyncd.conf, \
		$(PTXCONF_RSYNC_CONFIG_FILE) )
else
# use default
	@$(call install_copy, rsync, 0, 0, 0644, \
		$(PTXDIST_TOPDIR)/generic/etc/rsyncd.conf, \
		/etc/rsyncd.conf)
endif
	@$(call install_copy, rsync, 0, 0, 0644, \
		$(PTXDIST_TOPDIR)/generic/etc/rsyncd.secrets, \
		/etc/rsyncd.secrets )
endif

ifdef PTXCONF_RSYNC_CONFIG_FILE_USER
ifneq ($(call remove_quotes,$(PTXCONF_RSYNC_CONFIG_FILE)),)
	@$(call install_copy, rsync, 0, 0, 0644, \
		$(PTXDIST_WORKSPACE)/projectroot/etc/rsyncd.conf, \
		$(PTXCONF_RSYNC_CONFIG_FILE) )
else
# use as default
	@$(call install_copy, rsync, 0, 0, 0644, \
		$(PTXDIST_WORKSPACE)/projectroot/etc/rsyncd.conf, \
		/etc/rsyncd.conf)
endif
	@$(call install_copy, rsync, 0, 0, 0644, \
		$(PTXDIST_WORKSPACE)/projectroot/etc/rsyncd.secrets, \
		/etc/rsyncd.secrets )
endif

ifdef PTXCONF_RSYNC_STARTUP_TYPE_STANDALONE
# provide everything for standalone mode
ifdef PTXCONF_ROOTFS_ETC_INITD_RSYNC_DEFAULT
# install generic one
	@$(call install_copy, rsync, 0, 0, 0755, \
		$(PTXDIST_TOPDIR)/generic/etc/init.d/rsyncd, \
		/etc/init.d/rsyncd, n)
endif
ifdef PTXCONF_ROOTFS_ETC_INITD_RSYNC_USER
# install users one
	@$(call install_copy, rsync, 0, 0, 0755, \
		${PTXDIST_WORKSPACE}/projectroot/etc/init.d/rsyncd, \
		/etc/init.d/rsyncd, n)
endif
# replace the @CONFIG@ with path and name of the configfile
ifneq ($(PTXCONF_RSYNC_CONFIG_FILE),"")
	@$(call install_replace, rsync, /etc/init.d/rsyncd, \
		@CONFIG@, \
		"--config=$(PTXCONF_RSYNC_CONFIG_FILE)" )
endif
#
# FIXME: Is this packet the right location for the link?
#
ifneq ($(PTXCONF_ROOTFS_ETC_INITD_RSYNC_LINK),"")
	@$(call install_copy, rsync, 0, 0, 0755, /etc/rc.d)
	@$(call install_link, rsync, ../init.d/rsyncd, \
		/etc/rc.d/$(PTXCONF_ROOTFS_ETC_INITD_RSYNC_LINK))
endif
endif

	@$(call install_finish, rsync)
	@$(call touch, $@)

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

rsync_clean:
	rm -rf $(STATEDIR)/rsync.*
	rm -rf $(IMAGEDIR)/rsync_*
	rm -rf $(RSYNC_DIR)

# vim: syntax=make