aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Turner <jturner@gemini.edu>2016-12-13 13:49:04 -0500
committerJames Turner <jturner@gemini.edu>2016-12-13 13:49:04 -0500
commit0599c6246bf36911f2232491192dec23d0a0035f (patch)
tree4a18582dfc33319f6de5bf96793063e42700c390
parent36252bd29e4cad0ff78c1ec37a95a2211b73a05b (diff)
downloadastroconda-iraf-0599c6246bf36911f2232491192dec23d0a0035f.tar.gz
Commit semi-disposable helper script & template used for converting Ureka packages, just for future reference, before deleting them.
-rwxr-xr-xconvert_pkg52
-rw-r--r--template/bld.bat2
-rw-r--r--template/build.sh8
-rw-r--r--template/meta.yaml27
-rw-r--r--template/post-link.sh3
-rw-r--r--template/pre-unlink.sh1
-rw-r--r--template/ur_extern.pkg6
-rw-r--r--template/ur_mkpkg_patterns0
8 files changed, 99 insertions, 0 deletions
diff --git a/convert_pkg b/convert_pkg
new file mode 100755
index 0000000..fa02fbe
--- /dev/null
+++ b/convert_pkg
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# A semi-disposable script to help convert Ureka IRAF package definitions into
+# conda packages. This should be run in the astroconda-iraf repo as
+# ./convert_pkg pkgname. It would probably be easy to put this in the Ureka
+# scripts/ dir and generalize the paths but the conversion shouldn't need doing
+# more than once.
+
+pkgname=$1
+PKGNAME=$(echo "$1" | tr a-z A-Z)
+pkgdir=iraf."$pkgname"
+urdefs=/rtfproc/unified_release/ur_work/urel/iraf_packages
+uradd=/rtfproc/unified_release/ur_work/urel/addons/irafpkg/build_list
+patches=/rtfproc/unified_release/ur_work/tmp_work/patches
+
+if [ ! -e "$pkgdir" ]; then
+
+ version=$(awk "/[ \t]$pkgname[ \t]/ {print \$3}" "$uradd")
+ version_us=$(echo "$version" | tr - _)
+
+ urpkg=$urdefs/$pkgname/$version
+
+ fn=$(awk -F '=' '/^tarfile/ {print $2}' $urpkg/ur_conf)
+
+ mkdir "$pkgdir"
+ sed -e "s|pkgname|$pkgname|" -e "s|PKGNAME|$PKGNAME|" template/meta.yaml \
+ -e "s|VERSION|$version_us|" -e "s|FILENAME|$fn|" \
+ > "$pkgdir/meta.yaml"
+
+
+ for f in bld.bat build.sh post-link.sh pre-unlink.sh; do
+ cp -p "template/$f" "$pkgdir/"
+ done
+
+ sed -i -e "s|pkgname|$pkgname|" "$pkgdir/post-link.sh" "$pkgdir/pre-unlink.sh"
+
+ for f in ur_extern.pkg ur_manifest ur_mkhelp_cmd ur_mkpkg_cmd ur_mkpkg_patterns; do
+ if [ -e "$urpkg/$f" ]; then
+ cp -p "$urpkg/$f" "$pkgdir/"
+ fi
+ done
+
+ sed -i -e '/./,$!d' "$pkgdir/ur_extern.pkg" # no longer need leading space
+
+ (cd /rtfproc/unified_release/scripts; ./convert_patches "$pkgname" "$version")
+ cp -p "${patches}/${pkgname}/ac.iraf.${pkgname}.patch" "$pkgdir/"
+
+else
+ echo "Already exists" >&2
+ exit 1
+fi
+
diff --git a/template/bld.bat b/template/bld.bat
new file mode 100644
index 0000000..e1aca7a
--- /dev/null
+++ b/template/bld.bat
@@ -0,0 +1,2 @@
+echo Not supported on Windows
+exit 1
diff --git a/template/build.sh b/template/build.sh
new file mode 100644
index 0000000..2353907
--- /dev/null
+++ b/template/build.sh
@@ -0,0 +1,8 @@
+# Configure the environment for IRAF, since conda build appears not to do
+# "source activate" after installing dependencies (this would instead need to
+# eval $PREFIX/iraf/unix/hlib/setup directly if "--level" needs specifying):
+. setup_iraf.sh
+
+# Build from source in envs/_build (using build script from astroconda-utils):
+ac_build_iraf_pkg
+
diff --git a/template/meta.yaml b/template/meta.yaml
new file mode 100644
index 0000000..d4b2a96
--- /dev/null
+++ b/template/meta.yaml
@@ -0,0 +1,27 @@
+about:
+ home: http://iraf.noao.edu/
+ license: IRAF MIT/X11 variant
+ summary: PKGNAME package for IRAF
+build:
+ binary_relocation: False
+ number: '0'
+ # These must be copied from astroconda-iraf-helpers, since conda disallows
+ # the post-install step from depending on other packages:
+ always_include_files:
+ - bin/ac_config_iraf_pkg
+ - bin/ac_update_extern_pkg
+package:
+ name: iraf.pkgname
+ version: "VERSION"
+source:
+ fn: FILENAME
+ url: http://astroconda-source:4440/FILENAME
+ patches:
+ - ac.iraf.pkgname.patch
+requirements:
+ build:
+ - astroconda-iraf-helpers
+ - iraf !=2.16.1,>=2.16.UR
+ run:
+ - iraf !=2.16.1,>=2.16.UR
+
diff --git a/template/post-link.sh b/template/post-link.sh
new file mode 100644
index 0000000..1056b72
--- /dev/null
+++ b/template/post-link.sh
@@ -0,0 +1,3 @@
+# Call a common script that updates extern.pkg for the new IRAF package:
+
+"$PREFIX/bin/ac_config_iraf_pkg" pkgname
diff --git a/template/pre-unlink.sh b/template/pre-unlink.sh
new file mode 100644
index 0000000..2d221ce
--- /dev/null
+++ b/template/pre-unlink.sh
@@ -0,0 +1 @@
+"$PREFIX/bin/ac_config_iraf_pkg" --remove pkgname
diff --git a/template/ur_extern.pkg b/template/ur_extern.pkg
new file mode 100644
index 0000000..402520f
--- /dev/null
+++ b/template/ur_extern.pkg
@@ -0,0 +1,6 @@
+# ftp://iraf.noao.edu/iraf/v216/REPO
+reset adccdrom = UR_VDIR
+task adccdrom.pkg = adccdrom$adccdrom.cl
+reset helpdb= ( envget("helpdb") + ",adccdrom$lib/helpdb.mip" )
+reset aproposdb= ( envget("aproposdb") + ",adccdrom$lib/apropos.db" )
+
diff --git a/template/ur_mkpkg_patterns b/template/ur_mkpkg_patterns
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/template/ur_mkpkg_patterns