Compare commits

...

2 Commits

Author SHA1 Message Date
Vincent Riquer
7ffbedfebd Merge branch '7-provide-a-proper-way-to-install' into 'master'
Resolve "Provide a proper way to install"

Closes #7

See merge request atom/AtOM!14
2025-02-09 02:25:16 +00:00
Vincent Riquer
a4c293c2f3 Add ./configure and Makefile 2025-02-09 02:25:15 +00:00
11 changed files with 78 additions and 24 deletions

19
Makefile Normal file
View File

@ -0,0 +1,19 @@
include Makefile.in
all: atom #$(wildcard toys/*) $(wildcard lib/*/*)
mkdir work
cp -r atom toys work
sed -i 's:%LIBDIR%:'$(libdir)':;s:%SHAREDIR%:'$(sharedir)':;s:%DOCDIR%:'$(docdir)':' work/atom work/toys/*
install:
install -m 644 -D -t $(docdir) doc/*
install -m 644 -D README.md $(docdir)/README.md
install -m 644 -D work/toys/README $(docdir)/README.toys
rm work/toys/README
install -m 644 -D -t $(sharedir) share/*
install -d $(libdir)
cp -dpr --no-preserve=ownership lib/* $(libdir)
install -D -t $(bindir) work/atom work/toys/*
clean:
rm -Rf work

View File

@ -61,6 +61,13 @@ Here's what I have for my tests:
## Using the software
### Installation
1. Clone the repository: `git clone https://framagit.org/atom/AtOM.git`
2. run `./configure && make && sudo make install`
`./configure` takes an optional prefix: `./configure --prefix=/usr`. Defaults to /usr/local.
### Configuration:
On first run, AtOM will ask a set of questions to help you create a
configuration file.

6
atom
View File

@ -37,9 +37,9 @@ declare -A \
}
declare -r \
DOCDIR=./doc \
LIBDIR=./lib \
SHAREDIR=./share
DOCDIR=%DOCDIR% \
LIBDIR=%LIBDIR% \
SHAREDIR=%SHAREDIR%
declare -r \
exampleconf=$DOCDIR/example.cfg \
schema=$SHAREDIR/schema.sql \

28
configure vendored Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env bash
# defaults
default_prefix=/usr/local
#default_bindir=$default_prefix/bin
#default_libdir=$default_prefix/lib
#default_sharedir=$default_prefix/share
while (( $# ))
do
case "$1" in
--prefix=*) prefix="${1#*=}"
;;
esac
shift
done
bindir="${prefix:-$default_prefix}"/bin
libdir="${prefix:-$default_prefix}"/lib/AtOM
sharedir="${prefix:-$default_prefix}"/share/AtOM
docdir="${prefix:-$default_prefix}"/share/doc/AtOM
cat > Makefile.in <<-EOMakefile.in
bindir = "$bindir"
libdir = "$libdir"
sharedir = "$sharedir"
docdir = "$docdir"
EOMakefile.in

View File

@ -23,9 +23,9 @@ declare -A \
}
declare -r \
DOCDIR=./doc \
LIBDIR=./lib \
SHAREDIR=./share
DOCDIR=%DOCDIR% \
LIBDIR=%LIBDIR% \
SHAREDIR=%SHAREDIR%
declare -r \
exampleconf=$DOCDIR/example.cfg \
schema=$SHAREDIR/schema.sql \

View File

@ -23,9 +23,9 @@ declare -A \
}
declare -r \
DOCDIR=./doc \
LIBDIR=./lib \
SHAREDIR=./share
DOCDIR=%DOCDIR% \
LIBDIR=%LIBDIR% \
SHAREDIR=%SHAREDIR%
declare -r \
exampleconf=$DOCDIR/example.cfg \
schema=$SHAREDIR/schema.sql \

View File

@ -23,9 +23,9 @@ declare -A \
}
declare -r \
DOCDIR=./doc \
LIBDIR=./lib \
SHAREDIR=./share
DOCDIR=%DOCDIR% \
LIBDIR=%LIBDIR% \
SHAREDIR=%SHAREDIR%
declare -r \
exampleconf=$DOCDIR/example.cfg \
schema=$SHAREDIR/schema.sql \

View File

@ -23,9 +23,9 @@ declare -A \
}
declare -r \
DOCDIR=./doc \
LIBDIR=./lib \
SHAREDIR=./share
DOCDIR=%DOCDIR% \
LIBDIR=%LIBDIR% \
SHAREDIR=%SHAREDIR%
declare -r \
exampleconf=$DOCDIR/example.cfg \
schema=$SHAREDIR/schema.sql \

View File

@ -25,9 +25,9 @@ declare -A \
}
declare -r \
DOCDIR=./doc \
LIBDIR=./lib \
SHAREDIR=./share
DOCDIR=%DOCDIR% \
LIBDIR=%LIBDIR% \
SHAREDIR=%SHAREDIR%
declare -r \
exampleconf=$DOCDIR/example.cfg \
schema=$SHAREDIR/schema.sql \

View File

@ -23,9 +23,9 @@ declare -A \
}
declare -r \
DOCDIR=./doc \
LIBDIR=./lib \
SHAREDIR=./share
DOCDIR=%DOCDIR% \
LIBDIR=%LIBDIR% \
SHAREDIR=%SHAREDIR%
declare -r \
exampleconf=$DOCDIR/example.cfg \
schema=$SHAREDIR/schema.sql \

View File

@ -24,9 +24,9 @@ declare -A \
}
declare -r \
DOCDIR=./doc \
LIBDIR=./lib \
SHAREDIR=./share
DOCDIR=%DOCDIR% \
LIBDIR=%LIBDIR% \
SHAREDIR=%SHAREDIR%
declare -r \
exampleconf=$DOCDIR/example.cfg \
schema=$SHAREDIR/schema.sql \