chiark / gitweb /
f967ad31287b5a12cd947dfcb82ed5a44c163111
[authbind.git] / debian / rules
1 #! /usr/bin/make -f
2 #
3 # debian/rules for authbind
4
5 # authbind is Copyright (C) 1998 Ian Jackson
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software Foundation,
19 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
20 #
21 # $Id$
22
23 CC= gcc
24 SHELL=/bin/bash
25
26 package=authbind
27 major=1
28 minor=0
29
30 arch = $(shell dpkg --print-architecture)
31
32 INSTALL = install
33 INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
34 INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
35 INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
36 INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755
37
38 CFLAGS = -O2 -Wall
39 LDFLAGS = 
40
41
42 CFLAGS += -g
43 LDFLAGS += -g 
44
45 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
46 INSTALL_PROGRAM += -s
47 endif
48
49 export CFLAGS
50 export LDFLAGS
51 export INSTALL
52 export INSTALL_FILE
53 export INSTALL_PROGRAM
54 export INSTALL_SCRIPT
55 export INSTALL_DIR
56
57
58 build: 
59         $(MAKE) prefix=/usr
60
61 clean:  
62         $(MAKE) distclean
63         rm -rf debian/{files,substvars,tmp} build
64         rm -f debian/*~ debian/#*# debian/core debian/*.bak
65
66 binary-indep:   checkroot build
67         $(checkdir)
68 # There are no architecture-independent files to be uploaded
69 # generated by this package.  If there were any they would be
70 # made here.
71
72 lab=libauthbind.so.$(major).$(minor)
73 udp=debian/tmp/usr/share/doc/$(package)
74
75 binary-arch:    checkroot build
76         rm -rf debian/tmp
77         install -d -g root -m 755 -o root debian/tmp/DEBIAN $(udp) \
78                 debian/tmp/usr/{bin,lib/$(package),share/man}
79         $(MAKE) prefix=debian/tmp/usr etc_dir=debian/tmp/etc/authbind \
80                 man_dir=debian/tmp/usr/share/man  install install_man
81         $(INSTALL_FILE) debian/changelog $(udp)/changelog
82         gzip -9 debian/tmp/usr/share/man/man*/* $(udp)/*
83         $(INSTALL_FILE) debian/copyright $(udp)/.
84         $(INSTALL_SCRIPT) debian/{postrm,prerm,postinst} debian/tmp/DEBIAN
85 ifneq ($(arch),alpha)
86         $(INSTALL_FILE) debian/shlibs debian/tmp/DEBIAN
87 else
88         $(INSTALL_FILE) debian/shlibs.alpha debian/tmp/DEBIAN/shlibs
89 endif
90         dpkg-shlibdeps ./authbind
91         dpkg-gencontrol -isp
92         chown -R root.root debian/tmp
93         chmod -R g-ws debian/tmp
94         dpkg --build debian/tmp ..
95
96 binary:  binary-indep binary-arch
97
98 checkroot:
99         $(checkdir)
100         test root = "`whoami`"