- added Build-depends for SQL and gdbm libraries
[freeradius.git] / debian / rules
1 #! /usr/bin/make -f
2 #
3 #       debian/rules file for freeradius
4 #
5
6 SHELL=/bin/bash
7
8 # export DH_VERBOSE=1
9
10 package = freeradius
11 tmp     = $(shell pwd)/debian/tmp
12
13 prefix  = /
14 exec_prefix     = /usr
15 mandir  = $(exec_prefix)/share/man
16 libdir  = $(exec_prefix)/lib/radiusd-freeradius
17 logdir  = /var/log/radiusd-freeradius
18 pkgdocdir       = $(exec_prefix)/share/doc/radiusd-freeradius
19
20 build: clean
21 # Builds the binary package.
22         dh_testdir
23         # dh_testroot
24         ./configure --prefix=$(prefix) --exec-prefix=$(exec_prefix) --libdir=$(libdir) --mandir=$(mandir) --with-logdir=$(logdir) --with-thread-pool --enable-ltdl-install=no
25         make
26         touch build
27
28 # Architecture independant files.
29 binary-indep:   build
30
31 # Make a binary package (.deb file)
32 binary-arch:    build
33         dh_clean
34         dh_installdirs
35         make install prefix=$(prefix) exec_prefix=$(exec_prefix) mandir=$(mandir) libdir=$(libdir) R=$(tmp)
36         # clean up install cruft.  $$&@!%
37         rmdir $(tmp)/include
38         rm $(tmp)/usr/sbin/rc.radiusd
39         # man pages & docs
40         dh_undocumented 
41         install -g root -m 644 CREDITS $(tmp)$(pkgdocdir)/credits
42         dh_installdocs doc/README*
43         dh_installchangelogs doc/ChangeLog
44         dh_compress
45         # supporting programs
46         install -g root -m 755 scripts/radiusd.cron.daily $(tmp)/etc/cron.daily/freeradius
47         install -g root -m 755 scripts/radiusd.cron.monthly $(tmp)/etc/cron.monthly/freeradius
48         install -g root -m 755 scripts/rc.radiusd $(tmp)/etc/init.d/freeradius
49         # fix up conf file  --  all of these should be commented on in README.Debian
50         cp $(tmp)/etc/raddb/radiusd.conf newconf
51         cat newconf \
52                 | sed -e 's/        /   /g' \
53                 | sed -e '/^    example {/,/^   }/s/^/#deb#/' \
54                 | sed -e '/^    sql .*{/,/^     }/s/^/#deb#/' \
55                 | sed -e '/^    always .*{/,/^  }/s/^/#deb#/' \
56                 | sed -e 's/^           #       shadow          =/              shadow          =/' \
57                 | sed -e 's/^group = nobody/group = nogroup/' \
58                         > $(tmp)/etc/raddb/radiusd.conf
59         rm newconf
60         # 
61         dh_strip
62         dh_installdeb
63         dh_installchangelogs
64         dh_compress
65         dh_fixperms
66         dh_makeshlibs
67         dh_shlibdeps
68         dh_md5sums
69         dh_gencontrol
70         dh_builddeb
71
72 clean:  
73         dh_clean
74         [ -f Make.inc ] && make distclean || true
75         rm -f build debian/{files,substvars} debian/*.debhelper
76         rm -rf $(tmp)
77
78 binary: binary-indep binary-arch
79
80 .PHONY: binary binary-arch binary-indep clean