summaryrefslogtreecommitdiffstats
path: root/rules/chrony.make
blob: d3d74eeb112139348509c3a011b1f9bfdb565833 (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
# -*-makefile-*-
#
# Copyright (C) 2005 by Bjoern Buerger <b.buerger@pengutronix.de>
#               2009 by Marc Kleine-Budde <mkl@pengutronix.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_CHRONY) += chrony

#
# Paths and names
#
CHRONY_VERSION	:= 1.24-pre1
CHRONY		:= chrony-$(CHRONY_VERSION)
CHRONY_SUFFIX	:= tar.gz
CHRONY_URL	:= http://download.tuxfamily.org/chrony/$(CHRONY).$(CHRONY_SUFFIX)
CHRONY_SOURCE	:= $(SRCDIR)/$(CHRONY).$(CHRONY_SUFFIX)
CHRONY_DIR	:= $(BUILDDIR)/$(CHRONY)

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

$(CHRONY_SOURCE):
	@$(call targetinfo)
	@$(call get, CHRONY)

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

CHRONY_PATH	:= PATH=$(CROSS_PATH)
CHRONY_ENV 	:= $(CROSS_ENV)

#
# autoconf
#
CHRONY_AUTOCONF := \
	$(CROSS_AUTOCONF_USR) \
	--disable-readline

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

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

	@$(call install_init, chrony)
	@$(call install_fixup, chrony,PACKAGE,chrony)
	@$(call install_fixup, chrony,PRIORITY,optional)
	@$(call install_fixup, chrony,VERSION,$(CHRONY_VERSION))
	@$(call install_fixup, chrony,SECTION,base)
	@$(call install_fixup, chrony,AUTHOR,"PTXdist Base Package <ptxdist@pengutronix.de>")
	@$(call install_fixup, chrony,DEPENDS,)
	@$(call install_fixup, chrony,DESCRIPTION,missing)

# binaries
	@$(call install_copy, chrony, 0, 0, 0755, -, \
		/usr/sbin/chronyd)
	@$(call install_copy, chrony, 0, 0, 0755, -, \
		/usr/bin/chronyc)

# command helper script
ifdef PTXCONF_CHRONY_INSTALL_CHRONY_COMMAND
	@$(call install_copy, chrony, 0, 0, 0755, \
		$(PTXDIST_TOPDIR)/generic/usr/bin/chrony_command, \
		/usr/bin/chrony_command)
endif
ifdef PTXCONF_CHRONY_INSTALL_CHRONY_COMMAND
	@$(call install_copy, chrony, 0, 0, 0755, \
		$(PTXDIST_TOPDIR)/generic/usr/bin/chrony_command, \
		/usr/bin/chrony_command)
endif

# chrony stat convenience wrapper
ifdef PTXCONF_CHRONY_INSTALL_CHRONY_STAT
	@$(call install_copy, chrony, 0, 0, 0755, \
		$(PTXDIST_TOPDIR)/generic/usr/bin/chrony_stat, 	\
		/usr/bin/chrony_stat)
endif


# generic one
ifdef PTXCONF_CHRONY_DEFAULTCONFIG
	@$(call install_copy, chrony, 0, 0, 0644, \
		$(PTXDIST_TOPDIR)/generic/etc/chrony/chrony.conf, \
		/etc/chrony/chrony.conf)
	@$(call install_copy, chrony, 0, 0, 0600, \
		$(PTXDIST_TOPDIR)/generic/etc/chrony/chrony.keys, \
		/etc/chrony/chrony.keys)
endif

# users one
ifdef PTXCONF_CHRONY_USERCONFIG
	@$(call install_copy, chrony, 0, 0, 0644, \
		$(PTXDIST_WORKSPACE)/projectroot/etc/chrony/chrony.conf, \
		/etc/chrony/chrony.conf)
	@$(call install_copy, chrony, 0, 0, 0600, \
		$(PTXDIST_WORKSPACE)/projectroot/etc/chrony/chrony.keys, \
		/etc/chrony/chrony.keys)
endif

# modify placeholders with data from configuration
ifdef PTXCONF_CHRONY_INSTALL_CONFIG
	@$(call install_replace, chrony, /etc/chrony/chrony.conf, \
		@UNCONFIGURED_CHRONY_SERVER_IP@, $(PTXCONF_CHRONY_DEFAULT_NTP_SERVER))

	@$(call install_replace, chrony, /etc/chrony/chrony.keys, \
		@UNCONFIGURED_CHRONY_ACCESS_KEY@, $(PTXCONF_CHRONY_DEFAULT_ACCESS_KEY))
endif

#	#
#	# busybox init: startscripts
#	#
ifdef PTXCONF_INITMETHOD_BBINIT
ifdef PTXCONF_CHRONY_STARTSCRIPT
	@$(call install_alternative, chrony, 0, 0, 0755, /etc/init.d/chrony)
endif
endif
	@$(call install_finish, chrony)

	@$(call touch)

# vim: syntax=make