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 140 141 142 143 144 145 146
|
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
SHELL=bash
# 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
CFLAGS = -Wall -Wno-unknown-pragmas -g -pipe -fPIC -I. -D_GNU_SOURCE -DNEED_SOLARIS_BOOLEAN -D'__FBSDID(string)=' -D__va_list=__builtin_va_list
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
VERSION=$(shell dpkg-parsechangelog | sed -e '/^Version:/!d' -e 's/^Version: //g' -e 's/-.*//g')
SVN=http://svn.freebsd.org/base/release/$(VERSION).0
ORIGDIR=zfsutils-$(VERSION)
PATH:=/usr/lib/freebsd:$(PATH)
DESTDIR=$(CURDIR)/debian/tmp
PMAKE=COPTS="$(CFLAGS)" CFLAGS="$(CFLAGS)" NO_WERROR=1 NOGCCERROR=1 NOSHARED=NO NO_SHARED=NO DESTDIR=$(DESTDIR) make
export SHLIB_MAJOR=0
export SHLIBDIR=./
get-orig-source:
rm -rf $(ORIGDIR)
for i in \
cddl/compat/opensolaris \
cddl/contrib/opensolaris/head \
cddl/contrib/opensolaris/cmd/zdb \
cddl/contrib/opensolaris/cmd/zfs \
cddl/contrib/opensolaris/cmd/zinject \
cddl/contrib/opensolaris/cmd/zpool \
cddl/contrib/opensolaris/cmd/ztest \
cddl/contrib/opensolaris/lib/libnvpair \
cddl/contrib/opensolaris/lib/libuutil \
cddl/contrib/opensolaris/lib/libzfs \
cddl/contrib/opensolaris/lib/libzpool \
sys/cddl/compat/opensolaris \
sys/cddl/contrib/opensolaris \
cddl/lib/libnvpair \
cddl/lib/libuutil \
cddl/lib/libzfs \
cddl/sbin/zpool \
cddl/sbin/zfs \
cddl/usr.bin/zinject \
cddl/usr.bin/ztest \
cddl/usr.sbin/zdb \
; do \
svn export $(SVN)/$$i $(ORIGDIR)/$$i ; \
done
rm -f $(ORIGDIR)/cddl/compat/opensolaris/include/stdlib.h
rm -rf $(ORIGDIR)/sys/cddl/contrib/opensolaris/uts/common/zmod
tar -czf ../zfsutils_$(VERSION).orig.tar.gz $(ORIGDIR)
rm -rf $(ORIGDIR)
patch: patch-stamp
patch-stamp:
QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
touch $@
build: build-libuutil build-libnvpair build-libzfs build-zfsutils
build-libuutil: build-libuutil-stamp
build-libuutil-stamp: patch
$(PMAKE) -C $(CURDIR)/cddl/lib/libuutil
touch $@
build-libnvpair: build-libnvpair-stamp
build-libnvpair-stamp: patch
$(PMAKE) -C $(CURDIR)/cddl/lib/libnvpair
touch $@
build-libzfs: build-libzfs-stamp
build-libzfs-stamp: patch build-libnvpair-stamp build-libuutil-stamp
$(PMAKE) -C $(CURDIR)/cddl/lib/libzfs
touch $@
build-zfsutils: build-zfsutils-stamp
build-zfsutils-stamp: patch build-libzfs-stamp build-libnvpair-stamp build-libuutil-stamp
$(PMAKE) -C $(CURDIR)/cddl/sbin/zpool
$(PMAKE) -C $(CURDIR)/cddl/sbin/zfs
touch $@
clean:
dh_testdir
dh_testroot
$(PMAKE) -C $(CURDIR)/cddl/lib/libnvpair clean
$(PMAKE) -C $(CURDIR)/cddl/lib/libuutil clean
$(PMAKE) -C $(CURDIR)/cddl/lib/libzfs clean
$(PMAKE) -C $(CURDIR)/cddl/sbin/zpool clean
$(PMAKE) -C $(CURDIR)/cddl/sbin/zfs clean
QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2
rm -rf .pc
rm -f *stamp
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep -s
dh_installdirs -s
dh_install -s
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs -a
dh_installdocs -a
# dh_installexamples
dh_installinit --no-restart-on-upgrade --name=zfs -- start 26 S . stop 50 0 6 .
# dh_installcron
# dh_installinfo
dh_installman
dh_link -a
dh_strip -a
dh_compress -a
dh_fixperms -a
# dh_perl
# dh_python
dh_makeshlibs -a
dh_makeshlibs -plibnvpair0 --add-udeb=libnvpair0-udeb
dh_makeshlibs -plibuutil0 --add-udeb=libuutil0-udeb
dh_makeshlibs -plibzfs0 --add-udeb=libzfs0-udeb
dh_makeshlibs -pzfsutils --add-udeb=zfsutils-udeb
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install configure
|