Install by default xbps.conf into $(PREFIX)/etc and use it.
--HG-- extra : convert_revision : d6550a3d9e6093cb1ec789715e2b1107b9bb59bd
This commit is contained in:
parent
001de5eb1a
commit
c86be9931b
2
Makefile
2
Makefile
|
@ -1,6 +1,6 @@
|
||||||
include vars.mk
|
include vars.mk
|
||||||
|
|
||||||
SUBDIRS = lib bin
|
SUBDIRS = lib bin etc
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all:
|
all:
|
||||||
|
|
|
@ -5,14 +5,14 @@ BIN = xbps-src
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all:
|
all:
|
||||||
sed -e "s|@@XBPS_INSTALL_PREFIX@@|$(PREFIX)|g" main.sh > xbps-src
|
sed -e "s|@@XBPS_INSTALL_PREFIX@@|$(PREFIX)|g" \
|
||||||
|
-e "s|@@XBPS_INSTALL_ETCDIR@@|$(ETCDIR)|g" \
|
||||||
|
main.sh > xbps-src
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean: clean-bins
|
clean:
|
||||||
|
|
||||||
clean-bins:
|
|
||||||
-rm -f $(BIN)
|
-rm -f $(BIN)
|
||||||
|
|
||||||
install: $(BIN)
|
install: all
|
||||||
install -d $(SBINDIR)
|
install -d $(SBINDIR)
|
||||||
install -m 755 $(BIN) $(SBINDIR)
|
install -m 755 $(BIN) $(SBINDIR)
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#-
|
#-
|
||||||
trap "echo && exit 1" INT QUIT
|
trap "echo && exit 1" INT QUIT
|
||||||
|
|
||||||
: ${XBPS_CONFIG_FILE:=/etc/xbps.conf}
|
: ${XBPS_CONFIG_FILE:=@@XBPS_INSTALL_ETCDIR@@/xbps.conf}
|
||||||
|
|
||||||
: ${progname:=$(basename $0)}
|
: ${progname:=$(basename $0)}
|
||||||
: ${fakeroot_cmd:=fakeroot}
|
: ${fakeroot_cmd:=fakeroot}
|
||||||
|
@ -67,7 +67,7 @@ Targets:
|
||||||
Options:
|
Options:
|
||||||
-C Do not remove build directory after successful installation.
|
-C Do not remove build directory after successful installation.
|
||||||
-c Path to global configuration file:
|
-c Path to global configuration file:
|
||||||
if not specified /etc/xbps.conf is used.
|
if not specified @@XBPS_INSTALL_ETCDIR@@/xbps.conf is used.
|
||||||
_EOF
|
_EOF
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,8 +63,8 @@ your $HOME.
|
||||||
|
|
||||||
If configuration file is not specified from the command line with the
|
If configuration file is not specified from the command line with the
|
||||||
-c flag, it will first try to use the default location at
|
-c flag, it will first try to use the default location at
|
||||||
/etc/xbps.conf, and as last resort in the etc directory of the current
|
/usr/local/etc/xbps.conf, and as last resort in the etc directory of the
|
||||||
directory.
|
current directory.
|
||||||
|
|
||||||
To avoid problems with libtool and configure scripts finding stuff that is
|
To avoid problems with libtool and configure scripts finding stuff that is
|
||||||
available in the host system, almost all packages must be built inside of a
|
available in the host system, almost all packages must be built inside of a
|
||||||
|
|
18
etc/Makefile
Normal file
18
etc/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
include ../vars.mk
|
||||||
|
|
||||||
|
CONF_FILE = xbps.conf
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all:
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
|
||||||
|
install:
|
||||||
|
if [ ! -d $(ETCDIR) ]; then \
|
||||||
|
install -d $(ETCDIR); \
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $(ETCDIR)/$(CONF_FILE) ]; then \
|
||||||
|
install -m 644 $(CONF_FILE) $(ETCDIR); \
|
||||||
|
fi
|
1
vars.mk
1
vars.mk
|
@ -3,6 +3,7 @@
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
SBINDIR ?= $(PREFIX)/sbin
|
SBINDIR ?= $(PREFIX)/sbin
|
||||||
LIBDIR ?= $(PREFIX)/lib
|
LIBDIR ?= $(PREFIX)/lib
|
||||||
|
ETCDIR ?= $(PREFIX)/etc
|
||||||
TOPDIR ?= ..
|
TOPDIR ?= ..
|
||||||
|
|
||||||
LDFLAGS += -L$(TOPDIR)/lib -L$(PREFIX)/lib -lxbps
|
LDFLAGS += -L$(TOPDIR)/lib -L$(PREFIX)/lib -lxbps
|
||||||
|
|
Loading…
Reference in a new issue