Compare commits

...

3 Commits

2 changed files with 20 additions and 31 deletions

View File

@ -1,38 +1,26 @@
SHELL = /bin/bash # Installation paths
PREFIX ?= /usr/local
ifeq ($(PREFIX),) BINDIR ?= $(PREFIX)/bin
PREFIX := /usr/local
endif
ifeq ($(BINDIR),)
BINDIR := $(PREFIX)/bin
endif
ifeq ($(SYSCONFDIR),)
SYSCONFDIR := $(PREFIX)/etc SYSCONFDIR := $(PREFIX)/etc
endif
ifeq ($(GO),) # Compilers and tools
GO := $(shell type -a -P go | head -n 1) GO ?= $(shell which go)
endif
build: build:
mkdir -p build mkdir -p build
cd src/bpm; $(GO) build -ldflags "-w" -o ../../build/bpm git.enumerated.dev/bubble-package-manager/bpm/src/bpm cd src/bpm; $(GO) build -ldflags "-w" -o ../../build/bpm git.enumerated.dev/bubble-package-manager/bpm/src/bpm
install: build/bpm config/ install: build/bpm config/
mkdir -p $(DESTDIR)$(BINDIR) # Create directories
mkdir -p $(DESTDIR)$(SYSCONFDIR) install -dm755 $(DESTDIR)$(BINDIR)
cp build/bpm $(DESTDIR)$(BINDIR)/bpm install -dm755 $(DESTDIR)$(SYSCONFDIR)
cp config/bpm.conf $(DESTDIR)$(SYSCONFDIR)/bpm.conf # Install files
install -Dm755 build/bpm $(DESTDIR)$(BINDIR)/bpm
install -Dm644 config/bpm.conf $(DESTDIR)$(SYSCONFDIR)/bpm.conf
compress: build/bpm config/ uninstall:
mkdir -p bpm/$(BINDIR) rm $(DESTDIR)$(BINDIR)/bpm
mkdir -p bpm/$(SYSCONFDIR) rm $(DESTDIR)$(SYSCONFDIR)/bpm.conf
cp build/bpm bpm/$(BINDIR)/bpm
cp config/bpm.conf bpm/$(SYSCONFDIR)/bpm.conf
tar --owner=root --group=root -czf bpm.tar.gz bpm
rm -r bpm
run: build/bpm
build/bpm
clean: clean:
rm -r build/ rm -r build/

View File

@ -14,12 +14,13 @@ BPM is still in very early development. Do not install it without knowing what y
- Download `go` from your package manager or from the go website - Download `go` from your package manager or from the go website
- Download `make` from your package manager - Download `make` from your package manager
- Run the following command to compile the project - Download `which` from your package manager
``` - Run the following command to compile the project. You may need to set the `GO` environment variable if your Go installation is not in your PATH
```sh
make make
``` ```
- Run the following command to install BPM into your system. You may also append a DESTDIR variable at the end of this line if you wish to install in a different location - Run the following command to install BPM into your system. You may also append a DESTDIR variable at the end of this line if you wish to install in a different location
``` ```sh
make install PREFIX=/usr SYSCONFDIR=/etc make install PREFIX=/usr SYSCONFDIR=/etc
``` ```
@ -55,7 +56,7 @@ bpm update
``` ```
For information on the rest of the commands simply use the help command or pass in no arguments at all For information on the rest of the commands simply use the help command or pass in no arguments at all
``` ```sh
bpm help bpm help
``` ```