[fedora-astronomy] Build iraf RPM on fedora
OlŠµ Streicher
debian-devel at liska.ath.cx
Tue Jun 4 21:11:56 UTC 2013
Hi all,
one more proposal regarding directory structure: According to the
freedeskto.org, the directories imlib$ and cache$ should go into the
user's home dir on default:
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
which leads to a change in mkiraf.csh (see below).
This creates and uses the files
${HOME}/.local/share/imdir - as user image directory
${HOME}/.cache/iraf - as user cache dir
Best regards
Ole
--- a/unix/hlib/mkiraf.csh
+++ b/unix/hlib/mkiraf.csh
@@ -4,7 +4,7 @@
# The following definitions are site dependent. [SITEDEP]
-set iraf = "/iraf/iraf"
+set iraf = "/usr/share/iraf"
set imdir = "/iraf/imdirs"
set cachedir = "/iraf/cache"
set ttymsg =\
@@ -93,16 +93,22 @@
pwd | sed -e "s;.*;s+U_UPARM+&/uparm/+;" >> _sed
if (! (-e "$imdir" && -w "$imdir") ) then
- set imdir = HDR$
- whoami | sed -e "s;.*;s+U_IMDIR+${imdir}/+;" >> _sed
+ if ( ${?XDG_DATA_HOME} == 0 ) then
+ setenv XDG_DATA_HOME ${HOME}/.local/share
+ endif
+ echo "s+U_IMDIR+${XDG_DATA_HOME}/imdir/+" >> _sed
+ mkdir -p ${XDG_DATA_HOME}/imdir/
else
whoami | sed -e "s;.*;s+U_IMDIR+${imdir}/&/+;" >> _sed
whoami | sed -e "s;.*;mkdir $imdir/& 2> /dev/null;" | sh
endif
if (! (-e "$cachedir" && -w "$cachedir") ) then
- set cachedir = /tmp/
- whoami | sed -e "s;.*;s+U_CACHEDIR+${cachedir}/+;" >> _sed
+ if ( ${?XDG_CACHE_HOME} == 0 ) then
+ setenv XDG_CACHE_HOME ${HOME}/.cache
+ endif
+ echo "s+U_CACHEDIR+${XDG_CACHE_HOME}/iraf/+" >> _sed
+ mkdir -p ${XDG_CACHE_HOME}/iraf/
else
whoami | sed -e "s;.*;s+U_CACHEDIR+${cachedir}/&/+;" >> _sed
whoami | sed -e "s;.*;mkdir $cachedir/& 2> /dev/null;" | sh
More information about the astronomy
mailing list