summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorphyskets2019-03-02 21:15:14 +0530
committerphyskets2019-03-02 21:15:14 +0530
commite425ce1a9c6846570f2e64d5c5d0b8692c9abfae (patch)
tree74640709ff4bc63a2f9d31bda96e63196c855f5c
parent90ce426f9a1562e4c4f22555e6392f4342aa6fa1 (diff)
downloadaur-e425ce1a9c6846570f2e64d5c5d0b8692c9abfae.tar.gz
integrate Doc generation
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD55
2 files changed, 50 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ecda83b36170..62421f4cda51 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,19 @@
pkgbase = lammps-beta
pkgdesc = Large-scale Atomic/Molecular Massively Parallel Simulator.
pkgver = 20190228
- pkgrel = 2
+ pkgrel = 3
url = http://lammps.sandia.gov/
arch = x86_64
license = GPL
+ makedepends = cmake
+ makedepends = python-sphinx
+ makedepends = lammpsdoc
depends = fftw
depends = openmpi
optdepends = kim-api: support for OpenKIM potentials
- optdepends = python-virtualenv: build documentation
provides = lammps
conflicts = lammps
- source = https://github.com/lammps/lammps/archive/patch_28Feb2019.tar.gz
+ source = lammps-28Feb2019.tar.gz::https://github.com/lammps/lammps/archive/patch_28Feb2019.tar.gz
sha512sums = dc264ec43a5a917a0a7905f89076c2e10e8d5613bb710fb970eb388721860d7d409db7d988803bde823ddd74691c4b3bdf5bf4a72713476dad5a4b0833a4dbd0
pkgname = lammps-beta
diff --git a/PKGBUILD b/PKGBUILD
index 09a6f4448221..67a0c99cf68e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,35 +2,70 @@
# Contributor: xpt <user.xpt@gmail.com>
_pkgname=lammps
pkgname=${_pkgname}-beta
-_pkgver=28Feb2019
pkgver=20190228
-pkgrel=2
+_pkgver=$(date -d ${pkgver} +%-d%b%Y)
+pkgrel=3
pkgdesc="Large-scale Atomic/Molecular Massively Parallel Simulator."
url="http://lammps.sandia.gov/"
arch=('x86_64')
license=('GPL')
depends=('fftw' 'openmpi')
-optdepends=('kim-api: support for OpenKIM potentials'
- 'python-virtualenv: build documentation')
+makedepends=('cmake' 'python-sphinx' 'lammpsdoc')
+optdepends=('kim-api: support for OpenKIM potentials')
conflicts=('lammps')
provides=('lammps')
-source=(https://github.com/${_pkgname}/${_pkgname}/archive/patch_${_pkgver}.tar.gz)
+source=("${_pkgname}-${_pkgver}.tar.gz::https://github.com/${_pkgname}/${_pkgname}/archive/patch_${_pkgver}.tar.gz")
sha512sums=('dc264ec43a5a917a0a7905f89076c2e10e8d5613bb710fb970eb388721860d7d409db7d988803bde823ddd74691c4b3bdf5bf4a72713476dad5a4b0833a4dbd0')
-build() {
+
+prepare(){
cd "${_pkgname}-patch_${_pkgver}"
- mkdir -p build; cd build
+ mkdir -p build
+}
+
+build() {
+ cd "${_pkgname}-patch_${_pkgver}/build"
cmake ../cmake \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_INSTALL_LIBDIR="lib" \
-DCMAKE_INSTALL_LIBEXECDIR="/usr/lib" #\
- #-DBUILD_DOC=yes #\
#-DPKG_KIM=yes # KIM package
# Add options for additional packages
#-DPKG_<NAME>=yes
+
make
+
+ # The rest of this script generates the documentation
+ # If you don't want that, comment out the rest of this build() section
+ # as well as the 'install' line in package()
+ # Also remove 'python-sphinx' & 'lammpsdoc' from makedepends()
+
+ # Generate ReStructuredText from Text files
+ mkdir -p rst
+
+ for file in ../doc/src/*.txt
+ do
+ tmp=${file%.*} # Strips the '.txt' extension
+ fname=${tmp##*/} # Strips the path prefixing the file-name
+ txt2rst ${file} > "rst/${fname}.rst"
+ done
+
+ # Generate HTML from ReStructuredText files
+ mkdir -p html
+ cp -r ../doc/src/* rst/
+
+ sphinx-build -b html -c "../doc/utils/sphinx-config" -d "doctrees" "rst" html
}
package() {
cd "${_pkgname}-patch_${_pkgver}/build"
- make DESTDIR="$pkgdir" install
-}
+ make DESTDIR="${pkgdir}" install
+ install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html" "html/"*.html
+ install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html" "html/"*.js
+ install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html/_images" "html/_images/"*
+ install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html/_static" "html/_static/"*.png
+ install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html/_static" "html/_static/"*.gif
+ install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html/_static" "html/_static/"*.js
+ install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html/_static/css" "html/_static/css/"*.css
+ install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html/_static/fonts" "html/_static/fonts/"*
+ install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html/_static/js" "html/_static/js/"*.js
+} \ No newline at end of file