-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
74 lines (68 loc) · 3.38 KB
/
Makefile
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
#
# linotp-auth-freeradius - LinOTP FreeRADIUS module
# Copyright (C) 2010 - 2017 KeyIdentity GmbH
#
# 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 2 of the License, 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/>.
#
# E-mail: [email protected]
# Contact: www.linotp.org
# Support: www.keyidentity.com
#
FREERADDIR=`find sandbox -maxdepth 1 -name freeradius\* -type d`
LINOTP_VERSION=2.9.1rc0
COMMENT="added LinOTP2 module rlm_linotp"
info:
@echo "make clean -- this will delete the sandbox, needed to build the deb packages"
@echo "make deb -- this will build debian packages containig linotp module"
@echo "make getsource -- fetch the freeradius sources and put in the sandbox"
@echo "make build -- copy the rlm_linotp.c in the freeradius and run the make"
getsource:
mkdir -p sandbox
( cd sandbox && apt-get source freeradius )
cp -r src/rlm_linotp2 $(FREERADDIR)/src/modules/
cp -r src/rlm_linotp2/linotp2.conf $(FREERADDIR)/raddb/modules/linotp
cp -r src/rlm_linotp2/linotp $(FREERADDIR)/raddb/sites-available/
echo "rlm_linotp2" >> $(FREERADDIR)/src/modules/stable
( cd $(FREERADDIR) && ./configure )
build: src/rlm_linotp2/rlm_linotp2.c
cp -r src/rlm_linotp2 $(FREERADDIR)/src/modules/
(cd $(FREERADDIR)/src/modules/rlm_linotp2/ && make)
( cd $(FREERADDIR) && make )
pkg:
cp -r src/rlm_linotp2 $(FREERADDIR)/src/modules/
cp -r src/rlm_linotp2/linotp2.conf $(FREERADDIR)/raddb/modules/linotp
cp -r src/rlm_linotp2/linotp $(FREERADDIR)/raddb/sites-available/
echo "rlm_linotp2" >> $(FREERADDIR)/src/modules/stable
( cd $(FREERADDIR) && dpkg-buildpackage -b )
deb:
make clean
mkdir -p sandbox
( cd sandbox && apt-get source freeradius )
cp -r src/rlm_linotp2 $(FREERADDIR)/src/modules/
cp -r src/rlm_linotp2/linotp2.conf $(FREERADDIR)/raddb/modules/linotp
cp -r src/rlm_linotp2/linotp $(FREERADDIR)/raddb/sites-available/
echo "rlm_linotp2" >> $(FREERADDIR)/src/modules/stable
# remove iodbc, so that it will compile on ubuntu
sed /libiodbc/d $(FREERADDIR)/debian/control > control.new; mv control.new $(FREERADDIR)/debian/control
sed /odbc/d $(FREERADDIR)/src/modules/rlm_sql/stable > stable.new; mv stable.new $(FREERADDIR)/src/modules/rlm_sql/stable
# patch the postinstall
cp freeradius.postinst.diff $(FREERADDIR)/debian/
( cd $(FREERADDIR)/debian/; patch < freeradius.postinst.diff )
#cat Changelog.linotp $(FREERADDIR)/debian/changelog >> $(FREERADDIR)/debian/changelog.new
#mv $(FREERADDIR)/debian/changelog.new $(FREERADDIR)/debian/changelog
head -n1 sandbox/freeradius-*/debian/changelog | cut -d' ' -f2 | sed 's/(\(.*\))/\1/' > freeradius-version.tmp
( export DEBEMAIL="[email protected]"; export DEBFULLNAME="KeyIdentity LinOTP Packaging"; cd $(FREERADDIR); dch -v 1:`cat ../../freeradius-version.tmp`-linotp$(LINOTP_VERSION) $(COMMENT) )
( cd $(FREERADDIR) && dpkg-buildpackage -b )
clean:
rm sandbox -fr