forked from FreeRADIUS/freeradius-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules
executable file
·229 lines (189 loc) · 6.8 KB
/
rules
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
#!/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.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets by Bill Allombert 2001
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
.NOTPARALLEL:
SHELL = /bin/bash
package = freeradius
freeradius_dir = $(CURDIR)/debian/tmp
mandir = /usr/share/man
libdir = /usr/lib/$(package)
logdir = /var/log/$(package)
pkgdocdir = /usr/share/doc/$(package)
raddbdir = /etc/$(package)
modulelist=krb5 ldap sql_mysql sql_unixodbc sql_postgresql dhcp redis rest yubikey
pkgs=$(shell dh_listpackages)
# This has to be exported to make some magic below work.
export DH_OPTIONS
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
confflags += --build $(DEB_HOST_GNU_TYPE)
else
confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
# Add dependency on distribution specific version of openssl that fixes Heartbleed (CVE-2014-0160).
ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
SUBSTVARS = -Vdist:Depends="libssl1.0.0 (>= 1.0.1f-1ubuntu2)"
else
SUBSTVARS = -Vdist:Depends="libssl1.0.0 (>= 1.0.1e-2+deb7u5) | libssl1.0.2"
endif
# Add libsystemd-dev as a Build-Depends to debian/control if it is known to this system
ifeq ($(shell apt-cache show libsystemd-dev &>/dev/null && echo yes),yes)
CONTROL_BUILDDEPS += libsystemd-dev,
endif
debian/control: debian/control.in
sed -e 's/@BUILDDEPS@/$(CONTROL_BUILDDEPS)/g' \
debian/control.in > debian/control.tmp
mv debian/control.tmp debian/control
include /usr/share/quilt/quilt.make
config.status: configure
dh_testdir
ifeq (config.sub.dist,$(wildcard config.sub.dist))
rm config.sub
else
mv config.sub config.sub.dist
endif
ifeq (config.guess.dist,$(wildcard config.guess.dist))
rm config.guess
else
mv config.guess config.guess.dist
endif
ln -s /usr/share/misc/config.sub config.sub
ln -s /usr/share/misc/config.guess config.guess
./configure $(confflags) \
--config-cache \
--disable-developer \
--disable-openssl-version-check \
--prefix=/usr \
--exec-prefix=/usr \
--mandir=$(mandir) \
--sysconfdir=/etc \
--libdir=$(libdir) \
--datadir=/usr/share \
--localstatedir=/var \
--with-raddbdir=$(raddbdir) \
--with-logdir=/var/log/$(package) \
--with-large-files \
--with-udpfromto \
--without-rlm_eap_tnc \
--with-rlm_sql_postgresql_lib_dir=`pg_config --libdir` \
--with-rlm_sql_postgresql_include_dir=`pg_config --includedir` \
--without-rlm_eap_ikev2 \
--without-rlm_sql_oracle \
--without-rlm_sql_unixodbc \
--with-systemd \
--enable-reproducible-builds
rm config.guess
mv config.guess.dist config.guess
rm config.sub
mv config.sub.dist config.sub
#Architecture
build: build-arch build-indep
build-arch: patch build-arch-stamp
build-arch-stamp: config.status
$(MAKE)
touch $@
build-indep: patch build-indep-stamp
build-indep-stamp: config.status
touch $@
clean: debian/control unpatch
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp
rm -f config.cache config.log
rm -f src/freeradius-devel
[ ! -d src/modules/lib ] || rm -fr src/modules/lib || true
[ ! -d src/binary ] || rm -fr src/binary || true
# Add here commands to clean up after the build process.
ifeq (Make.inc,$(wildcard Make.inc))
$(MAKE) distclean
endif
ifeq (config.sub.dist,$(wildcard config.sub.dist))
rm -f config.sub
mv config.sub.dist config.sub
endif
ifeq (config.guess.dist,$(wildcard config.guess.dist))
rm -f config.guess
mv config.guess.dist config.guess
endif
#distclean destroys debian/control, however we need it for dh_clean
$(MAKE) -f debian/rules debian/control
dh_clean
install: install-arch
install-arch: build-arch-stamp
dh_testdir
dh_testroot
dh_installdirs
test -d $(freeradius_dir)/usr/lib/freeradius || mkdir -p $(freeradius_dir)/usr/lib/freeradius
ln -fs rlm_sql.so $(freeradius_dir)/usr/lib/freeradius/librlm_sql.so
$(MAKE) install R=$(freeradius_dir) PACKAGE='debian'
# rename radius binary to play nicely with others
mv $(freeradius_dir)/usr/sbin/radiusd $(freeradius_dir)/usr/sbin/$(package)
mv $(freeradius_dir)/$(mandir)/man8/radiusd.8 $(freeradius_dir)/$(mandir)/man8/$(package).8
# don't package symlinks in sites-enabled and mods-enabled - they're
# created on install by freeradius-config.postinst
rm $(freeradius_dir)/etc/freeradius/sites-enabled/*
rm $(freeradius_dir)/etc/freeradius/mods-enabled/*
dh_install -i --sourcedir=$(freeradius_dir)
dh_install --sourcedir=$(freeradius_dir) -p libfreeradius4
dh_install --sourcedir=$(freeradius_dir) -p libfreeradius-dev
dh_install --sourcedir=$(freeradius_dir) -p freeradius-config
for mod in ${modulelist}; do \
pkg=$${mod##sql_} ; \
dh_install --sourcedir=$(freeradius_dir) -p freeradius-$$pkg ; \
rm -f $(freeradius_dir)/usr/lib/freeradius/rlm_$$mod*.so ; \
done
dh_install --sourcedir=$(freeradius_dir) -p freeradius-memcached
rm -f $(freeradius_dir)/usr/lib/freeradius/rlm_cache_memcached.so
dh_install --sourcedir=$(freeradius_dir) -p freeradius-utils
dh_install --sourcedir=$(freeradius_dir) -p freeradius -Xusr/lib/freeradius/rlm_cache_redis.so
dh_strip -a --dbg-package=freeradius-dbg
dh_makeshlibs -a -n
dh_shlibdeps -l$(freeradius_dir)/usr/lib/freeradius
binary-common:
dh_testdir
dh_testroot
dh_installchangelogs doc/ChangeLog
dh_installdocs -Xdebian/tmp/usr/share/doc/freeradius/ChangeLog
dh_installexamples
dh_installlogrotate
dh_installpam --name=radiusd
dh_systemd_enable
dh_installinit --noscripts
dh_systemd_start
dh_installman
dh_lintian
dh_link
dh_compress -Xexamples
dh_fixperms
dh_installdeb
dh_gencontrol -- $(SUBSTVARS)
dh_md5sums
dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch