summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorD. Can Celasun2017-09-18 09:06:27 +0200
committerD. Can Celasun2017-09-18 09:06:27 +0200
commit07e02dbe86c0b29edb2ef0145c9e5d24b6232716 (patch)
tree2b24c5595c1f1e62350d25ea4ab73a8d0526e039
parentc9281283029d0ddafd892da3a879841c1933077a (diff)
downloadaur-07e02dbe86c0b29edb2ef0145c9e5d24b6232716.tar.gz
PKGBUILD improvements
-rw-r--r--PKGBUILD39
-rw-r--r--intellij-idea-ultimate-edition.install5
2 files changed, 23 insertions, 21 deletions
diff --git a/PKGBUILD b/PKGBUILD
index e47d4d03a03..f353004ffe6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,48 +4,45 @@ pkgbase=intellij-idea-ultimate-edition
pkgname=(intellij-idea-ultimate-edition intellij-idea-ultimate-edition-jre)
pkgver=2017.2.4
_buildver=172.4155.36
-pkgrel=1
+pkgrel=2
arch=('any')
pkgdesc="An intelligent IDE for Java, Groovy and other programming languages with advanced refactoring features intensely focused on developer productivity."
url="https://www.jetbrains.com/idea/"
license=('Commercial')
-makedepends=('rsync')
options=(!strip)
-source=(https://download.jetbrains.com/idea/ideaIU-$pkgver.tar.gz \
- jetbrains-idea.desktop
-)
+install=$pkgbase.install
+source=("https://download.jetbrains.com/idea/ideaIU-$pkgver.tar.gz"
+ "jetbrains-idea.desktop")
sha256sums=('952183763c239acc48a99f4b29c767aa9ab89b1f83d8dc5917e6e61952fbfcf8'
'83af2ba8f9f14275a6684e79d6d4bd9b48cd852c047dacfc81324588fa2ff92b')
+
+prepare() {
+ # Extract the JRE from the main pacakge
+ mv idea-IU-$_buildver/jre64 "$srcdir"/jre64
+}
+
package_intellij-idea-ultimate-edition() {
- backup=("usr/share/${pkgname}/bin/idea.vmoptions" "usr/share/${pkgname}/bin/idea64.vmoptions" "usr/share/${pkgname}/bin/idea.properties")
+ backup=("opt/$pkgname/bin/idea.vmoptions" "opt/${pkgname}/bin/idea64.vmoptions" "opt/${pkgname}/bin/idea.properties")
depends=('giflib' 'libxtst')
optdepends=('intellij-idea-ultimate-edition-jre: JetBrains custom JRE (Recommended)' 'java-environment: Required if intellij-idea-ultimate-edition-jre is not installed')
cd "$srcdir"
- install -d -m755 "${pkgdir}"/usr/{bin,share}
- rsync -rtl "idea-IU-${_buildver}/" "${pkgdir}/usr/share/${pkgbase}" --exclude=/jre64
-
- # make sure that all files are owned by root
- chown -R root:root "${pkgdir}/usr/share"
-
- find "$pkgdir"/usr/share/"$pkgname" -type d -exec chmod 0755 {} ';'
- find "$pkgdir"/usr/share/"$pkgname" -type f -exec chmod 0644 {} ';'
-
- chmod +x "$pkgdir"/usr/share/"$pkgname"/bin/*
+ install -d "$pkgdir"/{opt/$pkgname,usr/bin}
+ mv idea-IU-${_buildver}/* "$pkgdir"/opt/$pkgbase
- ln -s /usr/share/"$pkgname"/bin/idea.sh "$pkgdir"/usr/bin/"$pkgname"
+ ln -s /opt/$pkgname/bin/idea.sh "$pkgdir"/usr/bin/$pkgname
install -D -m644 "$srcdir"/jetbrains-idea.desktop "$pkgdir"/usr/share/applications/jetbrains-idea.desktop
- install -D -m644 "$srcdir"/idea-IU-$_buildver/bin/idea.png "$pkgdir"/usr/share/pixmaps/"$pkgname".png
+ install -D -m644 "$pkgdir"/opt/$pkgbase/bin/idea.png "$pkgdir"/usr/share/pixmaps/"$pkgname".png
# workaround FS#40934
- sed -i 's|lcd|on|' "$pkgdir"/usr/share/"$pkgname"/bin/*.vmoptions
+ sed -i 's|lcd|on|' "$pkgdir"/opt/$pkgname/bin/*.vmoptions
}
package_intellij-idea-ultimate-edition-jre() {
arch=('x86_64')
- install -d -m 755 "${pkgdir}/usr/share/${pkgbase}"
- rsync -rtl "${srcdir}/idea-IU-${_buildver}/jre64" "${pkgdir}/usr/share/${pkgbase}"
+ install -d -m 755 "$pkgdir"/opt/$pkgbase
+ mv "$srcdir"/jre64 "$pkgdir"/opt/$pkgbase
}
# vim:set ts=2 sw=2 et:
diff --git a/intellij-idea-ultimate-edition.install b/intellij-idea-ultimate-edition.install
new file mode 100644
index 00000000000..3cdd8618d23
--- /dev/null
+++ b/intellij-idea-ultimate-edition.install
@@ -0,0 +1,5 @@
+post_upgrade() {
+ echo -e "\033[0;33m\033[1m\tWarning:\033[0m Install location has moved to /opt!"
+ echo -e "\tIf you have modified *.vmoptions or idea.properties, you will need to move them to the new directory by running:\n"
+ echo -e "\tsudo cp -a /usr/share/intellij-idea-ultimate-edition/bin/{*.vmoptions, idea.properties} /opt/intellij-idea-ultimate-edition/bin/"
+} \ No newline at end of file