File: rules

package info (click to toggle)
alpine 1.10%2Bdfsg-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 26,036 kB
  • ctags: 21,767
  • sloc: ansic: 308,814; tcl: 19,749; sh: 9,822; makefile: 1,926; perl: 189; exp: 69; csh: 48; sed: 16
file content (139 lines) | stat: -rwxr-xr-x 4,589 bytes parent folder | download
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# This allows debug symbols to be saved for use by end-users

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

config.status: autotools configure
	dh_testdir
	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs,--as-needed" --with-krb5 \
	--with-system-pinerc=/etc/pine.conf \
	--with-system-fixed-pinerc=/etc/pinerc.fixed \
	--with-debug-level=0 \
	--with-spellcheck-prog=aspell \
	--without-tcl \
	--with-passfile=.pine-passfile \
	--with-smtp-msa=/usr/sbin/sendmail \
	--with-krb5-dir=/usr \
	
	


autotools:
	OLDDATESUB=`./config.sub -t | tr -d -` ;\
	OLDDATEGUESS=`./config.guess -t | tr -d -` ;\
	NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d -` ;\
	NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d -` ;\
	if [ $$OLDDATESUB -lt $$NEWDATESUB -o \
	     $$OLDDATEGUESS -lt $$NEWDATEGUESS ]; then \
	   cp -f /usr/share/misc/config.sub config.sub ;\
	   cp -f /usr/share/misc/config.guess config.guess ;\
	   echo WARNING: GNU config scripts updated from master copies 1>&2 ;\
	fi
	autoconf


#Architecture 
build: build-arch

build-arch: build-arch-stamp
build-arch-stamp:  config.status
	touch $@

clean: autotools
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp #CONFIGURE-STAMP#
	[ ! -f Makefile ] || $(MAKE) clean
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	cp -f /usr/share/misc/config.guess config.guess
endif

	# Debianize paths in .c files and documentation
	sed -i 's|/usr/spool/mail|/var/spool/mail|g' imap/docs/locking.txt doc/tech-notes/low-level.html doc/tech-notes/config.html doc/tech-notes.txt
	sed -i 's|/usr/spool/news|/var/spool/news|g' imap/docs/locking.txt doc/tech-notes/low-level.html doc/tech-notes/config.html doc/tech-notes.txt
	sed -i 's|/usr/spool/folders/|/var/spool/folders/|g' imap/docs/imaprc.txt
	sed -i 's|/usr/local/lib/pine.conf|/etc/pine.conf|g' doc/tech-notes/config-notes.html doc/tech-notes/cmd-line.html doc/tech-notes/porting.html doc/tech-notes/installation.html doc/tech-notes/low-level.html doc/tech-notes/config.html doc/tech-notes/background.html doc/tech-notes.txt pith/filter.c
	sed -i 's|/usr/local/bin/netscape|/usr/bin/sensible-browser|g' doc/tech-notes.txt
	sed -i 's|/usr/local/bin/lynx|/usr/bin/lynx|g' doc/tech-notes.txt
	sed -i 's|/usr/sbin/mlock|/usr/bin/mlock|g' imap/src/osdep/unix/Makefile

	dh_clean

install: autotools install-arch

install-arch:
	dh_testdir
	dh_testroot
	dh_clean -k -s
	dh_installdirs -s
	$(MAKE) DESTDIR=$(CURDIR)/debian/alpine install

	# Create alpinef
	dh_link usr/share/man/man1/alpine.1.gz usr/share/man/man1/alpinef.1.gz
	dh_link usr/bin/alpine usr/bin/alpinef

	# Install man pages
	cp $(CURDIR)/doc/rpload.1 $(CURDIR)/debian/alpine/usr/share/man/man1
	cp $(CURDIR)/doc/rpdump.1 $(CURDIR)/debian/alpine/usr/share/man/man1

	# Alpine-pico
	mkdir -p $(CURDIR)/debian/alpine-pico/usr/bin/
	mkdir -p $(CURDIR)/debian/alpine-pico/usr/share/man/man1/
	mv $(CURDIR)/debian/alpine/usr/bin/pico $(CURDIR)/debian/alpine-pico/usr/bin/
	mv $(CURDIR)/debian/alpine/usr/share/man/man1/pico.1 $(CURDIR)/debian/alpine-pico/usr/share/man/man1/

	# pilot
	mkdir -p $(CURDIR)/debian/pilot/usr/bin/
	mkdir -p $(CURDIR)/debian/pilot/usr/share/man/man1/
	mv $(CURDIR)/debian/alpine/usr/bin/pilot $(CURDIR)/debian/pilot/usr/bin/
	mv $(CURDIR)/debian/alpine/usr/share/man/man1/pilot.1 $(CURDIR)/debian/pilot/usr/share/man/man1/

	# For everyone...
	dh_install -s

binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installman
	dh_link
	dh_strip --dbg-package=alpine-dbg
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common

binary-indep:


binary: binary-arch
.PHONY: build clean binary-arch binary install install-arch