ntpack.sh 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/sh
  2. #
  3. # BEGIN COPYRIGHT BLOCK
  4. # This Program is free software; you can redistribute it and/or modify it under
  5. # the terms of the GNU General Public License as published by the Free Software
  6. # Foundation; version 2 of the License.
  7. #
  8. # This Program is distributed in the hope that it will be useful, but WITHOUT
  9. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  10. # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License along with
  13. # this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  14. # Place, Suite 330, Boston, MA 02111-1307 USA.
  15. #
  16. # In addition, as a special exception, Red Hat, Inc. gives You the additional
  17. # right to link the code of this Program with code not covered under the GNU
  18. # General Public License ("Non-GPL Code") and to distribute linked combinations
  19. # including the two, subject to the limitations in this paragraph. Non-GPL Code
  20. # permitted under this exception must only link to the code of this Program
  21. # through those well defined interfaces identified in the file named EXCEPTION
  22. # found in the source code files (the "Approved Interfaces"). The files of
  23. # Non-GPL Code may instantiate templates or use macros or inline functions from
  24. # the Approved Interfaces without causing the resulting work to be covered by
  25. # the GNU General Public License. Only Red Hat, Inc. may make changes or
  26. # additions to the list of Approved Interfaces. You must obey the GNU General
  27. # Public License in all respects for all of the Program code and other code used
  28. # in conjunction with the Program except the Non-GPL Code covered by this
  29. # exception. If you modify this file, you may extend this exception to your
  30. # version of the file, but you are not obligated to do so. If you do not wish to
  31. # provide this exception without modification, you must delete this exception
  32. # statement from your version and license this file solely under the GPL without
  33. # exception.
  34. #
  35. #
  36. # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  37. # Copyright (C) 2005 Red Hat, Inc.
  38. # All rights reserved.
  39. # END COPYRIGHT BLOCK
  40. #
  41. #######################################################################
  42. #
  43. # Script to pack ldapsdk on NT (uses rtpatch)
  44. #
  45. # Mahesh Purswani (3/97)
  46. #######################################################################
  47. # Path to the rtpatch installation
  48. RTPATCH=/rtpatch
  49. outfile=outname
  50. reldir=.
  51. olddir=/nonedir
  52. while [ $# -gt 0 ]
  53. do
  54. case "$1" in
  55. -o)
  56. shift
  57. outfile=$1;;
  58. -r)
  59. shift
  60. reldir=$1;;
  61. *)
  62. echo ""
  63. echo "Usage: $0 [-o outfile] [-r sourcedir]"
  64. echo ""
  65. exit 1;;
  66. esac
  67. shift
  68. done
  69. if [ ! -d "$olddir" ] ; then
  70. echo "Making empty old directory $olddir"
  71. mkdir $olddir
  72. fi
  73. rolddir=`echo $olddir | sed 's#/#\\\\#g'`
  74. rreldir=`echo $reldir | sed 's#/#\\\\#g'`
  75. cat <<EOF > pack.txt
  76. OLDDIR $rolddir /F
  77. NEWDIR $rreldir /F
  78. OUTPUT $outfile
  79. FILE *.*
  80. PATCHFILE
  81. LONGNAMES
  82. PARTIAL
  83. SUBDIRSEARCH
  84. NOPATHSEARCH
  85. IGNOREMISSING
  86. EOF
  87. cat <<EOF > bind.txt
  88. [General]
  89. Platform=Console32
  90. DirectoryPrompt=Please specify install directory (default is current directory):
  91. IncludeDLL=1
  92. PatchFile=$outfile.rtp
  93. OutputFile=$outfile.exe
  94. EOF
  95. # Run rtpatch
  96. $RTPATCH/pbld-nt @pack.txt
  97. $RTPATCH/pbind bind.txt
  98. echo "Packed release dir = $reldir"
  99. echo "To outfile = $outfile"