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