summaryrefslogtreecommitdiffstats
path: root/rules/logrotate.make
blob: fb924ed664706b8d0b6331d6751c72180acfa5ec (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
# -*-makefile-*-
# $Id: template 6001 2006-08-12 10:15:00Z mkl $
#
# Copyright (C) 2006 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_LOGROTATE) += logrotate

#
# Paths and names
#
LOGROTATE_VERSION	:= 3.7.1
LOGROTATE		:= logrotate-$(LOGROTATE_VERSION)
LOGROTATE_SUFFIX	:= tar.gz
LOGROTATE_URL		:= http://www.pengutronix.de/software/ptxdist/temporary-src/$(LOGROTATE).$(LOGROTATE_SUFFIX)
LOGROTATE_SOURCE	:= $(SRCDIR)/$(LOGROTATE).$(LOGROTATE_SUFFIX)
LOGROTATE_DIR		:= $(BUILDDIR)/$(LOGROTATE)

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

logrotate_get: $(STATEDIR)/logrotate.get

$(STATEDIR)/logrotate.get: $(logrotate_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(LOGROTATE_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, LOGROTATE)

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

logrotate_extract: $(STATEDIR)/logrotate.extract

$(STATEDIR)/logrotate.extract: $(logrotate_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(LOGROTATE_DIR))
	@$(call extract, LOGROTATE)
	@$(call patchin, LOGROTATE)
	@$(call touch, $@)

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

logrotate_prepare: $(STATEDIR)/logrotate.prepare

LOGROTATE_PATH	:= PATH=$(CROSS_PATH)
LOGROTATE_ENV 	:= $(CROSS_ENV) RPM_OPT_FLAGS='$(strip $(CROSS_CPPFLAGS))'

LOGROTATE_MAKEVARS := OS_NAME=Linux LFS=-D_FILE_OFFSET_BITS=64

$(STATEDIR)/logrotate.prepare: $(logrotate_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

logrotate_compile: $(STATEDIR)/logrotate.compile

$(STATEDIR)/logrotate.compile: $(logrotate_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(LOGROTATE_DIR) && $(LOGROTATE_ENV) $(LOGROTATE_PATH) $(MAKE) $(LOGROTATE_MAKEVARS)
	@$(call touch, $@)

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

logrotate_install: $(STATEDIR)/logrotate.install

$(STATEDIR)/logrotate.install: $(logrotate_install_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

logrotate_targetinstall: $(STATEDIR)/logrotate.targetinstall

$(STATEDIR)/logrotate.targetinstall: $(logrotate_targetinstall_deps_default)
	@$(call targetinfo, $@)

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

	@$(call install_copy, logrotate, 0, 0, 0755, $(LOGROTATE_DIR)/logrotate, /usr/sbin/logrotate)

	@$(call install_finish,logrotate)

	@$(call touch, $@)

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

logrotate_clean:
	rm -rf $(STATEDIR)/logrotate.*
	rm -rf $(PKGDIR)/logrotate_*
	rm -rf $(LOGROTATE_DIR)

# vim: syntax=make