aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Waddoups2024-01-10 14:33:29 +0000
committerMark Waddoups2024-01-10 14:33:29 +0000
commit0dcff5d8857995f4c9c536252afce1f019c99757 (patch)
treeb73c522ac3f380c82f6a83ec633d6f0a74b1cb12
downloadaur-0dcff5d8857995f4c9c536252afce1f019c99757.tar.gz
First commit
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD41
-rw-r--r--README.md23
-rw-r--r--stata_lic.sh22
4 files changed, 87 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..fc31016dc933
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+Stata18Linux64.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..4cab346ebae1
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,41 @@
+# Maintainer: Mark Waddoups <mwaddoups@gmail.com>
+pkgname=stata
+pkgver=18
+pkgrel=1
+pkgdesc="A high-level statistical language used in econometrics and statistics."
+arch=(x86_64)
+url="https://www.stata.com/"
+license=(custom)
+depends=(ncurses5-compat-libs libpng12)
+source=(local://Stata18Linux64.tar.gz local://stata_lic.sh)
+md5sums=(43e05d773b20a8e372d3c7e3abb54b40 SKIP)
+
+prepare() {
+ cd "$srcdir"
+ # Replace input for answer with default Yes (noninteractive)
+ sed -i 's/Answer$/ANSW=y/g' install
+}
+
+package() {
+ # Install files to /usr/local
+ mkdir -p "$pkgdir/usr/local/stata"
+ cd "$pkgdir/usr/local/stata"
+ echo "Installing stata (output in src/install.log)..."
+ /$srcdir/install > $srcdir/install.log
+
+ # Run the license script
+ echo "Licensing stata (output in src/license.log)."
+ echo "If this crashes, check the log and make sure you've read README.md and entered license information..."
+ echo "If this takes a long time, you may need to debug this script..."
+ bash $srcdir/stata_lic.sh > $srcdir/license.log
+
+ # Symbolic links for path
+ mkdir -p "$pkgdir/usr/local/bin"
+ ln -s "/usr/local/stata/stata" "$pkgdir/usr/local/bin/stata"
+ ln -s "/usr/local/stata/xstata" "$pkgdir/usr/local/bin/xstata"
+ ln -s "/usr/local/stata/stata-se" "$pkgdir/usr/local/bin/stata"
+ ln -s "/usr/local/stata/xstata-se" "$pkgdir/usr/local/bin/xstata"
+ ln -s "/usr/local/stata/stata-mp" "$pkgdir/usr/local/bin/stata"
+ ln -s "/usr/local/stata/xstata-mp" "$pkgdir/usr/local/bin/xstata"
+
+}
diff --git a/README.md b/README.md
new file mode 100644
index 000000000000..39c77fa389a2
--- /dev/null
+++ b/README.md
@@ -0,0 +1,23 @@
+This package WILL NOT build automatically, and will not work with any AUR helper.
+
+This is just a wrapper around Stata's install to allow the package and dependencies to be managed by Pacman.
+
+# How to use this package
+
+You will need two things
+- A copy of the relevant version of Stata. This can be checked in the PKGBUILD source - at time of writing it is Stata 18. The archive should match the name and md5 given in the PKGBUILD. If the md5 doesn't match but you are sure the archive is correct, update the md5 hash in the PKGBUILD before running.
+- You need to manually edit and update the five variables in `stata_lic.sh` with information appropriate to your license.
+
+The built package will include your license. This package cannot be distributed, and distributing it would be against Stata's License. The license is viewable by extracting the source.
+
+# Notes
+
+The package installs to `/usr/local/stata`, and creates symlinks in `/usr/local/bin` for all the relevant binaries:
+- stata
+- xstata
+- stata-se
+- xstata-se
+- stata-mp
+- xstata-mp
+
+Use the appropriate version for you.
diff --git a/stata_lic.sh b/stata_lic.sh
new file mode 100644
index 000000000000..68be7e66f3fd
--- /dev/null
+++ b/stata_lic.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Set these to the correct values for your license
+ST_SERIAL="Your serial here e.g. 123558358"
+ST_CODE="Your code here e.g. 2393 2342 x329 3494 x349"
+ST_AUTH="Your auth here e.g. abcd"
+# These two don't matter too much, but will show in the "Licensed to" field.
+# The prompt suggests your name if it's individual, or the institution name otherwise.
+ST_NAME="Your name or institution name here"
+ST_LOCATION="Your location here"
+
+
+# Check the user has entered something...
+if [ "$ST_SERIAL" = 'Your serial here e.g. 123558358' ]
+then
+ echo "Error! You haven't entered licensing details. Please read the README.md in full."
+ exit 1
+fi
+
+
+# This just inputs all needed interactive input for license generation to happen noninteractively
+echo -e "y\ny\n$ST_SERIAL\n$ST_CODE\n$ST_AUTH\ny\ny\n$ST_NAME\n$ST_LOCATION\ny\n" | ./stinit