This file is indexed.

/usr/share/cdbs/1/class/waf.mk is in cdbs 0.4.150.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2010 Rémi Thebault <remi.thebault@gmail.com>
# Copyright © 2011, 2014, 2016 Jonas Smedegaard <dr@jones.dk>
# Description: A class to configure and build Waf based packages
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

####
#
# Here is how to use this class in debian/rules:
#   include /usr/share/cdbs/1/class/waf.mk
#
# General variables implemented by this class file:
#
# DEB_WAF_OPTIONS
#   Options that will be appended to every WAF call
#
# DEB_WAF_CONFIGURE_OPTIONS
#   Options that will be appended to the WAF configure target
#
# DEB_WAF_ENV
#   Environment variables to be passed to every WAF invocation

_cdbs_scripts_path ?= /usr/lib/cdbs
_cdbs_rules_path ?= /usr/share/cdbs/1/rules
_cdbs_class_path ?= /usr/share/cdbs/1/class

ifndef _cdbs_class_waf
_cdbs_class_waf = 1

include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)

DEB_WAF_PREFIX ?= /usr

cdbs_waf_options = $(call cdbs_expand_curvar,DEB_WAF_OPTIONS)
cdbs_waf_configure_options = $(call cdbs_expand_curvar,DEB_WAF_CONFIGURE_OPTIONS)
cdbs_waf_env = $(call cdbs_expand_curvar,DEB_WAF_ENV)

cdbs_waf_parallel = $(and $(DEB_BUILD_PARALLEL),$(DEB_PARALLEL_JOBS),--jobs $(DEB_PARALLEL_JOBS))
cdbs_waf_invoke = cd $(DEB_SRCDIR) && $(cdbs_waf_env) ./waf $(cdbs_waf_parallel)
cdbs_waf_configure_env = $(call cdbs_set_nondefaultvars,CC CXX) CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LINKFLAGS="$(LDFLAGS)"
cdbs_waf_configure_invoke = cd $(DEB_SRCDIR) && $(cdbs_waf_configure_env) $(cdbs_waf_env) ./waf $(cdbs_waf_parallel)

cdbs_waf_configure_target := configure
cdbs_waf_clean_target := distclean
cdbs_waf_build_target := build
cdbs_waf_install_target := install

# ensure waf is executable and wscript is present
testsanity::
	test -f $(DEB_SRCDIR)/waf
	test -x $(DEB_SRCDIR)/waf
	test -f $(DEB_SRCDIR)/wscript

# and that waf fit the checksum in debian/waf.sha1sum
cdbs-waf-checksum:
	$(if $(DEB_WAF_SKIP_CHECKSUM),\
		$(call cdbs_warn,\
			waf file is executed without prior inspection! \
			This might be unsafe - you have been warned...!),\
		$(call cdbs_info,\
			Will now checksum the waf file with debian/waf.sha1sum)\
			$(if $(shell if test -f debian/waf.sha1sum; then echo something; fi),\
				,\
				$(error ERROR: \
					debian/waf.sha1sum is absent))\
			$(if $(shell grep waf debian/waf.sha1sum),\
				,\
				$(error ERROR: \
					debian/waf.sha1sum is present \
					but doesn't actually test waf))\
			$(if $(shell if sha1sum --check --status debian/waf.sha1sum; then echo something; fi),\
				$(call cdbs_info,\
					waf checksum is OK),\
				$(call cdbs_warn,\
					waf calculated checksum is \
					$(firstword $(shell sha1sum ./waf)))\
					$(info $(shell $(_cdbs_scripts_path)/waf-unpack --waf ./waf --dest debian/waf-unpacked)) \
					$(error ERROR: \
						waf checksum doesn't \
						fit debian/waf.sha1sum. \
						Inspect unpacked waf in \
						debian/waf-unpacked, \
						and if ok store above \
						calculated checksum as \
						debian/waf.sha1sum \
						and delete \
						debian/waf-unpacked)))

common-configure-arch common-configure-indep:: common-configure-impl
common-configure-impl:: debian/stamp-waf-configure
debian/stamp-waf-configure:
	$(cdbs_waf_configure_invoke) $(cdbs_waf_configure_target) \
		--prefix=$(DEB_WAF_PREFIX) \
		$(cdbs_waf_options) \
		$(cdbs_waf_configure_options)
	touch $@

common-build-arch common-build-indep:: common-build-impl
common-build-impl:: debian/stamp-waf-build
debian/stamp-waf-build:
	$(cdbs_waf_invoke) $(cdbs_waf_build_target) \
		$(cdbs_waf_options)
	touch $@

clean:: cdbs-waf-clean
cdbs-waf-clean:
	$(cdbs_waf_invoke) $(cdbs_waf_clean_target) \
		$(cdbs_waf_options)
	rm -rf debian/stamp-waf-*

common-install-arch common-install-indep:: common-install-impl
common-install-impl::
	$(cdbs_waf_invoke) $(cdbs_waf_install_target) \
		--destdir=$(cdbs_curdestdir) \
		$(cdbs_waf_options)

CDBS_BUILD_DEPENDS_class_waf ?= python, cdbs (>= 0.4.90~)
CDBS_BUILD_DEPENDS += , $(CDBS_BUILD_DEPENDS_class_waf)

DEB_PHONY_RULES += cdbs-waf-clean

endif