Commit abe30c68 authored by Stefan Göbel's avatar Stefan Göbel

Changes to the build/installation process

parent 3e051f6c
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
DOCDIR ?= $(PREFIX)/share/doc
MANDIR ?= $(PREFIX)/share/man
all-docs: htmldocs manpages
htmldocs: $(addsuffix .html, $(basename $(wildcard doc/*.ronn)))
manpages: $(basename $(wildcard doc/*.ronn))
doc/%.html: doc/%.ronn
ronn --html '$<'
doc/%: doc/%.ronn
ronn --roff '$<'
clean:
rm -f doc/mbs.1
rm -f doc/mbs.1.html
install: all-docs
install -d '$(DESTDIR)$(BINDIR)'
install -t '$(DESTDIR)$(BINDIR)' -m 755 mbs
install -d '$(DESTDIR)$(MANDIR)/man1'
install -t '$(DESTDIR)$(MANDIR)/man1' -m 644 doc/mbs.1
install -d '$(DESTDIR)$(DOCDIR)/modular-bash-scripts'
install -t '$(DESTDIR)$(DOCDIR)/modular-bash-scripts' -m 644 README
install -t '$(DESTDIR)$(DOCDIR)/modular-bash-scripts' -m 644 doc/mbs.1.html
install -t '$(DESTDIR)$(DOCDIR)/modular-bash-scripts' -m 644 doc/mbs.1.ronn
cp -av example '$(DESTDIR)$(DOCDIR)/modular-bash-scripts'
uninstall:
rm -f '$(BINDIR)/mbs'
rm -f '$(MANDIR)/man1/mbs.1'
rm -rf '$(DOCDIR)/modular-bash-scripts/'
.PHONY: all-docs clean htmldocs install manpages uninstall
# :indentSize=3:tabSize=3:noTabs=false:mode=makefile:maxLineLen=78:
# Maintainer: Stefan Göbel - < m b s ʇɐ s u b t y p e ˙ d e >
pkgname='modular-bash-scripts'
pkgver='2018081902'
pkgver='2019021801'
pkgrel='1'
arch=( 'any' )
pkgdesc='Split complex Bash scripts in multiple modules.'
url='https://gitlab.com/goeb/modular-bash-scripts/'
license=( 'GPL3' )
arch=( 'any' )
makedepends=( 'ruby-ronn' )
package() {
_pkgbuild_dir=${_pkgbuild_dir:-$PWD}
_source_files=(
'doc'
'example'
'LICENSE'
'Makefile'
'mbs'
'PKGBUILD'
'README'
)
prepare() {
local _dest="$srcdir/$pkgname"
local _file=''
mkdir -p "$_dest"
cd "$pkgdir"
for _file in "${_source_files[@]}" ; do
cp -avx "$_pkgbuild_dir/$_file" "$_dest/"
done
mkdir -p "$pkgdir/usr/bin"
cp -av ../../../mbs "$pkgdir/usr/bin/mbs"
cd "$_dest"
make clean
mkdir -p "$pkgdir/usr/share/doc/modular-bash-scripts"
cp -av ../../../example "$pkgdir/usr/share/doc/modular-bash-scripts"
cp -av ../../../man/mbs.1.html "$pkgdir/usr/share/doc/modular-bash-scripts"
cp -av ../../../man/mbs.1.ronn "$pkgdir/usr/share/doc/modular-bash-scripts"
}
build() {
cd "$srcdir/$pkgname"
make
}
package() {
mkdir -p "$pkgdir/usr/share/man/man1"
cp -av ../../../man/mbs.1 "$pkgdir/usr/share/man/man1"
cd "$srcdir/$pkgname"
make install DESTDIR="$pkgdir" PREFIX='/usr'
}
......
......@@ -30,11 +30,18 @@ Installation
================================================================================
For Arch Linux (and derivatives): to create a package from the local sources,
check the pkgbuild directory.
a PKGBUILD is included, just run `makepkg` in the project's root directory.
Just put the `mbs` script somewhere in your PATH, e.g. `/usr/local/bin/`. If
required, copy the man page (`man/mbs.1`) to `/usr/local/man/man1/`. The man
page is also available in HTML format.
For other distributions, use the Makefile as usual:
make
make install
This will install the script and documentation to /usr/local, the destination
may be changed by setting the PREFIX accordingly.
Note: The `ronn` command is required to generate the man page and the HTML
documentation. On Arch Linux, it is available in the `ruby-ronn` package.
Requirements
......@@ -49,7 +56,7 @@ required (these should be available on every Linux system by default):
Copyright And License
================================================================================
Copyright 2016-2018 Stefan Goebel - < m b s @ s u b t y p e . d e >
Copyright 2016-2019 Stefan Goebel - < m b s @ s u b t y p e . d e >
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......
......@@ -744,9 +744,19 @@ User modules may introduce additional requirements.
- Fixed the fix from the previous version.
### 2019/02/18
* Version 2019021801.
- Added Makefile and moved PKGBUILD to project root.
- HTML documentation and man page are no longer included and will
be built from source when `make` is run.
- Renamed `man` directory to `doc`.
- (No changes to the `mbs` script itself.)
## LICENSE
Copyright 2016-2018 Stefan Goebel.
Copyright 2016-2019 Stefan Goebel.
`mbs` is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
......
This diff is collapsed.
This diff is collapsed.
This PKGBUILD may be used to build the modular-bash-scripts package from
the LOCAL (!) sources. Just enter the pkgbuild directory and run makepkg:
cd modular-bash-scripts/pkgbuild
makepkg -Cc
The package will be placed in the pkgbuild directory unless overridden by
the makepkg configuration.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment