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
|
#!/usr/bin/make -f
package = shadow
CFLAGS := -O2
IE := install -m755 -s
ID := install -m644
# Some special build options
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
LDFLAGS := -Dfoo # requires faking shadow's configure
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
IE := install -m755
endif
endif
# the dbs rules
TAR_DIR := shadow-19990827
include debian/scripts/dbs-build.mk
ifeq (,$(DEB_BUILD_GNU_TYPE))
include debian/scripts/dpkg-arch.mk
endif
# Deps for generating package scripts
dh_mak_deps := $(shell perl debian/scripts/dh_split makedeps)
dh_gen_deps := $(shell perl debian/scripts/dh_split gendeps)
# By default we only build the passwd package
include debian/scripts/passwd.mk
package-list := binary-passwd
config_options := --disable-shared --without-libcrack \
--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
# For GNU-Hurd, we don't want this package. nor do we want PAM
ifneq ($(DEB_HOST_GNU_SYSTEM),gnu)
include debian/scripts/login.mk
package-list += binary-login
config_options += --with-libpam
control_defs += -DMODDEP="(>= 0.72-5)"
endif
build: $(STAMP_DIR)/build-stamp
$(STAMP_DIR)/build-stamp: $(STAMP_DIR)/configure-stamp
$(checkdir)
$(MAKE) -C $(BUILD_TREE)
touch $(STAMP_DIR)/build-stamp
$(STAMP_DIR)/configure-stamp: $(patched)
cd $(BUILD_TREE) && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
./configure $(config_options)
touch $(STAMP_DIR)/configure-stamp
clean:
$(checkdir)
rm -rf $(STAMP_DIR) $(SOURCE_DIR) debian/tmp-{l,p}
rm -f debian/control && $(CC) -E -P -U__GNU__ $(control_defs) - < \
debian/control.in > debian/control
rm -f debian/files debian/substvars
perl debian/scripts/dh_split clean
binary-indep:
binary-arch: $(package-list)
# Build rules for each package
binary: binary-indep binary-arch
debian/control: force
$(CC) -E -P $(control_defs) - < debian/control.in > debian/control.tmp
if cmp -s debian/control.tmp debian/control; then \
rm -f debian/control.tmp; \
else \
mv -f debian/control.tmp debian/control; \
fi
force:
define checkdir
test -f debian/control.in
endef
define checkroot
test root = "`whoami`"
endef
$(dh_mak_deps): $(dh_gen_deps)
perl debian/scripts/dh_split
.PHONY: binary binary-arch binary-indep clean checkroot
|