Skip to content

Commit

Permalink
Merge pull request #8 from Z5T1/z5t1-makefile
Browse files Browse the repository at this point in the history
Refactor Makefile to use /usr/local & standard variables
  • Loading branch information
Z5T1 authored May 22, 2023
2 parents 5a14e16 + e0596f4 commit ca30bd4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
DESTDIR=/opt/isidore
BINDIR=$(DESTDIR)/bin
DOCDIR=$(DESTDIR)/share/doc/isidore
DESTDIR=
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
DOCDIR=$(PREFIX)/share/doc/isidore

.PHONY: install install-bin install-doc all clean

Expand All @@ -13,13 +14,13 @@ clean:
install: install-bin install-doc install-lib

install-bin:
mkdir -p "$(BINDIR)"
cp -r bin/* "$(BINDIR)/"
mkdir -p "$(DESTDIR)$(BINDIR)"
cp -r bin/* "$(DESTDIR)$(BINDIR)/"

install-lib:
$(MAKE) -C lib install

install-doc:
mkdir -p "$(DOCDIR)"
cp -r doc/* "$(DOCDIR)/"
mkdir -p "$(DESTDIR)$(DOCDIR)"
cp -r doc/* "$(DESTDIR)$(DOCDIR)/"

10 changes: 5 additions & 5 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ care to change the specified values as necessary.
1. Your MariaDB/MySQL server is `localhost`.
2. The database you wish to use will be named `isidore`.
3. The user you wish to use to access the database will be named `isidore`.
4. You are installing to `/opt/isidore`.
4. You are installing to `/usr/local`.

Installation
------------
Expand All @@ -46,9 +46,9 @@ Install the binaries and associated documentation.

#### Installation Directory

Isidore uses a non-standard directory structure, so by default it installs to
`/opt/isidore`. This directory can be changed by setting the `DESTDIR` variable
via either the environment or an additional argument to the `make` command.
By default Isidore installs to `/usr/local`. This directory can be changed by
setting the `PREFIX` variable via either the environment or an additional
argument to the `make` command.

#### Perform the Installation

Expand Down Expand Up @@ -115,5 +115,5 @@ field under the `[database]` section to match the password you set in step 2.
You're now ready to start using Isidore. Start the Isidore command prompt using
the following command:

/opt/isidore/bin/isidore
/usr/local/bin/isidore

8 changes: 4 additions & 4 deletions doc/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,19 @@ a format as the second argument like so:

There is also an `inventory` Python script provided with the Isidore
installation. It resides in your Isidore binary directory (by default
/opt/isidore/bin). To print the inventory this way, run:
/usr/local/bin). To print the inventory this way, run:

solo@han:~$ /opt/isidore/bin/inventory
solo@han:~$ /usr/local/bin/inventory

This script is also suitable for use as an Ansible inventory source. For
example, the following can be used to run the site.yml playbook on the Isidore
inventory:

solo@han:ansible$ ansible-playbook site.yml -i /opt/isidore/bin/inventory
solo@han:ansible$ ansible-playbook site.yml -i /usr/local/bin/inventory

Or to just list the contents of the inventory:

solo@han:ansible$ ansible-inventory -i /opt/isidore/bin/inventory --list
solo@han:ansible$ ansible-inventory -i /usr/local/bin/inventory --list

## 4. Printing the Isidore Configuration

Expand Down

0 comments on commit ca30bd4

Please sign in to comment.