#!/bin/sh


echo ""
echo "****************************************************"
echo "*  REQUIRED LICENSE AGREEMENT                      *"
echo "****************************************************"
echo ""
echo "Pre-Release "
echo "Software Evaluation Agreement"
echo ""
echo "SUN MICROSYSTEMS, INC. (\"SUN\") IS WILLING TO LICENSE THE JAVA USB "
echo "API FOR SUN RAY CLIENTS 1.0 PRE-RELEASE SOFTWARE TO LICENSEE ONLY "
echo "UPON THE CONDITION THAT LICENSEE ACCEPTS ALL OF THE TERMS CONTAINED "
echo "IN THIS LICENSE AGREEMENT (\"AGREEMENT\"). PLEASE READ THE TERMS AND "
echo "CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING OR "
echo "INSTALLING THIS SOFTWARE, LICENSEE ACCEPTS THE TERMS AND CONDITIONS "
echo "OF THIS LICENSE AGREEMENT. INDICATE ACCEPTANCE BY SELECTING THE "
echo "\"ACCEPT\" BUTTON AT THE BOTTOM OF THIS AGREEMENT. IF LICENSEE IS NOT "
echo "WILLING TO BE BOUND BY ALL THE TERMS, SELECT THE \"DECLINE\" BUTTON "
echo "AT THE BOTTOM OF THE AGREEMENT AND THE DOWNLOAD OR INSTALL PROCESS "
echo "WILL NOT CONTINUE. "
echo ""
echo "1.0 DEFINITIONS "
echo ""
echo "\"Licensed Software\" means the Java USB API for Sun Ray Clients 1.0 "
echo "pre-release software in binary and/or source code forms, any other "
echo "machine readable materials (including, but not limited to, "
echo "libraries, source files, header files, and data files) and any user "
echo "manuals, programming guides and other documentation provided to "
echo "Licensee by Sun under this Agreement. "
printf "\nPress RETURN to continue: "
#read yn </dev/tty
echo ""
echo "2.0 LIMITED LICENSE "
echo ""
echo "2.1 Source Code. Sun grants to Licensee, a non-exclusive, "
echo "non-transferable, royalty-free and limited license to view the "
echo "source code portions of the Licensed Software internally for the "
echo "purposes of evaluation only."
echo ""
echo "2.2 Binary Code. Sun grants to Licensee, a non-exclusive, "
echo "non-transferable, royalty-free and limited license to use the "
echo "binary code portions of the Licensed Software internally for the "
echo "purposes of evaluation only."
echo ""
echo "2.3 No licenses are granted to Licensee for any other purposes, "
echo "Licensee may not sell, rent, loan or otherwise encumber or transfer "
echo "Licensed Software in whole or in part, to any third party."
echo ""
echo "3.0 LICENSE RESTRICTIONS "
echo ""
echo "3.1 Licensee may not duplicate Licensed Software other than for a "
echo "single copy of Licensed Software for archival purposes only. "
echo "Licensee agrees to reproduce any copyright and other proprietary "
printf "\nPress RETURN to continue: "
#read yn </dev/tty
echo "right notices on any such copy. "
echo ""
echo "3.2 Except as otherwise provided by law, Licensee may not modify or "
echo "create derivative works of the Licensed Software, or reverse "
echo "engineer, disassemble or decompile binary portions of the Licensed "
echo "Software, or otherwise attempt to derive the source code from such "
echo "portions. "
echo ""
echo "3.3 No right, title, or interest in or to Licensed Software, any "
echo "trademarks, service marks, or trade names of Sun or Sun's licensors "
echo "is granted under this Agreement. "
echo ""
echo "3.4 Licensee shall have no right to use the Licensed Software for "
echo "productive or commercial use."
echo ""
echo "4.0 NO SUPPORT "
echo ""
echo "Sun is under no obligation to support Licensed Software or to "
echo "provide Licensee with updates or error corrections (collectively "
echo "\"Software Updates\"). If Sun, at its sole option, supplies Software "
echo "Updates to Licensee, the Software Updates will be considered part "
echo "of Licensed Software, and subject to the terms of this Agreement. "
printf "\nPress RETURN to continue: "
#read yn </dev/tty
echo ""
echo "5.0 LICENSEE DUTIES "
echo ""
echo "Licensee agrees to evaluate and test the Software for use in "
echo "Licensee's software environment and provide feedback to Sun in a "
echo "manner reasonably requested by Sun. Any and all test results, error "
echo "data, reports or other information, feedback or materials made or "
echo "provided by Licensee relating to Software (collectively, "
echo "\"Feedback\") are the exclusive property of Sun and Licensee hereby "
echo "assigns all Feedback to Sun at no cost to Sun. Sun may use such "
echo "Feedback in any manner and for any purpose, without limitation, "
echo "liability or obligation to Licensee. "
echo ""
echo "6.0 TERM AND TERMINATION OF AGREEMENT "
echo ""
echo "6.1 This Agreement will commence on the date on which Licensee "
echo "receives Licensed Software (the \"Effective Date\") and will expire "
echo "ninety (90)days from the Effective Date, unless terminated earlier "
echo "as provided herein. "
echo ""
echo "6.2 Either party may terminate this Agreement upon ten (10) days' "
echo "written notice to the other party. However, Sun may terminate this "
printf "\nPress RETURN to continue: "
#read yn </dev/tty
echo "Agreement immediately should any Licensed Software become, or in "
echo "Sun's opinion be likely to become, the subject of a claim of "
echo "infringement of a patent, trade secret or copyright. "
echo ""
echo "6.3 Sun may terminate this Agreement immediately should Licensee "
echo "materially breach any of its provisions or take any action in "
echo "derogation of Sun's rights to the Confidential Information licensed "
echo "to Licensee. "
echo ""
echo "6.4 Upon termination or expiration of this Agreement, Licensee will "
echo "immediately cease use of and destroy Licensed Software, any copies "
echo "thereof and provide to Sun a written statement certifying that "
echo "Licensee has complied with the foregoing obligations. "
echo ""
echo "6.5 Rights and obligations under this Agreement which by their "
echo "nature should survive, will remain in effect after termination or "
echo "expiration hereof."
echo ""
echo "7.0 CONFIDENTIAL INFORMATION "
echo ""
echo "7.1 For purposes of this Agreement, \"Confidential Information\" "
echo "means: (i) business and technical information and any source code "
printf "\nPress RETURN to continue: "
#read yn </dev/tty
echo "or binary code, which Sun discloses to Licensee related to Licensed "
echo "Software; (ii) Licensee's feedback based on Licensed Software; and "
echo "(iii) the terms, conditions, and existence of this Agreement. "
echo "Licensee may not disclose or use Confidential Information, except "
echo "for the purposes specified in this Agreement. Licensee will protect "
echo "the Confidential Information with the same degree of care, but not "
echo "less than a reasonable degree of care, as Licensee uses to protect "
echo "its own Confidential Information. Licensee's obligations regarding "
echo "Confidential Information will expire no less than five (5) years "
echo "from the date of receipt of the Confidential Information, except "
echo "for Sun source code which will be protected in perpetuity. Licensee "
echo "agrees that Licensed Software contains Sun trade secrets. "
echo ""
echo "7.2 Notwithstanding any provisions contained in this Agreement "
echo "concerning nondisclosure and non-use of the Confidential "
echo "Information, the nondisclosure obligations of Section 7.1 will not "
echo "apply to any portion of Confidential Information that Licensee can "
echo "demonstrate in writing is: (i) now, or hereafter through no act or "
echo "failure to act on the part of Licensee becomes, generally known to "
echo "the general public; (ii) known to Licensee at the time of receiving "
echo "the Confidential Information without an obligation of "
echo "confidentiality; (iii) hereafter rightfully furnished to Licensee "
printf "\nPress RETURN to continue: "
#read yn </dev/tty
echo "by a third party without restriction on disclosure; or (iv) "
echo "independently developed by Licensee without any use of the "
echo "Confidential Information. "
echo ""
echo "7.3 Licensee must restrict access to Confidential Information to "
echo "its employees or contractors with a need for this access to perform "
echo "their employment or contractual obligations and who have agreed in "
echo "writing to be bound by a confidentiality obligation, which "
echo "incorporates the protections and restrictions substantially as set "
echo "forth in this Agreement."
echo ""
echo "8.0 DISCLAIMER OF WARRANTY "
echo ""
echo "8.1 Licensee acknowledges that Licensed Software may contain errors "
echo "and is not designed, licensed, or intended for use in the design, "
echo "construction, operation or maintenance of any nuclear facility "
echo "(\"High Risk Activities\"). Sun disclaims any express or implied "
echo "warranty of fitness for such uses. Licensee represents and warrants "
echo "to Sun that it will not use, distribute or license the Licensed "
echo "Software for High Risk Activities. "
echo ""
echo "8.2 LICENSED SOFTWARE IS PROVIDED \"AS IS\". ALL EXPRESS OR IMPLIED "
printf "\nPress RETURN to continue: "
#read yn </dev/tty
echo "CONDITIONS, REPRESENTATIONS, AND WARRANTIES, INCLUDING ANY IMPLIED "
echo "WARRANTY OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A "
echo "PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO "
echo "THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID."
echo ""
echo "9.0 LIMITATION OF LIABILITY "
echo ""
echo "9.1 Licensee acknowledges that the Licensed Software may be "
echo "experimental and that the Licensed Software may have defects or "
echo "deficiencies, which cannot or will not be corrected by Sun. "
echo "Licensee will hold Sun harmless from any claims based on Licensee's "
echo "use of the Licensed Software for any purposes other than those of "
echo "internal evaluation, and from any claims that later versions or "
echo "releases of any Licensed Software furnished to Licensee are "
echo "incompatible with the Licensed Software provided to Licensee under "
echo "this Agreement. "
echo ""
echo "9.2 To the extent not prohibited by law, in no event will Sun be "
echo "liable for any indirect, punitive, special, incidental or "
echo "consequential damage in connection with or arising out of this "
echo "Agreement (including loss of business, revenue, profits, use, data "
echo "or other economic advantage), however it arises, whether for breach "
printf "\nPress RETURN to continue: "
#read yn </dev/tty
echo "or in tort, even if Sun has been previously advised of the "
echo "possibility of such damage."
echo ""
echo "10.0 U.S. GOVERNMENT RESTRICTED RIGHTS "
echo ""
echo "If this Software is being acquired by or on behalf of the U.S. "
echo "Government or by a U.S. Government prime contractor or "
echo "subcontractor (at any tier), then the Government's rights in the "
echo "Software and accompanying documentation shall be only as set forth "
echo "in this license; this is in accordance with 48 C.F.R. 227.7202-4 "
echo "(for Department of Defense (DOD) acquisitions) and with 48 C.F.R. "
echo "2.101 and 12.212 (for non-DOD acquisitions). "
echo ""
echo "11.0 GENERAL TERMS "
echo ""
echo "11.1 Any action relating to or arising out of this Agreement will "
echo "be governed by California law and controlling U.S. federal law. The "
echo "U.N. Convention for the International Sale of Goods and the choice "
echo "of law rules of any jurisdiction will not apply. "
echo ""
echo "11.2 Licensed Software and technical data delivered under this "
echo "Agreement are subject to U.S. export control laws and may be "
printf "\nPress RETURN to continue: "
#read yn </dev/tty
echo "subject to export or import regulations in other countries. "
echo "Licensee agrees to comply strictly with all such laws and "
echo "regulations and acknowledges that it has the responsibility to "
echo "obtain such licenses to export, re-export or import as may be "
echo "required after delivery to Licensee. "
echo ""
echo "11.3 It is understood and agreed that, notwithstanding any other "
echo "provision of this Agreement, Licensee's breach of the provisions of "
echo "Section 7 of this Agreement will cause Sun irreparable damage for "
echo "which recovery of money damages would be inadequate, and that Sun "
echo "will therefore be entitled to seek timely injunctive relief to "
echo "protect Sun's rights under this Agreement in addition to any and "
echo "all remedies available at law. "
echo ""
echo "11.4 Neither party may assign or otherwise transfer any of its "
echo "rights or obligations under this Agreement, without the prior "
echo "written consent of the other party, except that Sun may assign this "
echo "Agreement to an affiliated company. "
echo ""
echo "11.5 This Agreement is the parties' entire agreement relating to "
echo "its subject matter. It supersedes all prior or contemporaneous oral "
echo "or written communications, proposals, conditions, representations "
printf "\nPress RETURN to continue: "
#read yn </dev/tty
echo "and warranties and prevails over any conflicting or additional "
echo "terms of any quote, order, acknowledgment, or other communication "
echo "between the parties relating to its subject matter, including any "
echo "Binary Code Licenses, Supplemental Terms, or other licenses "
echo "contained within Licensed Software. No modification to this "
echo "Agreement will be binding, unless in writing and signed by an "
echo "authorized representative of each party. "
echo ""
echo "(Form ID#011801) "
echo ""
echo ""

echo "Remove previous pcscd service (if any)"
svcadm disable pcscd
svccfg delete -f pcscd

echo "Cleaning up previous server run files"
rm -f /var/run/pcscd/pcscd.pid
rm -f /var/run/pcscd/fifo/*
rm -f /var/run/pcscd/pid/*

[ -L /usr/lib/libpcsclite.so ] && rm -f /usr/lib/libpcsclite.so

removef -f $PKGINST || exit 2
