File: rules

package info (click to toggle)
xorp 1.8.6~wip.20160715-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid, stretch
  • size: 29,132 kB
  • ctags: 55,022
  • sloc: cpp: 379,507; sh: 28,464; ansic: 20,843; python: 7,672; lex: 1,715; yacc: 1,592; awk: 956; perl: 217; makefile: 193; xml: 166; sed: 33
file content (151 lines) | stat: -rwxr-xr-x 4,116 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

#For overriding debian/compat
#export DH_COMPAT=7

#This rule file have a bashism
SHELL:=/bin/bash

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# Personal Variables
PACKNAME=$(shell dh_listpackages)
PACKAGE=$(shell dh_listpackages)

# Variables used by the Debian Maintainer exclusively for package
# development.
SOURCENAME=$(shell dpkg-parsechangelog | grep "Source:" | cut -d ' ' -f 2)
DEBVER=$(shell dpkg-parsechangelog | grep "Version:" | cut -d ' ' -f 2)
VER=$(shell dpkg-parsechangelog | grep "Version:" | cut -d ' ' -f 2 | cut -f 1 -d -)


SCONS=scons
SCONSFLAGS=prefix=/usr \
		bindir=/usr/bin sbindir=/usr/sbin \
		mandir=/usr/share/man infodir=/usr/share/info \
		sysconfdir=/etc \
		with-olsr=true \
		disable_fw=true \
		enable_systemd=true \
		disable_werror=true \
		CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
		CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)"

CXXFLAGS += -std=gnu++98


config.status:
	dh_testdir
	# Add here commands to configure the package.


build: build-arch build-indep

build-indep: build-indep-stamp
build-indep-stamp:
	# Upstream dropped documentation out of source code
	touch $@


build-arch:  build-arch-stamp
build-arch-stamp:  config.status
	dh_testdir
	dh_update_autotools_config
	# Compile the package
	$(SCONS) $(SCONSFLAGS)
	docbook-to-man debian/xorp_rtrmgr.sgml > debian/xorp_rtrmgr.8
	docbook-to-man debian/xorpsh.sgml > debian/xorpsh.1
	touch $@


check:
	$(SCONS) $(SCONSFLAGS) check



clean: 
	dh_testdir
	dh_testroot
	# Add here commands to clean up after the build process.
	[ ! -e ./libxorp/build_info.cc ] || $(SCONS) $(SCONSFLAGS) -c
	rm -rf obj
	rm -f config.status config.log build-arch-stamp build-indep-stamp
	rm -f relpath.pyc site_scons/*/*.pyc
	rm -f xrl/scripts/Xif/*.pyc
	dh_clean 


install: install-arch


install-arch:
	dh_testdir
	dh_testroot
	#dh_clean -k -a
	dh_prep
	dh_installdirs -a
	# Install the program:
	$(SCONS) $(SCONSFLAGS) \
		DESTDIR=$(CURDIR)/debian/$(SOURCENAME) install

	# After the install, we move the files and create the symlinks : 
	for file in rib_xrl_shell_funcs.sh fea_xrl_shell_funcs.sh bgp_xrl_shell_funcs.sh ; do mv debian/$(SOURCENAME)/usr/sbin/$$file debian/$(SOURCENAME)/usr/lib/xorp/bin/   ; done
	cd debian/$(SOURCENAME)/usr/sbin/ && find -type f -exec ln -vsf /usr/sbin/{} ../lib/xorp/bin/ \; && cd $(CURDIR)
	# Config files: 
	cp debian/config.boot.small debian/$(SOURCENAME)/etc/xorp/config.boot
	cp debian/$(SOURCENAME).default debian/$(SOURCENAME)/etc/default/xorp
	cp debian/$(SOURCENAME).init.d  debian/$(SOURCENAME)/etc/init.d/xorp
	dh_install -s


# Must not depend on anything. This is to be called by
# binary-arch/binary-indep
# in another 'make' thread.
binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installexamples -pxorp rtrmgr/config/*.boot debian/config.boot.mcast  rtrmgr/config/README
	dh_installlogrotate
	dh_systemd_enable
	dh_installinit
	dh_systemd_start
	dh_installman 
	dh_link
	dh_strip
	dh_compress 
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps -l/usr/lib/xorp/lib
	dh_gencontrol
	dh_md5sums
	dh_builddeb


# Build architecture dependant packages using the common target.
binary-arch: build-arch-stamp install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common


binary: binary-arch

.PHONY: build clean binary-indep binary-arch binary install