]> andersk Git - openssh.git/blob - buildpkg.sh.in
- (dtucker) [cipher-aes.c] Include string.h for memcpy and friends. Noted
[openssh.git] / buildpkg.sh.in
1 #!/bin/sh
2 #
3 # Fake Root Solaris/SVR4/SVR5 Build System - Prototype
4 #
5 # The following code has been provide under Public Domain License.  I really
6 # don't care what you use it for.  Just as long as you don't complain to me
7 # nor my employer if you break it. - Ben Lindstrom (mouring@eviladmin.org)
8 #
9 umask 022
10 #
11 # Options for building the package
12 # You can create a openssh-config.local with your customized options
13 #
14 REMOVE_FAKE_ROOT_WHEN_DONE=yes
15 #
16 # uncommenting TEST_DIR and using
17 # configure --prefix=/var/tmp --with-privsep-path=/var/tmp/empty
18 # and
19 # PKGNAME=tOpenSSH should allow testing a package without interfering
20 # with a real OpenSSH package on a system. This is not needed on systems
21 # that support the -R option to pkgadd.
22 #TEST_DIR=/var/tmp      # leave commented out for production build
23 PKGNAME=OpenSSH
24 # revisions within the same version (REV=a)
25 #REV=
26 SYSVINIT_NAME=opensshd
27 MAKE=${MAKE:="make"}
28 SSHDUID=67      # Default privsep uid
29 SSHDGID=67      # Default privsep gid
30 # uncomment these next three as needed
31 #PERMIT_ROOT_LOGIN=no
32 #X11_FORWARDING=yes
33 #USR_LOCAL_IS_SYMLINK=yes
34 # System V init run levels
35 SYSVINITSTART=S98
36 SYSVINITSTOPT=K30
37 # We will source these if they exist
38 POST_MAKE_INSTALL_FIXES=./pkg-post-make-install-fixes.sh
39 POST_PROTOTYPE_EDITS=./pkg-post-prototype-edit.sh
40 # We'll be one level deeper looking for these
41 PKG_PREINSTALL_LOCAL=../pkg-preinstall.local
42 PKG_POSTINSTALL_LOCAL=../pkg-postinstall.local
43 PKG_PREREMOVE_LOCAL=../pkg-preremove.local
44 PKG_POSTREMOVE_LOCAL=../pkg-postremove.local
45 PKG_REQUEST_LOCAL=../pkg-request.local
46 # end of sourced files
47 #
48 OPENSSHD=opensshd.init
49
50 PATH_GROUPADD_PROG=@PATH_GROUPADD_PROG@
51 PATH_USERADD_PROG=@PATH_USERADD_PROG@
52 PATH_PASSWD_PROG=@PATH_PASSWD_PROG@
53 #
54 # list of system directories we do NOT want to change owner/group/perms
55 # when installing our package
56 SYSTEM_DIR="/etc        \
57 /etc/init.d             \
58 /etc/rcS.d              \
59 /etc/rc0.d              \
60 /etc/rc1.d              \
61 /etc/rc2.d              \
62 /etc/opt                \
63 /opt                    \
64 /opt/bin                \
65 /usr                    \
66 /usr/bin                \
67 /usr/lib                \
68 /usr/sbin               \
69 /usr/share              \
70 /usr/share/man          \
71 /usr/share/man/man1     \
72 /usr/share/man/man8     \
73 /usr/local              \
74 /usr/local/bin          \
75 /usr/local/etc          \
76 /usr/local/libexec      \
77 /usr/local/man          \
78 /usr/local/man/man1     \
79 /usr/local/man/man8     \
80 /usr/local/sbin         \
81 /usr/local/share        \
82 /var                    \
83 /var/opt                \
84 /var/run                \
85 /var/tmp                \
86 /tmp"
87
88 # We may need to build as root so we make sure PATH is set up
89 # only set the path if it's not set already
90 [ -d /opt/bin ]  &&  {
91         echo $PATH | grep ":/opt/bin"  > /dev/null 2>&1
92         [ $? -ne 0 ] && PATH=$PATH:/opt/bin
93 }
94 [ -d /usr/local/bin ]  &&  {
95         echo $PATH | grep ":/usr/local/bin"  > /dev/null 2>&1
96         [ $? -ne 0 ] && PATH=$PATH:/usr/local/bin
97 }
98 [ -d /usr/ccs/bin ]  &&  {
99         echo $PATH | grep ":/usr/ccs/bin"  > /dev/null 2>&1
100         [ $? -ne 0 ] && PATH=$PATH:/usr/ccs/bin
101 }
102 export PATH
103 #
104
105 [ -f Makefile ]  ||  {
106         echo "Please run this script from your build directory"
107         exit 1
108 }
109
110 # we will look for openssh-config.local to override the above options
111 [ -s ./openssh-config.local ]  &&  . ./openssh-config.local
112
113 START=`pwd`
114 FAKE_ROOT=$START/pkg
115
116 ## Fill in some details, like prefix and sysconfdir
117 for confvar in prefix exec_prefix bindir sbindir libexecdir datadir mandir sysconfdir piddir srcdir
118 do
119         eval $confvar=`grep "^$confvar=" Makefile | cut -d = -f 2`
120 done
121
122
123 ## Collect value of privsep user
124 for confvar in SSH_PRIVSEP_USER
125 do
126         eval $confvar=`awk '/#define[ \t]'$confvar'/{print $3}' config.h`
127 done
128
129 ## Set privsep defaults if not defined
130 if [ -z "$SSH_PRIVSEP_USER" ]
131 then
132         SSH_PRIVSEP_USER=sshd
133 fi
134
135 ## Extract common info requires for the 'info' part of the package.
136 VERSION=`./ssh -V 2>&1 | sed -e 's/,.*//'`
137
138 ARCH=`uname -m`
139 DEF_MSG="\n"
140 OS_VER=`uname -v`
141 SCRIPT_SHELL=/sbin/sh
142 UNAME_S=`uname -s`
143 case ${UNAME_S} in
144         SunOS)  UNAME_S=Solaris
145                 ARCH=`uname -p`
146                 RCS_D=yes
147                 DEF_MSG="(default: n)"
148                 ;;
149         SCO_SV) UNAME_S=OpenServer
150                 OS_VER=`uname -X | grep Release | sed -e 's/^Rel.*3.2v//'`
151                 SCRIPT_SHELL=/bin/sh
152                 RC1_D=no
153                 DEF_MSG="(default: n)"
154                 ;;
155 esac
156
157 case `basename $0` in
158         buildpkg.sh)
159 ## Start by faking root install
160 echo "Faking root install..."
161 [ -d $FAKE_ROOT ]  &&  rm -fr $FAKE_ROOT
162 mkdir $FAKE_ROOT
163 ${MAKE} install-nokeys DESTDIR=$FAKE_ROOT
164 if [ $? -gt 0 ]
165 then
166         echo "Fake root install failed, stopping."
167         exit 1
168 fi
169
170 ## Setup our run level stuff while we are at it.
171 mkdir -p $FAKE_ROOT${TEST_DIR}/etc/init.d
172
173 cp ${OPENSSHD} $FAKE_ROOT${TEST_DIR}/etc/init.d/${SYSVINIT_NAME}
174 chmod 744 $FAKE_ROOT${TEST_DIR}/etc/init.d/${SYSVINIT_NAME}
175
176 [ "${PERMIT_ROOT_LOGIN}" = no ]  &&  \
177         perl -p -i -e "s/#PermitRootLogin yes/PermitRootLogin no/" \
178                 $FAKE_ROOT/${sysconfdir}/sshd_config
179 [ "${X11_FORWARDING}" = yes ]  &&  \
180         perl -p -i -e "s/#X11Forwarding no/X11Forwarding yes/" \
181                 $FAKE_ROOT/${sysconfdir}/sshd_config
182 # fix PrintMotd
183 perl -p -i -e "s/#PrintMotd yes/PrintMotd no/" \
184         $FAKE_ROOT/${sysconfdir}/sshd_config
185
186 # We don't want to overwrite config files on multiple installs
187 mv $FAKE_ROOT/${sysconfdir}/ssh_config $FAKE_ROOT/${sysconfdir}/ssh_config.default
188 mv $FAKE_ROOT/${sysconfdir}/sshd_config $FAKE_ROOT/${sysconfdir}/sshd_config.default
189 [ -f $FAKE_ROOT/${sysconfdir}/ssh_prng_cmds ]  &&  \
190 mv $FAKE_ROOT/${sysconfdir}/ssh_prng_cmds $FAKE_ROOT/${sysconfdir}/ssh_prng_cmds.default
191
192 # local tweeks here
193 [ -s "${POST_MAKE_INSTALL_FIXES}" ]  &&  . ${POST_MAKE_INSTALL_FIXES}
194
195 cd $FAKE_ROOT
196
197 ## Ok, this is outright wrong, but it will work.  I'm tired of pkgmk
198 ## whining.
199 for i in *; do
200   PROTO_ARGS="$PROTO_ARGS $i=/$i";
201 done
202
203 ## Build info file
204 echo "Building pkginfo file..."
205 cat > pkginfo << _EOF
206 PKG=$PKGNAME
207 NAME="OpenSSH Portable for ${UNAME_S}"
208 DESC="Secure Shell remote access utility; replaces telnet and rlogin/rsh."
209 VENDOR="OpenSSH Portable Team - http://www.openssh.com/portable.html"
210 ARCH=$ARCH
211 VERSION=$VERSION$REV
212 CATEGORY="Security,application"
213 BASEDIR=/
214 CLASSES="none"
215 PSTAMP="${UNAME_S} ${OS_VER} ${ARCH} `date '+%d%b%Y %H:%M'`"
216 _EOF
217
218 ## Build empty depend file that may get updated by $POST_PROTOTYPE_EDITS
219 echo "Building depend file..."
220 touch depend
221
222 ## Build space file
223 echo "Building space file..."
224 cat > space << _EOF
225 # extra space required by start/stop links added by installf in postinstall
226 $TEST_DIR/etc/rc0.d/${SYSVINITSTOPT}${SYSVINIT_NAME} 0 1
227 $TEST_DIR/etc/rc2.d/${SYSVINITSTART}${SYSVINIT_NAME} 0 1
228 _EOF
229 [ "$RC1_D" = no ]  ||  \
230 echo "$TEST_DIR/etc/rc1.d/${SYSVINITSTOPT}${SYSVINIT_NAME} 0 1" >> space
231 [ "$RCS_D" = yes ]  &&  \
232 echo "$TEST_DIR/etc/rcS.d/${SYSVINITSTOPT}${SYSVINIT_NAME} 0 1" >> space
233
234 ## Build preinstall file
235 echo "Building preinstall file..."
236 cat > preinstall << _EOF
237 #! ${SCRIPT_SHELL}
238 #
239 _EOF
240
241 # local preinstall changes here
242 [ -s "${PKG_PREINSTALL_LOCAL}" ]  &&  . ${PKG_PREINSTALL_LOCAL}
243
244 cat >> preinstall << _EOF
245 #
246 [ "\${PRE_INS_STOP}" = "yes" ]  &&  ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} stop
247 exit 0
248 _EOF
249
250 ## Build postinstall file
251 echo "Building postinstall file..."
252 cat > postinstall << _EOF
253 #! ${SCRIPT_SHELL}
254 #
255 [ -f \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config ]  ||  \\
256         cp -p \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config.default \\
257                 \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config
258 [ -f \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config ]  ||  \\
259         cp -p \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config.default \\
260                 \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config
261 [ -f \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds.default ]  &&  {
262         [ -f \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds ]  ||  \\
263         cp -p \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds.default \\
264                 \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds
265 }
266
267 # make rc?.d dirs only if we are doing a test install
268 [ -n "${TEST_DIR}" ]  &&  {
269         [ "$RCS_D" = yes ]  &&  mkdir -p ${TEST_DIR}/etc/rcS.d
270         mkdir -p ${TEST_DIR}/etc/rc0.d
271         [ "$RC1_D" = no ]  ||  mkdir -p ${TEST_DIR}/etc/rc1.d
272         mkdir -p ${TEST_DIR}/etc/rc2.d
273 }
274
275 if [ "\${USE_SYM_LINKS}" = yes ]
276 then
277         [ "$RCS_D" = yes ]  &&  \
278 installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rcS.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
279         installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc0.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
280         [ "$RC1_D" = no ]  ||  \
281         installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc1.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
282         installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc2.d/${SYSVINITSTART}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
283 else
284         [ "$RCS_D" = yes ]  &&  \
285 installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rcS.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=\${PKG_INSTALL_ROOT}$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
286         installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc0.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=\${PKG_INSTALL_ROOT}$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
287         [ "$RC1_D" = no ]  ||  \
288         installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc1.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=\${PKG_INSTALL_ROOT}$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
289         installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc2.d/${SYSVINITSTART}${SYSVINIT_NAME}=\${PKG_INSTALL_ROOT}$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
290 fi
291
292 # If piddir doesn't exist we add it. (Ie. --with-pid-dir=/var/opt/ssh)
293 [ -d $piddir ]  ||  installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR$piddir d 0755 root sys
294
295 _EOF
296
297 # local postinstall changes here
298 [ -s "${PKG_POSTINSTALL_LOCAL}" ]  &&  . ${PKG_POSTINSTALL_LOCAL}
299
300 cat >> postinstall << _EOF
301 installf -f ${PKGNAME}
302
303 # Use chroot to handle PKG_INSTALL_ROOT
304 if [ ! -z "\${PKG_INSTALL_ROOT}" ]
305 then
306         chroot="chroot \${PKG_INSTALL_ROOT}"
307 fi
308 # If this is a test build, we will skip the groupadd/useradd/passwd commands
309 if [ ! -z "${TEST_DIR}" ]
310 then
311         chroot=echo
312 fi
313
314         echo "PrivilegeSeparation user always required."
315         if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null
316         then
317                 echo "PrivSep user $SSH_PRIVSEP_USER already exists."
318                 SSH_PRIVSEP_GROUP=\`grep "^$SSH_PRIVSEP_USER:" \${PKG_INSTALL_ROOT}/etc/passwd | awk -F: '{print \$4}'\`
319                 SSH_PRIVSEP_GROUP=\`grep ":\$SSH_PRIVSEP_GROUP:" \${PKG_INSTALL_ROOT}/etc/group | awk -F: '{print \$1}'\`
320         else
321                 DO_PASSWD=yes
322         fi
323         [ -z "\$SSH_PRIVSEP_GROUP" ]  &&  SSH_PRIVSEP_GROUP=$SSH_PRIVSEP_USER
324
325         # group required?
326         if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'\$SSH_PRIVSEP_GROUP'\$' >/dev/null
327         then
328                 echo "PrivSep group \$SSH_PRIVSEP_GROUP already exists."
329         else
330                 DO_GROUP=yes
331         fi
332
333         # create group if required
334         [ "\$DO_GROUP" = yes ]  &&  {
335                 # Use gid of 67 if possible
336                 if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'$SSHDGID'\$' >/dev/null
337                 then
338                         :
339                 else
340                         sshdgid="-g $SSHDGID"
341                 fi
342                 echo "Creating PrivSep group \$SSH_PRIVSEP_GROUP."
343                 \$chroot ${PATH_GROUPADD_PROG} \$sshdgid \$SSH_PRIVSEP_GROUP
344         }
345
346         # Create user if required
347         [ "\$DO_PASSWD" = yes ]  &&  {
348                 # Use uid of 67 if possible
349                 if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSHDUID'\$' >/dev/null
350                 then
351                         :
352                 else
353                         sshduid="-u $SSHDUID"
354                 fi
355                 echo "Creating PrivSep user $SSH_PRIVSEP_USER."
356                 \$chroot ${PATH_USERADD_PROG} -c 'SSHD PrivSep User' -s /bin/false -g $SSH_PRIVSEP_USER \$sshduid $SSH_PRIVSEP_USER
357                 \$chroot ${PATH_PASSWD_PROG} -l $SSH_PRIVSEP_USER
358         }
359
360 [ "\${POST_INS_START}" = "yes" ]  &&  ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} start
361 exit 0
362 _EOF
363
364 ## Build preremove file
365 echo "Building preremove file..."
366 cat > preremove << _EOF
367 #! ${SCRIPT_SHELL}
368 #
369 ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} stop
370 _EOF
371
372 # local preremove changes here
373 [ -s "${PKG_PREREMOVE_LOCAL}" ]  &&  . ${PKG_PREREMOVE_LOCAL}
374
375 cat >> preremove << _EOF
376 exit 0
377 _EOF
378
379 ## Build postremove file
380 echo "Building postremove file..."
381 cat > postremove << _EOF
382 #! ${SCRIPT_SHELL}
383 #
384 _EOF
385
386 # local postremove changes here
387 [ -s "${PKG_POSTREMOVE_LOCAL}" ]  &&  . ${PKG_POSTREMOVE_LOCAL}
388
389 cat >> postremove << _EOF
390 exit 0
391 _EOF
392
393 ## Build request file
394 echo "Building request file..."
395 cat > request << _EOF
396 trap 'exit 3' 15
397
398 _EOF
399
400 [ -x /usr/bin/ckyorn ]  ||  cat >> request << _EOF
401
402 ckyorn() {
403 # for some strange reason OpenServer has no ckyorn
404 # We build a striped down version here
405
406 DEFAULT=n
407 PROMPT="Yes or No [yes,no,?,quit]"
408 HELP_PROMPT="        Enter y or yes if your answer is yes; n or no if your answer is no."
409 USAGE="usage: ckyorn [options]
410 where options may include:
411         -d default
412         -h help
413         -p prompt
414 "
415
416 if [ \$# != 0 ]
417 then
418         while getopts d:p:h: c
419         do
420                 case \$c in
421                         h)      HELP_PROMPT="\$OPTARG" ;;
422                         d)      DEFAULT=\$OPTARG ;;
423                         p)      PROMPT=\$OPTARG ;;
424                         \\?)    echo "\$USAGE" 1>&2
425                                 exit 1 ;;
426                 esac
427         done
428         shift \`expr \$OPTIND - 1\`
429 fi
430
431 while true
432 do
433         echo "\${PROMPT}\\c " 1>&2
434         read key
435         [ -z "\$key" ]  &&  key=\$DEFAULT
436         case \$key in
437                 [n,N]|[n,N][o,O]|[y,Y]|[y,Y][e,E][s,S]) echo "\${key}\\c"
438                         exit 0 ;;
439                 \\?)    echo \$HELP_PROMPT 1>&2 ;;
440                 q|quit) echo "q\\c" 1>&2
441                         exit 3 ;;
442         esac
443 done
444
445 }
446
447 _EOF
448
449 cat >> request << _EOF
450 USE_SYM_LINKS=no
451 PRE_INS_STOP=no
452 POST_INS_START=no
453 # Use symbolic links?
454 ans=\`ckyorn -d n \
455 -p "Do you want symbolic links for the start/stop scripts? ${DEF_MSG}"\` || exit \$?
456 case \$ans in
457         [y,Y]*) USE_SYM_LINKS=yes ;;
458 esac
459
460 # determine if should restart the daemon
461 if [ -s ${piddir}/sshd.pid  -a  -f ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} ]
462 then
463         ans=\`ckyorn -d n \
464 -p "Should the running sshd daemon be restarted? ${DEF_MSG}"\` || exit \$?
465         case \$ans in
466                 [y,Y]*) PRE_INS_STOP=yes
467                         POST_INS_START=yes
468                         ;;
469         esac
470
471 else
472
473 # determine if we should start sshd
474         ans=\`ckyorn -d n \
475 -p "Start the sshd daemon after installing this package? ${DEF_MSG}"\` || exit \$?
476         case \$ans in
477                 [y,Y]*) POST_INS_START=yes ;;
478         esac
479 fi
480
481 # make parameters available to installation service,
482 # and so to any other packaging scripts
483 cat >\$1 <<!
484 USE_SYM_LINKS='\$USE_SYM_LINKS'
485 PRE_INS_STOP='\$PRE_INS_STOP'
486 POST_INS_START='\$POST_INS_START'
487 !
488
489 _EOF
490
491 # local request changes here
492 [ -s "${PKG_REQUEST_LOCAL}" ]  &&  . ${PKG_REQUEST_LOCAL}
493
494 cat >> request << _EOF
495 exit 0
496
497 _EOF
498
499 ## Next Build our prototype
500 echo "Building prototype file..."
501 cat >mk-proto.awk << _EOF
502             BEGIN { print "i pkginfo"; print "i depend"; \\
503                     print "i preinstall"; print "i postinstall"; \\
504                     print "i preremove"; print "i postremove"; \\
505                     print "i request"; print "i space"; \\
506                     split("$SYSTEM_DIR",sys_files); }
507             {
508              for (dir in sys_files) { if ( \$3 != sys_files[dir] )
509                      { if ( \$1 == "s" )
510                         { \$5=""; \$6=""; }
511                      else
512                         { \$5="root"; \$6="sys"; }
513                      }
514                 else
515                      { \$4="?"; \$5="?"; \$6="?"; break;}
516             } }
517             { print; }
518 _EOF
519
520 find . | egrep -v "prototype|pkginfo|mk-proto.awk" | sort | \
521         pkgproto $PROTO_ARGS | nawk -f mk-proto.awk > prototype
522
523 # /usr/local is a symlink on some systems
524 [ "${USR_LOCAL_IS_SYMLINK}" = yes ]  &&  {
525         grep -v "^d none /usr/local ? ? ?$" prototype > prototype.new
526         mv prototype.new prototype
527 }
528
529 ## Step back a directory and now build the package.
530 cd ..
531 # local prototype tweeks here
532 [ -s "${POST_PROTOTYPE_EDITS}" ]  &&  . ${POST_PROTOTYPE_EDITS}
533
534 echo "Building package.."
535 pkgmk -d ${FAKE_ROOT} -f $FAKE_ROOT/prototype -o
536 echo | pkgtrans -os ${FAKE_ROOT} ${START}/$PKGNAME-$VERSION$REV-$UNAME_S-$ARCH.pkg
537         ;;
538
539         justpkg.sh)
540 rm -fr ${FAKE_ROOT}/${PKGNAME}
541 grep -v "^PSTAMP=" $FAKE_ROOT/pkginfo > $$tmp
542 mv $$tmp $FAKE_ROOT/pkginfo
543 cat >> $FAKE_ROOT/pkginfo << _EOF
544 PSTAMP="${UNAME_S} ${OS_VER} ${ARCH} `date '+%d%b%Y %H:%M'`"
545 _EOF
546 pkgmk -d ${FAKE_ROOT} -f $FAKE_ROOT/prototype -o
547 echo | pkgtrans -os ${FAKE_ROOT} ${START}/$PKGNAME-$VERSION$REV-$UNAME_S-$ARCH.pkg
548         ;;
549
550 esac
551
552 [ "${REMOVE_FAKE_ROOT_WHEN_DONE}" = yes ]  &&  rm -rf $FAKE_ROOT
553 exit 0
554
This page took 2.688866 seconds and 5 git commands to generate.