chiark / gitweb /
b4f4dc5f367397359ebfcd279106f9e4d2003515
[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 SHELL=/bin/bash
24
25 package=authbind
26 major=1
27 minor=0
28
29 arch = $(shell dpkg --print-architecture)
30
31 TOOL_PREFIX = $(shell set -x; a=`dpkg-architecture -q DEB_HOST_GNU_TYPE`; echo $$a$${a+-})
32 ifeq ($(origin CC),default)
33 CC=$(TOOL_PREFIX)gcc
34 endif
35
36 export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s)
37
38 INSTALL = install
39 INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
40 INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
41 INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
42 INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755
43
44 CFLAGS = -O2 -Wall
45 LDFLAGS = 
46
47
48 CFLAGS += -g
49 LDFLAGS += -g 
50
51 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
52 STRIP=$(TOOL_PREFIX)strip
53 INSTALL_PROGRAM += -s --strip-program=$(STRIP)
54 else
55 STRIP=:
56 endif
57
58 export CFLAGS
59 export LDFLAGS
60 export INSTALL
61 export INSTALL_FILE
62 export INSTALL_PROGRAM
63 export INSTALL_SCRIPT
64 export INSTALL_DIR
65 export STRIP
66
67
68 build: 
69         $(MAKE) prefix=/usr CC='$(CC)' LD='$(TOOL_PREFIX)ld'
70
71 clean:  
72         $(MAKE) distclean
73         rm -rf debian/{files,substvars,tmp} build
74         rm -f debian/*~ debian/#*# debian/core debian/*.bak
75
76 binary-indep:   checkroot build
77         $(checkdir)
78 # There are no architecture-independent files to be uploaded
79 # generated by this package.  If there were any they would be
80 # made here.
81
82 lab=libauthbind.so.$(major).$(minor)
83 udp=debian/tmp/usr/share/doc/$(package)
84
85 binary-arch:    checkroot build
86         rm -rf debian/tmp
87         install -d -g root -m 755 -o root debian/tmp/DEBIAN $(udp) \
88                 debian/tmp/usr/{bin,lib/$(package),share/man}
89         $(MAKE) prefix=debian/tmp/usr etc_dir=debian/tmp/etc/authbind \
90                 man_dir=debian/tmp/usr/share/man  install install_man
91         $(INSTALL_FILE) debian/changelog $(udp)/changelog
92         gzip -9n debian/tmp/usr/share/man/man*/* $(udp)/*
93         $(INSTALL_FILE) debian/copyright $(udp)/.
94         $(INSTALL_SCRIPT) debian/{postrm,prerm,postinst} debian/tmp/DEBIAN
95         dpkg-shlibdeps ./authbind
96         dpkg-gencontrol -isp
97         chown -R root.root debian/tmp
98         chmod -R g-ws debian/tmp
99         find debian/tmp -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
100                 xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
101         dpkg --build debian/tmp ..
102
103 binary:  binary-indep binary-arch
104
105 checkroot:
106         $(checkdir)
107         test root = "`whoami`"