xbps-src: no need to subst shell helpers anymore.

This commit is contained in:
Juan RP 2011-11-18 14:20:00 +01:00
parent c011a2749b
commit 99578ee070
7 changed files with 11 additions and 30 deletions

View File

@ -1,6 +1,6 @@
include ../vars.mk include ../vars.mk
SCRIPTS = chroot-helper doinst-helper SCRIPTS = chroot-helper.sh doinst-helper.sh
MOUNT_BIN = capmount MOUNT_BIN = capmount
UMOUNT_BIN = capumount UMOUNT_BIN = capumount
CHROOT_BIN = capchroot CHROOT_BIN = capchroot
@ -10,26 +10,18 @@ LDFLAGS = -lcap
ifdef IN_CHROOT ifdef IN_CHROOT
BINS = BINS =
SCRIPTS = doinst-helper SCRIPTS = doinst-helper.sh
endif endif
.PHONY: all .PHONY: all
all: $(BINS) all: $(BINS)
for bin in $(SCRIPTS); do \
sed -e "s|@@XBPS_INSTALL_PREFIX@@|$(PREFIX)|g" \
-e "s|@@XBPS_INSTALL_ETCDIR@@|$(ETCDIR)|g" \
-e "s|@@XBPS_INSTALL_SHAREDIR@@|$(SHAREDIR)|g" \
-e "s|@@XBPS_INSTALL_SBINDIR@@|$(SBINDIR)|g" \
-e "s|@@XBPS_INSTALL_LIBEXECDIR@@|$(LIBEXECDIR)|g" \
$$bin.sh.in > $$bin; \
done
.PHONY: clean .PHONY: clean
clean: clean:
-rm -f $(BINS) $(SCRIPTS) -rm -f $(BINS)
.PHONY: install .PHONY: install
install: all install:
install -d $(DESTDIR)$(LIBEXECDIR) install -d $(DESTDIR)$(LIBEXECDIR)
for bin in $(SCRIPTS); do \ for bin in $(SCRIPTS); do \
install -m755 $$bin $(DESTDIR)$(LIBEXECDIR); \ install -m755 $$bin $(DESTDIR)$(LIBEXECDIR); \
@ -50,10 +42,10 @@ uninstall:
done done
$(MOUNT_BIN): $(MOUNT_BIN):
$(CC) $(WFLAGS) $(LDFLAGS) mount.c -o $@ $(CC) $(WFLAGS) mount.c $(LDFLAGS) -o $@
$(UMOUNT_BIN): $(UMOUNT_BIN):
$(CC) $(WFLAGS) $(LDFLAGS) umount.c -o $@ $(CC) $(WFLAGS) umount.c $(LDFLAGS) -o $@
$(CHROOT_BIN): $(CHROOT_BIN):
$(CC) $(WFLAGS) $(LDFLAGS) chroot.c -o $@ $(CC) $(WFLAGS) chroot.c $(LDFLAGS) -o $@

View File

@ -1,16 +1,5 @@
include ../vars.mk include ../vars.mk
SCRIPTS = chroot.sh pkgtarget_funcs.sh
.PHONY: all
all:
for f in $(SCRIPTS); do \
sed -e "s|@@XBPS_INSTALL_PREFIX@@|$(PREFIX)|g" \
-e "s|@@XBPS_INSTALL_SHAREDIR@@|$(SHAREDIR)|g" \
-e "s|@@XBPS_INSTALL_LIBEXECDIR@@|$(LIBEXECDIR)|g" \
$$f.in > $$f; \
done
.PHONY: clean .PHONY: clean
clean: clean:
-rm -f $(SCRIPTS) -rm -f $(SCRIPTS)

View File

@ -28,7 +28,7 @@ _mount()
MASTERDIR="${XBPS_MASTERDIR}" DISTRIBUTIONDIR="${XBPS_DISTRIBUTIONDIR}" \ MASTERDIR="${XBPS_MASTERDIR}" DISTRIBUTIONDIR="${XBPS_DISTRIBUTIONDIR}" \
HOSTDIR="${XBPS_HOSTDIR}" XBPS_ETCDIR="${XBPS_ETCDIR}" \ HOSTDIR="${XBPS_HOSTDIR}" XBPS_ETCDIR="${XBPS_ETCDIR}" \
XBPS_SHAREDIR="${XBPS_SHAREDIR}" ${SUDO_CMD} \ XBPS_SHAREDIR="${XBPS_SHAREDIR}" ${SUDO_CMD} \
${XBPS_LIBEXECDIR}/chroot-helper mount ${XBPS_LIBEXECDIR}/chroot-helper.sh mount
return $? return $?
} }
@ -37,7 +37,7 @@ _umount()
MASTERDIR="${XBPS_MASTERDIR}" DISTRIBUTIONDIR="${XBPS_DISTRIBUTIONDIR}" \ MASTERDIR="${XBPS_MASTERDIR}" DISTRIBUTIONDIR="${XBPS_DISTRIBUTIONDIR}" \
HOSTDIR="${XBPS_HOSTDIR}" XBPS_ETCDIR="${XBPS_ETCDIR}" \ HOSTDIR="${XBPS_HOSTDIR}" XBPS_ETCDIR="${XBPS_ETCDIR}" \
XBPS_SHAREDIR="${XBPS_SHAREDIR}" ${SUDO_CMD} \ XBPS_SHAREDIR="${XBPS_SHAREDIR}" ${SUDO_CMD} \
${XBPS_LIBEXECDIR}/chroot-helper umount ${XBPS_LIBEXECDIR}/chroot-helper.sh umount
return $? return $?
} }

View File

@ -135,7 +135,7 @@ install_pkg()
BOOTSTRAP_PKG_REBUILD=$BOOTSTRAP_PKG_REBUILD \ BOOTSTRAP_PKG_REBUILD=$BOOTSTRAP_PKG_REBUILD \
CONFIG_FILE=${XBPS_CONFIG_FILE} \ CONFIG_FILE=${XBPS_CONFIG_FILE} \
${FAKEROOT_CMD} ${FAKEROOT_CMD_ARGS} \ ${FAKEROOT_CMD} ${FAKEROOT_CMD_ARGS} \
${XBPS_LIBEXECDIR}/doinst-helper ${curpkgn} \ ${XBPS_LIBEXECDIR}/doinst-helper.sh ${curpkgn} \
|| return $? || return $?
# Strip binaries/libraries. # Strip binaries/libraries.

View File

@ -6,5 +6,5 @@ SBINDIR ?= $(DESTDIR)$(PREFIX)/sbin
# The following vars shouldn't be specified with DESTDIR! # The following vars shouldn't be specified with DESTDIR!
# #
SHAREDIR ?= $(PREFIX)/share/xbps-src SHAREDIR ?= $(PREFIX)/share/xbps-src
LIBEXECDIR ?= $(PREFIX)/libexec LIBEXECDIR ?= $(PREFIX)/libexec/xbps-src
ETCDIR ?= $(PREFIX)/etc ETCDIR ?= $(PREFIX)/etc