aboutsummaryrefslogtreecommitdiff
path: root/util/pkgconfig
blob: e5e6c5131adf5f268f0ab7174f5a8a446867af5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/sh
#
#  PKGCONFIG -- Re-create the system Makefile to take into account new
#  packages.


# Initialize the $iraf and environment.
if [ -z "$iraf" ]; then
  if [ -e "$HOME/.iraf/setup.sh" ]; then
    source $HOME/.iraf/setup.sh
  else
    source unix/hlib/setup.sh
  fi
else
    source $iraf/unix/hlib/setup.sh
fi


/bin/echo "Initializing repository data ...."
$iraf/util/pkginit				# init repository information
if (( $? == 1 )); then
   exit
fi

# Create the template Makefile.
/bin/echo "Creating system makefile ...."
cat << MAKE_TEMP_END		> Makefile
#
#  Makefile for IRAF external package installation/maintenance.
#
# ---------------------------------------------------------------------------

# Compiler Flags.

RELEASE		= `cat ../.version`
        
all:: update

# Update recent changes from the repository.
update::
	@./configure
	@../util/pkgupdate -all

# Install all available packages for this platform.
install_all::
	@../util/pkgall

# List packages available on the repository.
list::
	@cat .repo_pkgs

# Clean the IRAF tree of binaries for the currently configured arch.
init::
	@../util/pkgclean -init

# Remove all package code but leave the structure in place.
clean::
	@../util/pkgclean -all

# Restore the dynamic package directory to its distribution state.
distclean::
	@../util/pkgclean -init

# Check to see which installed packages could be updated.
check::
	@../util/pkgupdate -list

# Update recent changes from the repository.
self_update::
	@../util/pkgupdate -self
	@./configure


MAKE_TEMP_END

echo "Setup Complete."



# For each package we have, append a makefile entry.
pkg=`cat .repo_pkgs`
for p in ${pkg[@]} ; do

   # Create template makefile entries for each package
   /bin/echo "${p}::"					>> Makefile
   /bin/echo "	@../util/pkginst $p"			>> Makefile
   /bin/echo "clean_${p}::"				>> Makefile
   /bin/echo "	@../util/pkgclean $p"			>> Makefile
   /bin/echo "update_${p}::"				>> Makefile
   /bin/echo "	@../util/pkgupdate $p"			>> Makefile
   /bin/echo ""						>> Makefile

   # Create the directory
   if [ -e "$p" ]; then
      /bin/rm -rf $p
   fi
   mkdir $p
done

/bin/echo ""
exit 0