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
BINDIR ?= $(PREFIX)/bin
SYSCONFDIR := $(PREFIX)/etc
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
ifeq ($(BINDIR),)
BINDIR := $(PREFIX)/bin
endif
ifeq ($(SYSCONFDIR),)
SYSCONFDIR := $(PREFIX)/etc
endif
ifeq ($(GO),)
GO := $(shell type -a -P go | head -n 1)
endif
# Compilers and tools
GO ?= $(shell which go)
build:
mkdir -p build
cd src/bpm; $(GO) build -ldflags "-w" -o ../../build/bpm git.enumerated.dev/bubble-package-manager/bpm/src/bpm
install: build/bpm config/
mkdir -p $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(SYSCONFDIR)
cp build/bpm $(DESTDIR)$(BINDIR)/bpm
cp config/bpm.conf $(DESTDIR)$(SYSCONFDIR)/bpm.conf
# Create directories
install -dm755 $(DESTDIR)$(BINDIR)
install -dm755 $(DESTDIR)$(SYSCONFDIR)
# Install files
install -Dm755 build/bpm $(DESTDIR)$(BINDIR)/bpm
install -Dm644 config/bpm.conf $(DESTDIR)$(SYSCONFDIR)/bpm.conf
compress: build/bpm config/
mkdir -p bpm/$(BINDIR)
mkdir -p bpm/$(SYSCONFDIR)
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
uninstall:
rm $(DESTDIR)$(BINDIR)/bpm
rm $(DESTDIR)$(SYSCONFDIR)/bpm.conf
clean:
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 `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
```
- 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
```
@ -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
```
```sh
bpm help
```