Username: Password: Remember me
# Maintainer: not3 <not3.won@gmail.com>
 
pkgname=artifactory
pkgver=3.4.0
pkgrel=1
pkgdesc="The world's most advanced repository manager"
arch=(any)
url='http://www.jfrog.com/open-source/'
license=(LGPL)
depends=(bash java-environment)
options=(emptydirs)
install=$pkgname.install
backup=(etc/artifactory/artifactory.config.xml
        etc/artifactory/artifactory.system.properties
        etc/artifactory/logback.xml
        etc/security/limits.d/artifactory.limits.conf
        usr/lib/artifactory/tomcat/conf/Catalina/localhost/artifactory.xml
        usr/lib/artifactory/tomcat/conf/catalina.policy
        usr/lib/artifactory/tomcat/conf/catalina.properties
        usr/lib/artifactory/tomcat/conf/logging.properties
        usr/lib/artifactory/tomcat/conf/server.xml
        usr/lib/artifactory/tomcat/conf/web.xml)
source=($pkgname-$pkgver.zip::http://sourceforge.net/projects/artifactory/files/$pkgname/$pkgver/$pkgname-$pkgver.zip/download
        artifactory.service
        artifactory.limits.conf)
sha256sums=(fc5ce44abd5c9a019d44d6848316a0c50bd59a14e52655397eeb3678c35bf9cf
            e506dbe5b1189615a852e1648c6d0aeaeb1eb87ee85cce813b523826b33eab1b
            33719c9ad15b1e4e3a8ab2d05cb246831adf1fd298314fa3627aebf7ac4766fe)
 
package() {
  # Artifactory paths 
  artHome="/usr/lib/artifactory"
  artBackup="/var/backup/artifactory"
  artData="/var/lib/artifactory"
  artEtc="/etc/artifactory"
  artLog="/var/log/artifactory"
 
  # Create artifactory paths
  install -d "$pkgdir$artHome"
  install -d "$pkgdir$artHome/bin"
  install -d "$pkgdir$artHome/misc"
  install -d "$pkgdir$artHome/tomcat/temp"
  install -d "$pkgdir$artBackup"
  install -d "$pkgdir$artData"
  install -d "$pkgdir$artEtc"
  install -d "$pkgdir$artLog"
  install -d "$pkgdir$artLog/catalina"
  install -d "$pkgdir/etc/security/limits.d"
  install -d "$pkgdir/etc/systemd/system"
 
  # Copy resources
  install -Dm644 $pkgname.service "$pkgdir$artHome/misc"
  install -Dm644 $pkgname.limits.conf "$pkgdir/etc/security/limits.d"
 
  cd $pkgname-$pkgver
 
  # Remove excess resources
  rm -f bin/*.bat
  rm -f bin/*.exe
  rm -f bin/installService.sh
  rm -f bin/uninstallService.sh
  rm -f tomcat/bin/*.bat
 
  cp -r bin/* "$pkgdir$artHome/bin"
  cp -r webapps "$pkgdir$artHome"
  cp -r tomcat/* "$pkgdir$artHome/tomcat"
  cp -r etc/* "$pkgdir$artEtc"
 
  # Create links
  ln -s $artHome/misc/artifactory.service "$pkgdir/etc/systemd/system/artifactory.service"    
  ln -s $artEtc "$pkgdir$artHome/etc"
  ln -s $artLog "$pkgdir$artHome/logs"
  ln -s $artLog/catalina "$pkgdir$artHome/tomcat/logs"
  ln -s $artBackup "$pkgdir$artHome/backup"
  ln -s $artData "$pkgdir$artHome/data"
 
  # Create empty files
  touch "$pkgdir$artBackup/EMPTY"
  touch "$pkgdir$artData/EMPTY"
  touch "$pkgdir$artLog/catalina/EMPTY"
  touch "$pkgdir$artHome/tomcat/temp/EMPTY"
  touch "$pkgdir$artHome/tomcat/work/EMPTY"
}