From 99a6b26d213c6b2633e2cfcf4add8b1154d53791 Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Wed, 9 Sep 2020 04:06:49 +0300 Subject: [PATCH] Add packaging; Add Arch Linux build scripts --- README.md | 7 +-- packaging/linux/arch/PKGBUILD | 53 +++++++++++++++++++++++ packaging/linux/arch/bookstore-tomcat.xml | 4 ++ 3 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 packaging/linux/arch/PKGBUILD create mode 100644 packaging/linux/arch/bookstore-tomcat.xml diff --git a/README.md b/README.md index 4eb7639..32084d5 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,10 @@ ## Repository structure -| **Type** | **Name** | **Description** | -|----------|-------------------------|---------------------| -| `Folder` | [bookstore](bookstore) | Main project folder | +| **Type** | **Name** | **Description** | +|----------|-------------------------|---------------------------| +| `Folder` | [bookstore](bookstore) | Main project folder | +| `Folder` | [packaging](packaging) | OS-specific build scripts | ### Recommendations diff --git a/packaging/linux/arch/PKGBUILD b/packaging/linux/arch/PKGBUILD new file mode 100644 index 0000000..121ad26 --- /dev/null +++ b/packaging/linux/arch/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer: Pekka Helenius + +pkgname=bookstore-project +packagetype=war + +packagename=Bookstore.${packagetype} +tomcat_ver=9 +java_ver=8 + +pkgver=7.2af07c8 +pkgrel=1 +pkgdesc='Bookstore Java server example project' +arch=('any') +url='https://github.com/Fincer/java-bookstore' +license=('GPL') +depends=( + "tomcat${tomcat_ver}" + "mariadb" + "java-runtime>=${java_ver}" +) +makedepends=('maven' 'git') +source=( + "$pkgname::git+${url}.git" + "bookstore-tomcat.xml" +) +sha256sums=('SKIP' + '6a115dc9132cd04f5b740575612d6aeb744db8620e8249776dad8222ca917cbf') + +pkgver() { + cd $pkgname + + if [[ $(git describe) ]]; then + git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' + else + echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD) + fi + +} + +#prepare() { +# cd $pkgname +#} + +build() { + cd $pkgname/bookstore + mvn package +} + +package() { + cd $pkgname/bookstore + install -Dm0644 -t ${pkgdir}/opt/bookstore/ target/${packagename} + install -Dm0644 ../../bookstore-tomcat.xml ${pkgdir}/etc/tomcat${tomcat_ver}/Catalina/localhost/bookstore.xml +} diff --git a/packaging/linux/arch/bookstore-tomcat.xml b/packaging/linux/arch/bookstore-tomcat.xml new file mode 100644 index 0000000..83ddc34 --- /dev/null +++ b/packaging/linux/arch/bookstore-tomcat.xml @@ -0,0 +1,4 @@ +