File: rules

package info (click to toggle)
libedit 2.11~20080614-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 756 kB
  • ctags: 2,012
  • sloc: ansic: 14,094; sh: 178; makefile: 175
file content (107 lines) | stat: -rwxr-xr-x 3,405 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
#! /usr/bin/make -f
## debian/rules for libedit, mostly a pmake workaround..
## hacked together by Gergely Nagy <algernon@debian.org>
## $MadHouse: Debian/libedit/debian/rules,v 1.3 2001/11/04 01:57:26 algernon Exp $

# This is the debhelper compatability version to use.

PACKAGE		 = libedit
PKGDIR		 = ${CURDIR}/debian/tmp
PMAKE_ARGS	 = MKPROFILE=no MKCATPAGES=no MLINKS= MANPAGES= \
		 SHLIB_SHFLAGS="-Wl,-soname,libedit.so.${major}" \
		 LDADD="*.so -lcurses"
EDITLINE_3_LINKS = el_init el_end el_reset el_gets el_getc el_push \
		 el_parse el_set el_get el_source el_resize el_line \
		 el_insertstr el_deletestr history_init history_end history

version		 = 2.11
major		 = 2
## For automatic update from CVS
CVSROOT		 = :pserver:anoncvs@anoncvs.netbsd.org:/cvsroot
DATE		 = $(shell date +%Y%m%d)
ROOT		 = basesrc
MISC_STUFF	 = lib/libc/include/namespace.h lib/libc/string/strlcat.c \
		 lib/libc/string/strlcpy.c lib/libc/gen/vis.c \
		 lib/libc/gen/unvis.c include/vis.h

DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# Workaround for pmake fussiness
ifeq (mips-linux,$(DEB_HOST_GNU_TYPE))
  PMAKE_ARGS += MACHINE_ARCH=mipseb
endif

include /usr/share/quilt/quilt.make

build: patch build-stamp
build-stamp:
	dh_testdir
	chmod 755 libedit/makelist	# workaround a bug in upstream source
	cd libedit && pmake ${PMAKE_ARGS}
	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	dh_clean build-stamp
	-cd libedit && pmake distclean

install: build
	dh_testdir
	dh_testroot
	dh_clean
	install -d ${PKGDIR}/usr/lib
	install -d ${PKGDIR}/usr/include/readline
	install -d ${PKGDIR}/usr/include/libedit
	install -d ${PKGDIR}/usr/share/man/man3
	install -d ${PKGDIR}/usr/share/man/man5
	install -d ${PKGDIR}/usr/lib/pkgconfig
	install -m 644 $(CURDIR)/glibc-compat/vis.h ${PKGDIR}/usr/include/libedit
	install -m 644 $(CURDIR)/debian/libedit.pc ${PKGDIR}/usr/lib/pkgconfig
	cd libedit && \
	 pmake install incinstall DESTDIR=${PKGDIR} ${PMAKE_ARGS}
## pmake workaround
	cd libedit/readline && \
	 pmake incinstall DESTDIR=${PKGDIR} ${PMAKE_ARGS}
	mv ${PKGDIR}/usr/include/readline ${PKGDIR}/usr/include/editline
	ln -sf libedit.so.${version} ${PKGDIR}/usr/lib/libedit.so.${major}
	ln -sf libedit.so.${major} ${PKGDIR}/usr/lib/libedit.so

binary-indep: build install
binary-arch: build install
	dh_testdir
	dh_testroot
## Install manpages
	install -m 0644 libedit/editline.3 ${PKGDIR}/usr/share/man/man3/editline.3el
	install -m 0644 libedit/editrc.5 ${PKGDIR}/usr/share/man/man5/editrc.5el
## End
	dh_movefiles
	@list="${EDITLINE_3_LINKS}"; for l in $$list; do \
		echo "ln -sf editline.3el ${CURDIR}/debian/libedit-dev/usr/share/man/man3/$$l.3el"; \
		ln -sf editline.3el ${CURDIR}/debian/libedit-dev/usr/share/man/man3/$$l.3el; \
	done
	dh_installdocs
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

cvs-update:
	install -d glibc-compat/tmp
	cd glibc-compat/tmp && \
	 cvs -d ${CVSROOT} export -D now $(patsubst %,${ROOT}/%,${MISC_STUFF})
	find glibc-compat/tmp -type f -exec mv {} glibc-compat/ \;
	rm -rf glibc-compat/tmp
	cvs -d ${CVSROOT} export -D now -d libedit-${DATE} ${ROOT}/lib/libedit

.PHONY: build clean binary-indep binary-arch binary install cvs-update