summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndrew Guschin <saintruler@gmail.com>2020-08-06 12:14:18 +0400
committerAndrew Guschin <saintruler@gmail.com>2020-08-06 12:14:18 +0400
commit5c5942f7c2ab059403a6e3a748291cbbd947e44d (patch)
tree703027a6f3046dc1a9be4a5d110510ed99d0f747 /Makefile
Initial commitHEADmaster
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a6c96cb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,37 @@
+.PHONY: all
+.DEFAULT_GOAL: all
+all: extract prepare create build
+
+VERSION=2020.2
+PKG_NAME=idea
+PKG_FOLDER=${PKG_NAME}-package
+PKG_URL=https://download-cf.jetbrains.com/idea/ideaIU-${VERSION}.tar.gz
+SRC=${PKG_NAME}-src
+
+${PKG_NAME}-${VERSION}.tar.gz:
+ wget "${PKG_URL}" -O "${PKG_NAME}-${VERSION}.tar.gz"
+
+extract: ${PKG_NAME}-${VERSION}.tar.gz
+ rm -rf "${SRC}"
+ tar -xf "${PKG_NAME}-${VERSION}.tar.gz"
+ mv "idea-IU-202.6397.94" "${SRC}"
+
+prepare:
+ mkdir -p "${PKG_FOLDER}/opt"
+ mkdir -p "${PKG_FOLDER}/usr/share/pixmaps"
+ mkdir -p "${PKG_FOLDER}/usr/share/applications"
+ cp -r "DEBIAN" "${PKG_FOLDER}"
+ sed -i "s/Version:.*/Version: ${VERSION}-1/g" "${PKG_FOLDER}/DEBIAN/control"
+ sed -i "s/version=\".*\"/version=\"${VERSION}\"/g" "${PKG_FOLDER}/DEBIAN/postinst"
+
+create: ${PKG_FOLDER}
+ cp "${SRC}/bin/${PKG_NAME}.png" "./${PKG_FOLDER}/usr/share/pixmaps/"
+ cp "${PKG_NAME}.desktop" "./${PKG_FOLDER}/usr/share/applications/"
+ mv "${SRC}" "${PKG_FOLDER}/opt/JetBrains.${PKG_NAME}-${VERSION}"
+
+build:
+ fakeroot dpkg-deb --build "${PKG_FOLDER}"
+
+clean:
+ rm -rf idea-*
+