From a4c293c2f34ed44f48ac2a6b8076ae835b2ad992 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Sun, 9 Feb 2025 02:25:15 +0000 Subject: [PATCH] Add `./configure` and `Makefile` --- Makefile | 19 +++++++++++++++++++ README.md | 7 +++++++ atom | 6 +++--- configure | 28 ++++++++++++++++++++++++++++ toys/checkextensions | 6 +++--- toys/checkgenre | 6 +++--- toys/checkmissing | 6 +++--- toys/cleandestinations | 6 +++--- toys/createindex | 6 +++--- toys/lowquality | 6 +++--- toys/missingtags | 6 +++--- 11 files changed, 78 insertions(+), 24 deletions(-) create mode 100644 Makefile create mode 100755 configure diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a371212 --- /dev/null +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 89f82a6..30e9278 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/atom b/atom index ee00357..425d056 100755 --- a/atom +++ b/atom @@ -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 \ diff --git a/configure b/configure new file mode 100755 index 0000000..7e3d395 --- /dev/null +++ b/configure @@ -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 diff --git a/toys/checkextensions b/toys/checkextensions index 0783b98..6d69a12 100755 --- a/toys/checkextensions +++ b/toys/checkextensions @@ -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 \ diff --git a/toys/checkgenre b/toys/checkgenre index e2b55d4..2cf7977 100755 --- a/toys/checkgenre +++ b/toys/checkgenre @@ -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 \ diff --git a/toys/checkmissing b/toys/checkmissing index b56ba51..14a35e9 100755 --- a/toys/checkmissing +++ b/toys/checkmissing @@ -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 \ diff --git a/toys/cleandestinations b/toys/cleandestinations index 0b85453..5bdf8a6 100755 --- a/toys/cleandestinations +++ b/toys/cleandestinations @@ -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 \ diff --git a/toys/createindex b/toys/createindex index 139f9dd..b69d8c6 100755 --- a/toys/createindex +++ b/toys/createindex @@ -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 \ diff --git a/toys/lowquality b/toys/lowquality index 8ba3dd3..c3cfa8f 100755 --- a/toys/lowquality +++ b/toys/lowquality @@ -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 \ diff --git a/toys/missingtags b/toys/missingtags index 1fa2efc..a1999cc 100755 --- a/toys/missingtags +++ b/toys/missingtags @@ -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 \