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
|
#!/usr/bin/make -f
#export DH_VERBOSE=1
export DH_COMPAT=3
export DH_OPTIONS
export LANG=C
DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_BUILD_GNU_CPU := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
DEB_BUILD_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifeq ($(DEB_BUILD_GNU_SYSTEM),netbsd-elf-gnu)
CONFIGURE_PTHREAD := --enable-pthread
endif
ifeq ($(DEB_BUILD_GNU_SYSTEM),knetbsd-gnu)
CONFIGURE_PTHREAD := --enable-pthread
endif
ifeq ($(DEB_BUILD_GNU_SYSTEM),kfreebsd-gnu)
CONFIGURE_PTHREAD := --enable-pthread
endif
ifeq ($(CONFIGURE_PTHREAD),)
pthread_arch = none
else
pthread_arch = $(DEB_BUILD_ARCH)
endif
export CONFIGURE_PARAMS=--prefix=/usr --mandir='\$${prefix}/share/man' --infodir='\$${prefix}/share/info' ${CONFIGURE_PTHREAD}
export LIBPTH-DBG_DIR=libpth-dbg
export LIBPTH-PROF_DIR=libpth-prof
configure-stamp:
dh_testdir
mkdir default dbg profile
cd default; ../configure ${CONFIGURE_PARAMS}
cd dbg; ../configure ${CONFIGURE_PARAMS} --libdir='\$${prefix}/lib/debug' --disable-static --enable-debug
cd profile; ../configure ${CONFIGURE_PARAMS} --enable-prof
for i in default dbg profile ; do cp /usr/bin/libtool $$i/ ; done
touch configure-stamp
build: configure-stamp
cd default; make
cd dbg; make
cd profile; make
cd default; make test
cd dbg; make test
cd profile; make test
touch build
clean:
dh_testdir
dh_testroot
cp /usr/share/misc/config.guess \
/usr/share/misc/config.sub .
cat debian/control.in | sed s/@pthread_arch@/$(pthread_arch)/g > \
debian/control
rm -rf default dbg profile
rm -f configure-stamp build
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
cd dbg; $(MAKE) DESTDIR=`pwd`/../debian/${LIBPTH-DBG_DIR} install
cd profile; $(MAKE) DESTDIR=`pwd`/../debian/${LIBPTH-PROF_DIR} install
cd default; $(MAKE) DESTDIR=`pwd`/../debian/tmp install
ifeq ($(CONFIGURE_PTHREAD),)
dh_movefiles -Nlibpthread2 -Nlibpthread-dev
else
dh_movefiles
endif
rm -rf debian/{${LIBPTH-DBG_DIR},${LIBPTH-PROF_DIR}}/usr/{bin,include,share/{aclocal,man}}
rm -f debian/${LIBPTH-DBG_DIR}/usr/lib/debug/*.{la,so}
rm -f debian/${LIBPTH-PROF_DIR}/usr/lib/*.so*
cd debian/${LIBPTH-PROF_DIR}/usr/lib; mv libpth.a libpth_p.a
cd debian/${LIBPTH-PROF_DIR}/usr/lib; sed -e 's/libpth\.a/libpth_p\.a/g' -e 's/libpth\.la/libpth_p\.la/g' libpth.la > libpth_p.la
rm debian/${LIBPTH-PROF_DIR}/usr/lib/libpth.la
ifneq ($(CONFIGURE_PTHREAD),)
cd debian/${LIBPTH-PROF_DIR}/usr/lib; mv libpthread.a libpthread_p.a
cd debian/${LIBPTH-PROF_DIR}/usr/lib; sed -e 's/libpthread\.a/libpthread_p\.a/g' -e 's/libpthread\.la/libpthread_p\.la/g' libpthread.la > libpthread_p.la
rm debian/${LIBPTH-PROF_DIR}/usr/lib/libpthread.la
endif
# Build architecture-dependent files here.
binary-indep: DH_OPTIONS=-i
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: DH_OPTIONS=-a
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs
dh_installman
dh_installchangelogs ChangeLog
dh_link
dh_strip -Xlibpth-dbg
dh_compress
dh_fixperms
dh_makeshlibs -Xlibpth-dbg
dh_installdeb
dh_shlibdeps
cp -a debian/libpth2.substvars debian/libpth-dbg.substvars
ifeq ($(CONFIGURE_PTHREAD),)
dh_gencontrol -Nlibpthread2 -Nlibpthread-dev
else
dh_gencontrol
endif
dh_md5sums
ifeq ($(CONFIGURE_PTHREAD),)
dh_builddeb -Nlibpthread2 -Nlibpthread-dev
else
dh_builddeb
endif
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean install
|