michael@13: ## michael@13: ## openpkg.spec -- OpenPKG RPM Package Specification michael@428: ## Copyright (c) 2000-2012 OpenPKG GmbH michael@13: ## michael@428: ## This software is property of the OpenPKG GmbH, DE MUC HRB 160208. michael@428: ## All rights reserved. Licenses which grant limited permission to use, michael@428: ## copy, modify and distribute this software are available from the michael@428: ## OpenPKG GmbH. michael@13: ## michael@428: ## THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED michael@13: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@13: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@13: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@13: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@13: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@13: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@13: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@13: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@13: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@13: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@13: ## SUCH DAMAGE. michael@13: ## michael@13: michael@13: # NOTICE: This OpenPKG RPM specification is _very_ special, because michael@13: # it is used both for bootstrapping OpenPKG with its OpenPKG RPM and michael@13: # for regular builds of OpenPKG RPM in order to upgrade an existing michael@13: # installation. For this it has to interact correctly with the michael@13: # "openpkg.boot" script. See the documentation in the file "README" michael@13: # and the source of the companion script "openpkg.boot" for details, michael@13: # but do not touch anything here until you are 100% sure about what michael@13: # you are doing. In short: This script is allowed to use only a very michael@13: # restricted subset of the OpenPKG RPM functionality! michael@13: michael@13: # BUILD REQUIREMENTS: michael@13: # o any sh(1) michael@13: # o any tar(1) michael@13: # o any make(1) michael@13: # o any cc(1) michael@13: michael@13: # the used software versions michael@428: %define V_rpm_major 5.1 michael@428: %define V_rpm_minor 9 michael@428: %define V_popt 1.16 michael@428: %define V_db 4.7.25 michael@428: %define V_lua 5.1.4 michael@428: %define V_sqlite 3.6.17 michael@428: %define V_zlib 1.2.7 michael@428: %define V_bzip2 1.0.6 michael@428: %define V_beecrypt 4.2.1 michael@428: %define V_curl 7.26.0 michael@428: %define V_pcre 8.31 michael@428: %define V_make 3.82 michael@428: %define V_gzip 1.5 michael@428: %define V_patch 2.6.1 michael@428: %define V_tar 1.26 michael@428: %define V_bash 4.2 michael@428: %define V_bash_pl 29 michael@428: %define V_uuid 1.6.2 michael@428: %define V_config 20120627 michael@428: %define V_perl 5.16.0 michael@428: %define V_openssl 1.0.1c michael@428: %define V_xz 5.0.4 michael@428: %define V_shtool 2.0.8 michael@428: %define V_libarchive 3.0.3 michael@428: %define V_diffutils 3.2 michael@428: %define V_svs 1.1.0 michael@13: michael@13: # package information michael@13: Name: openpkg michael@428: Summary: OpenPKG Framework michael@428: URL: http://openpkg.org/ michael@428: Vendor: OpenPKG GmbH michael@428: Packager: OpenPKG GmbH michael@428: Distribution: OpenPKG michael@428: Class: BOOT michael@13: Group: Bootstrapping michael@428: License: Proprietary, Open Source michael@428: Version: 4.6.7 michael@429: Release: 20120800 michael@13: michael@428: # list of pristine upstream sources michael@250: Source0: ftp://ftp.gnu.org/gnu/patch/patch-%{V_patch}.tar.gz michael@13: Source1: ftp://ftp.cwru.edu/pub/bash/bash-%{V_bash}.tar.gz michael@13: Source2: ftp://ftp.gnu.org/gnu/make/make-%{V_make}.tar.gz michael@13: Source3: ftp://ftp.gnu.org/gnu/tar/tar-%{V_tar}.tar.gz michael@428: Source4: http://download.openpkg.org/components/versioned/config/config-%{V_config}.tar.gz michael@428: Source5: http://download.openpkg.org/components/derived/gzip/gzip-%{V_gzip}.tar michael@428: Source6: http://download.openpkg.org/components/derived/perl/perl-%{V_perl}-mini.tar.gz michael@428: Source7: http://rpm5.org/files/rpm/rpm-%{V_rpm_major}/rpm-%{V_rpm_major}.%{V_rpm_minor}.tar.gz michael@428: Source8: ftp://ftp.openssl.org/source/openssl-%{V_openssl}.tar.gz michael@428: Source9: ftp://ftp.ossp.org/pkg/lib/uuid/uuid-%{V_uuid}.tar.gz michael@428: Source10: http://curl.haxx.se/download/curl-%{V_curl}.tar.gz michael@428: Source11: http://switch.dl.sourceforge.net/beecrypt/beecrypt-%{V_beecrypt}.tar.gz michael@428: Source12: http://www.bzip.org/%{V_bzip2}/bzip2-%{V_bzip2}.tar.gz michael@428: Source13: http://www.zlib.net/zlib-%{V_zlib}.tar.gz michael@428: Source14: http://rpm5.org/files/popt/popt-%{V_popt}.tar.gz michael@428: Source15: http://www.sqlite.org/sqlite-%{V_sqlite}.tar.gz michael@428: Source16: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-%{V_pcre}.tar.gz michael@428: Source17: http://libarchive.googlecode.com/files/libarchive-%{V_libarchive}.tar.gz michael@428: Source18: ftp://ftp.gnu.org/gnu/diffutils/diffutils-%{V_diffutils}.tar.gz michael@428: Source19: ftp://ftp.ossp.org/pkg/tool/svs/svs-%{V_svs}.tar.gz michael@428: Source20: http://tukaani.org/xz/xz-%{V_xz}.tar.gz michael@428: michael@428: # list of local patches against pristine upstream sources michael@13: Source100: bash.patch michael@428: Source101: bash.patch.vendor michael@428: Source102: beecrypt.patch michael@428: Source103: make.patch michael@428: Source104: openssl.patch michael@428: Source105: perl.patch michael@428: Source106: tar.patch michael@428: Source107: rpm.patch michael@428: Source108: popt.patch michael@428: Source109: sqlite.patch michael@428: Source110: curl.patch michael@428: Source111: pcre.patch michael@428: Source112: diffutils.patch michael@428: Source113: libarchive.patch michael@428: Source114: patch.strnlen.c michael@428: Source115: patch.Makefile.in michael@428: Source116: xz.patch michael@428: Source117: zlib.patch michael@428: michael@428: # list of local sources michael@428: Source200: README michael@428: Source201: etc.prereq.sh michael@428: Source202: etc.usrgrp.sh michael@428: Source203: etc.wrapbin.sh michael@428: Source204: etc.wrapsrc.sh michael@428: Source205: dot.bash_login michael@428: Source206: dot.bashrc michael@428: Source207: dot.lsyncrc michael@428: Source208: local.README michael@428: Source209: lsync michael@428: Source210: lsync.8 michael@428: Source211: lsync.pod michael@428: Source212: man.sh michael@428: Source213: openpkg.1 michael@428: Source214: openpkg.boot michael@428: Source215: openpkg.com.pgp michael@428: Source216: openpkg.net.pgp michael@428: Source217: openpkg.org.pgp michael@428: Source218: openpkg.pod michael@428: Source219: openpkg.sh michael@428: Source220: rc michael@428: Source221: rc.8 michael@428: Source222: rc.conf michael@428: Source223: rc.func michael@428: Source224: rc.openpkg michael@428: Source225: rc.pod michael@428: Source226: release.8 michael@428: Source227: release.pod michael@428: Source228: release.sh michael@428: Source229: root.README michael@428: Source230: rpm-config.8 michael@428: Source231: rpm-config.pod michael@428: Source232: rpm-config.sh michael@428: Source233: rpmdb michael@428: Source234: rpmtool michael@428: Source235: rpmtool.8 michael@428: Source236: rpmtool.pod michael@428: Source237: shtool michael@428: Source238: shtool.sh michael@428: Source239: uuid.8 michael@428: Source240: uuid.pod michael@428: Source241: uuid.sh michael@428: Source242: rpmmacros michael@428: Source243: rpmpopt michael@428: Source244: curl.sh michael@428: Source245: index.pl michael@428: Source246: index.8 michael@428: Source247: index.pod michael@428: Source248: build.pl michael@428: Source249: build.8 michael@428: Source250: build.pod michael@428: Source251: makeproxy.pl michael@428: Source252: makeproxy.8 michael@428: Source253: lint-fsl.pl michael@428: Source254: lint-rc.pl michael@428: Source255: lint-rpm.pl michael@428: Source256: lint-spec.pl michael@428: Source257: dev.pl michael@428: Source258: dev.8 michael@428: Source259: dev.pod michael@428: Source260: openpkg.mk michael@428: Source261: openpkg.c michael@428: Source262: Makefile michael@428: Source263: mutex.c michael@428: Source264: mutex.mk michael@428: Source265: register.sh michael@428: Source266: register.pod michael@428: Source267: register.8 michael@428: Source268: rpm.sh michael@428: Source269: license.lua michael@428: Source270: license-BOOT.txt michael@428: Source271: license-COMMUNITY.txt michael@428: Source272: license-EVAL.txt michael@428: Source273: license-EXAMPLE.txt michael@428: Source274: license-PROMO.txt michael@428: Source275: license-RECOVERY.txt michael@428: Source276: license.sh michael@428: Source277: license.pod michael@428: Source278: license.8 michael@428: Source279: rpmlua michael@428: Source280: sea.sh michael@428: Source281: sea.pod michael@428: Source282: sea.8 michael@428: Source283: stack.sh michael@428: Source284: stack.pod michael@428: Source285: stack.8 michael@428: Source286: search.pl michael@428: Source287: search.pod michael@428: Source288: search.8 michael@428: Source289: mirror.pl michael@428: Source290: mirror.pod michael@428: Source291: mirror.8 michael@13: michael@13: # build information michael@13: BuildRoot: %{l_buildroot} michael@13: AutoReq: no michael@13: AutoReqProv: no michael@428: Provides: %{l_prefix} michael@13: Provides: OpenPKG michael@428: Provides: openpkg = %{release}-%{release} michael@13: michael@13: %description michael@428: This is the OpenPKG Framework, the so-called "bootstrap" package michael@428: of OpenPKG. OpenPKG is a cross-platform, self-contained, RPM-based michael@428: software packaging solution, targeting the flexible building of michael@428: software stacks on Unix platforms. The RPM Package Manager (RPM) michael@428: is the underlying, sophisticated and portable package management michael@428: tool which drives the automated building, installation, management michael@428: and deinstallation of all Unix software components in an OpenPKG michael@428: software stack. michael@13: michael@428: This OpenPKG package contains the following individual michael@428: software components (individual licenses listed in brackets): michael@428: OpenPKG Framework %(echo "%{version}" | awk '{ printf("%%-7s", $1); }') [Proprietary] michael@428: rpm5.org RPM %(echo "%{V_rpm_major}.%{V_rpm_minor}" | awk '{ printf("%%-7s", $1); }') [LGPL] michael@428: rpm5.org POPT %(echo "%{V_popt}" | awk '{ printf("%%-7s", $1); }') [LGPL] michael@428: BeeCrypt %(echo "%{V_beecrypt}" | awk '{ printf("%%-7s", $1); }') [LGPL] michael@428: Lua %(echo "%{V_lua}" | awk '{ printf("%%-7s", $1); }') [MIT] michael@428: Berkeley-DB %(echo "%{V_db}" | awk '{ printf("%%-7s", $1); }') [BSD/MIT] michael@428: SQLite %(echo "%{V_sqlite}" | awk '{ printf("%%-7s", $1); }') [Public-Domain] michael@428: PCRE %(echo "%{V_pcre}" | awk '{ printf("%%-7s", $1); }') [BSD/MIT] michael@428: ZLib %(echo "%{V_zlib}" | awk '{ printf("%%-7s", $1); }') [BSD/MIT] michael@428: XZ %(echo "%{V_xz}" | awk '{ printf("%%-7s", $1); }') [PD/LGPL/GPL] michael@428: GNU Bzip2 %(echo "%{V_bzip2}" | awk '{ printf("%%-7s", $1); }') [BSD/MIT] michael@428: GNU Gzip %(echo "%{V_gzip}" | awk '{ printf("%%-7s", $1); }') [GPL] michael@428: GNU Tar %(echo "%{V_tar}" | awk '{ printf("%%-7s", $1); }') [GPL] michael@428: GNU Patch %(echo "%{V_patch}" | awk '{ printf("%%-7s", $1); }') [GPL] michael@428: GNU Shtool %(echo "%{V_shtool}" | awk '{ printf("%%-7s", $1); }') [GPL] michael@428: GNU Make %(echo "%{V_make}" | awk '{ printf("%%-7s", $1); }') [GPL] michael@428: GNU Bash %(echo "%{V_bash}.%{V_bash_pl}" | awk '{ printf("%%-7s", $1); }') [GPL] michael@428: GNU DiffUtils %(echo "%{V_diffutils}" | awk '{ printf("%%-7s", $1); }') [GPL] michael@428: BSD libarchive %(echo "%{V_libarchive}" | awk '{ printf("%%-7s", $1); }') [BSD/MIT] michael@428: OSSP uuid %(echo "%{V_uuid}" | awk '{ printf("%%-7s", $1); }') [BSD/MIT] michael@428: OSSP svs %(echo "%{V_svs}" | awk '{ printf("%%-7s", $1); }') [BSD/MIT] michael@428: cURL %(echo "%{V_curl}" | awk '{ printf("%%-7s", $1); }') [BSD/MIT] michael@428: OpenSSL %(echo "%{V_openssl}" | awk '{ printf("%%-7s", $1); }') [BSD] michael@428: Perl %(echo "%{V_perl}" | awk '{ printf("%%-7s", $1); }') [Artistic] michael@13: michael@13: %track michael@13: prog openpkg:bash = { michael@13: version = %{V_bash} michael@13: url = ftp://ftp.cwru.edu/pub/bash/ michael@13: regex = bash-(__VER__)\.tar\.gz michael@13: } michael@13: prog openpkg:bzip2 = { michael@13: version = %{V_bzip2} michael@13: url = http://www.bzip.org/downloads.html michael@13: regex = bzip2-(__VER__)\.tar\.gz michael@13: } michael@13: prog openpkg:curl = { michael@13: version = %{V_curl} michael@13: url = http://curl.haxx.se/download/ michael@13: regex = curl-(__VER__)\.tar\.gz michael@13: } michael@428: prog openpkg:pcre = { michael@428: version = %{V_pcre} michael@428: url = ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ michael@428: regex = pcre-(__VER__)\.tar\.gz michael@428: } michael@13: prog openpkg:gzip = { michael@13: version = %{V_gzip} michael@13: url = ftp://ftp.gnu.org/gnu/gzip/ michael@13: regex = gzip-(__VER__)\.tar(\.gz)? michael@13: } michael@13: prog openpkg:make = { michael@13: version = %{V_make} michael@13: url = ftp://ftp.gnu.org/gnu/make/ michael@13: regex = make-(__VER__)\.tar\.gz michael@13: } michael@13: prog openpkg:patch = { michael@13: version = %{V_patch} michael@428: url = ftp://ftp.gnu.org/gnu/patch/ michael@13: regex = patch-(__VER__)\.tar\.gz michael@13: } michael@428: prog openpkg:popt = { michael@428: version = %{V_popt} michael@428: url = http://rpm5.org/files/popt/ michael@428: regex = popt-(\d+\.\d+)\.tar\.gz michael@428: } michael@13: prog openpkg:rpm = { michael@428: version = %{V_rpm_major}.%{V_rpm_minor} michael@428: url = http://rpm5.org/files/rpm/rpm-%{V_rpm_major}/ michael@428: regex = rpm-(\d+\.\d+[.ab]\d+)\.tar\.gz michael@13: } michael@13: prog openpkg:tar = { michael@13: version = %{V_tar} michael@13: url = ftp://ftp.gnu.org/gnu/tar/ michael@13: regex = tar-(__VER__)\.tar\.gz michael@13: } michael@13: prog openpkg:zlib = { michael@13: version = %{V_zlib} michael@13: url = http://www.zlib.net/ michael@13: regex = zlib-(__VER__)\.tar\.gz michael@13: } michael@428: prog openpkg:diffutils = { michael@428: version = %{V_diffutils} michael@428: url = ftp://alpha.gnu.org/gnu/diffutils/ michael@428: regex = diffutils-(__VER__)\.tar\.gz michael@428: } michael@428: prog openpkg:libarchive = { michael@428: version = %{V_libarchive} michael@428: url = http://code.google.com/p/libarchive/downloads/list michael@428: regex = libarchive-(__VER__)\.tar\.gz michael@428: } michael@13: prog openpkg:uuid = { michael@13: version = %{V_uuid} michael@13: url = ftp://ftp.ossp.org/pkg/lib/uuid/ michael@13: regex = uuid-(__VER__)\.tar\.gz michael@13: } michael@428: prog openpkg:svs = { michael@428: version = %{V_svs} michael@428: url = ftp://ftp.ossp.org/pkg/tool/svs/ michael@428: regex = svs-(__VER__)\.tar\.gz michael@428: } michael@13: prog openpkg:config = { michael@13: version = %{V_config} michael@428: url = http://download.openpkg.org/components/versioned/config/ michael@13: regex = config-(__VER__)\.tar\.gz michael@13: } michael@13: prog openpkg:beecrypt = { michael@13: version = %{V_beecrypt} michael@428: url = http://sourceforge.net/project/showfiles.php?group_id=8924&package_id=9007 michael@13: regex = beecrypt-(__VER__)\.tar\.gz michael@13: } michael@13: prog openpkg:perl = { michael@13: version = %{V_perl} michael@428: url = http://download.openpkg.org/components/derived/perl/ michael@13: regex = perl-(__VER__)-mini\.tar\.gz michael@13: } michael@13: prog openpkg:openssl = { michael@13: version = %{V_openssl} michael@13: url = ftp://ftp.openssl.org/source/ michael@13: regex = openssl-(\d+\.\d+\.\d+[a-z]?)\.tar\.gz michael@13: } michael@428: prog openpkg:lua = { michael@428: version = %{V_lua} michael@428: url = http://www.lua.org/download.html michael@428: regex = lua-(\d+\.\d+\.\d+)\.tar\.gz michael@13: } michael@428: prog openpkg:sqlite = { michael@428: version = %{V_sqlite} michael@428: url = http://www.sqlite.org/download.html michael@428: regex = sqlite-(\d+\.\d+\.\d+(?:\.\d+)?)\.tar\.gz michael@428: } michael@428: prog openpkg:xz = { michael@428: version = %{V_xz} michael@428: url = http://tukaani.org/xz/ michael@428: regex = xz-(\d+\.\d+\.\d+)\.tar\.gz michael@13: } michael@13: michael@13: %prep michael@13: # skip in bootstrap phase 2 (see openpkg.boot) michael@13: [ ".$OPENPKG_BOOT" = .1 ] && exit 0 michael@13: michael@13: # switch into a temporary build area michael@13: rm -rf openpkg-%{version} michael@13: mkdir openpkg-%{version} michael@13: cd openpkg-%{version} michael@13: rm -f .buildenv michael@13: touch .buildenv michael@13: michael@13: # provide a bootstrap alternative to %{SOURCE xxx} because else michael@13: # it is not possible to upgrade a newer OpenPKG RPM with an older michael@13: # OpenPKG RPM. michael@13: echo >>.buildenv 'SOURCE () {' michael@13: echo >>.buildenv ' if [ -f "%{_specdir}/$1" ]; then' michael@13: echo >>.buildenv ' echo "%{_specdir}/$1"' michael@13: echo >>.buildenv ' else' michael@13: echo >>.buildenv ' echo "%{_sourcedir}/$1"' michael@13: echo >>.buildenv ' fi' michael@13: echo >>.buildenv '}' michael@13: echo >>.buildenv 'VERBOSE () {' michael@13: echo >>.buildenv ' if [ -f "%{_specdir}/rpmtool" ]; then' michael@13: echo >>.buildenv ' echo "$*" | sh %{_specdir}/rpmtool msg' michael@13: echo >>.buildenv ' else' michael@13: echo >>.buildenv ' echo "$*" | sh %{_sourcedir}/rpmtool msg' michael@13: echo >>.buildenv ' fi' michael@13: echo >>.buildenv '}' michael@13: . ./.buildenv michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "PREPARATION: Determine Build Tool Paths"; set -x michael@13: michael@13: # determine path to shtool michael@13: shtool=`SOURCE shtool` michael@13: echo "shtool=$shtool" >>./.buildenv michael@13: michael@13: # determine development tools michael@13: # - bootstrapping: %{l_xxx} is set via sed(1) michael@13: # - upgrading new: %{l_xxx} is set via rpmmacros michael@13: # - upgrading old: %{l_xxx} is not set at all michael@13: michael@13: # manually make sure tar(1) is available michael@13: l_tar=""; export l_tar michael@13: [ ".%{?l_tar:set}" = .set ] && l_tar="%{l_tar}" michael@13: [ ".%{?use_tar:set}" = .set ] && l_tar="%{use_tar}" michael@13: if [ ".$l_tar" = . ]; then michael@13: l_tar=`sh $shtool path gtar tar` michael@13: if [ ".$l_tar" = . ]; then michael@13: echo "openpkg: prerequisite tool \`gtar' or \`tar' not found" michael@13: exit 1 michael@13: fi michael@13: fi michael@13: echo "l_tar=\"$l_tar\"; export l_tar" >>.buildenv michael@13: michael@13: # manually make sure make(1) is available michael@13: l_make=""; export l_make michael@13: [ ".%{?l_make:set}" = .set ] && l_make="%{l_make}" michael@13: [ ".%{?use_make:set}" = .set ] && l_make="%{use_make}" michael@13: if [ ".$l_make" = . ]; then michael@13: l_make=`sh $shtool path gmake make` michael@13: if [ ".$l_make" = . ]; then michael@13: echo "openpkg: prerequisite tool \`gmake' or \`make' not found" michael@13: exit 1 michael@13: fi michael@13: fi michael@13: echo "l_make=\"$l_make\"; export l_make" >>.buildenv michael@13: michael@13: # manually make sure cc(1) is available michael@13: l_cc=""; export l_cc michael@13: [ ".%{?l_cc:set}" = .set ] && l_cc="%{l_cc}" michael@13: [ ".%{?use_cc:set}" = .set ] && l_cc="%{use_cc}" michael@13: if [ ".$l_cc" = . ]; then michael@13: l_cc=`sh $shtool path gcc cc` michael@13: if [ ".$l_cc" = . ]; then michael@13: echo "openpkg: prerequisite tool \`gcc' or \`cc' not found" michael@13: exit 1 michael@13: fi michael@13: fi michael@13: echo "l_cc=\"$l_cc\"; export l_cc" >>.buildenv michael@13: michael@13: # manually make sure ar(1) is available michael@13: l_ar=""; export l_ar michael@13: [ ".%{?l_ar:set}" = .set ] && l_ar="%{l_ar}" michael@13: [ ".%{?use_ar:set}" = .set ] && l_ar="%{use_ar}" michael@13: if [ ".$l_ar" = . ]; then michael@13: l_ar=`sh $shtool path ar` michael@13: if [ ".$l_ar" = . ]; then michael@13: echo "openpkg: prerequisite tool \`ar' not found" michael@13: exit 1 michael@13: fi michael@13: fi michael@13: echo "l_ar=\"$l_ar\"; export l_ar" >>.buildenv michael@13: michael@13: # manually make sure ld(1) is available michael@13: l_ld=""; export l_ld michael@13: [ ".%{?l_ld:set}" = .set ] && l_ld="%{l_ld}" michael@13: [ ".%{?use_ld:set}" = .set ] && l_ld="%{use_ld}" michael@13: if [ ".$l_ld" = . ]; then michael@13: l_ld=`sh $shtool path ld` michael@13: if [ ".$l_ld" = . ]; then michael@13: echo "openpkg: prerequisite tool \`ld' not found" michael@13: exit 1 michael@13: fi michael@13: fi michael@13: echo "l_ld=\"$l_ld\"; export l_ld" >>.buildenv michael@13: michael@13: # manually make sure as(1) is available michael@13: l_as=""; export l_as michael@13: [ ".%{?l_as:set}" = .set ] && l_as="%{l_as}" michael@13: [ ".%{?use_as:set}" = .set ] && l_as="%{use_as}" michael@13: if [ ".$l_as" = . ]; then michael@13: l_as=`sh $shtool path as` michael@13: if [ ".$l_as" = . ]; then michael@13: echo "openpkg: prerequisite tool \`as' not found" michael@13: exit 1 michael@13: fi michael@13: fi michael@13: echo "l_as=\"$l_as\"; export l_as" >>.buildenv michael@13: michael@13: # manually make sure strip(1) is available or use a null replacement michael@13: l_strip=""; export l_strip michael@13: [ ".%{?l_strip:set}" = .set ] && l_strip="%{l_strip}" michael@13: [ ".%{?use_strip:set}" = .set ] && l_strip="%{use_strip}" michael@13: if [ ".$l_strip" = . ]; then michael@13: l_strip=`sh $shtool path strip ls` michael@13: if [ ".$l_strip" = . ]; then michael@13: echo "openpkg: prerequisite tool \`strip' not found" michael@13: exit 1 michael@13: fi michael@13: fi michael@13: echo "l_strip=\"$l_strip\"; export l_strip" >>.buildenv michael@13: michael@428: # determine path to etc.usrgrp.sh script michael@428: usrgrp=`SOURCE etc.usrgrp.sh` michael@13: echo "usrgrp=$usrgrp; export usrgrp" >>./.buildenv michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "PREPARATION: Determine OpenPKG User/Group Name/Id Pairs"; set -x michael@13: michael@13: # determine user/group name/id pairs michael@13: # - bootstrapping: %{l_[smrn]{usr,grp}} is set via sed(1) michael@13: # - upgrading new: %{l_[smrn]{usr,grp}} is set via rpmmacros michael@13: # - upgrading old: %{l_[smrn]{usr,grp}} is not set at all michael@13: susr=""; [ ".%{?l_susr:set}" = .set ] && susr="%{l_susr}" michael@13: sgrp=""; [ ".%{?l_sgrp:set}" = .set ] && sgrp="%{l_sgrp}" michael@13: musr=""; [ ".%{?l_musr:set}" = .set ] && musr="%{l_musr}" michael@13: mgrp=""; [ ".%{?l_mgrp:set}" = .set ] && mgrp="%{l_mgrp}" michael@13: rusr=""; [ ".%{?l_rusr:set}" = .set ] && rusr="%{l_rusr}" michael@13: rgrp=""; [ ".%{?l_rgrp:set}" = .set ] && rgrp="%{l_rgrp}" michael@13: nusr=""; [ ".%{?l_nusr:set}" = .set ] && nusr="%{l_nusr}" michael@13: ngrp=""; [ ".%{?l_ngrp:set}" = .set ] && ngrp="%{l_ngrp}" michael@13: # corresponding ids michael@13: suid=""; [ ".%{?l_suid:set}" = .set ] && suid="%{l_suid}" michael@13: sgid=""; [ ".%{?l_sgid:set}" = .set ] && sgid="%{l_sgid}" michael@13: muid=""; [ ".%{?l_muid:set}" = .set ] && muid="%{l_muid}" michael@13: mgid=""; [ ".%{?l_mgid:set}" = .set ] && mgid="%{l_mgid}" michael@13: ruid=""; [ ".%{?l_ruid:set}" = .set ] && ruid="%{l_ruid}" michael@13: rgid=""; [ ".%{?l_rgid:set}" = .set ] && rgid="%{l_rgid}" michael@13: nuid=""; [ ".%{?l_nuid:set}" = .set ] && nuid="%{l_nuid}" michael@13: ngid=""; [ ".%{?l_ngid:set}" = .set ] && ngid="%{l_ngid}" michael@13: # compat: michael@13: usr=""; [ ".%{?l_fsusr:set}" = .set ] && usr="%{l_fsusr}" michael@13: grp=""; [ ".%{?l_fsgrp:set}" = .set ] && grp="%{l_fsgrp}" michael@13: eval `sh $usrgrp \ michael@13: --usr="$usr" --grp="$grp" \ michael@13: --susr="$susr" --sgrp="$sgrp" \ michael@13: --musr="$musr" --mgrp="$mgrp" \ michael@13: --rusr="$rusr" --rgrp="$rgrp" \ michael@13: --nusr="$nusr" --ngrp="$ngrp" \ michael@13: --suid="$suid" --sgid="$sgid" \ michael@13: --muid="$muid" --mgid="$mgid" \ michael@13: --ruid="$ruid" --rgid="$rgid" \ michael@13: --nuid="$nuid" --ngid="$ngid"` michael@13: echo "susr=\"$susr\"; export susr" >>.buildenv michael@13: echo "sgrp=\"$sgrp\"; export sgrp" >>.buildenv michael@13: echo "musr=\"$musr\"; export musr" >>.buildenv michael@13: echo "mgrp=\"$mgrp\"; export mgrp" >>.buildenv michael@13: echo "rusr=\"$rusr\"; export rusr" >>.buildenv michael@13: echo "rgrp=\"$rgrp\"; export rgrp" >>.buildenv michael@13: echo "nusr=\"$nusr\"; export nusr" >>.buildenv michael@13: echo "ngrp=\"$ngrp\"; export ngrp" >>.buildenv michael@13: echo "suid=\"$suid\"; export suid" >>.buildenv michael@13: echo "sgid=\"$sgid\"; export sgid" >>.buildenv michael@13: echo "muid=\"$muid\"; export muid" >>.buildenv michael@13: echo "mgid=\"$mgid\"; export mgid" >>.buildenv michael@13: echo "ruid=\"$ruid\"; export ruid" >>.buildenv michael@13: echo "rgid=\"$rgid\"; export rgid" >>.buildenv michael@13: echo "nuid=\"$nuid\"; export nuid" >>.buildenv michael@13: echo "ngid=\"$ngid\"; export ngid" >>.buildenv michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "PREPARATION: Determine OpenPKG Instance Environment"; set -x michael@13: michael@13: # determine installation location id michael@13: if [ ".%{?l_tag_fmt:set}" = .set ]; then michael@13: tag="%{l_tag_fmt}" michael@13: else michael@13: tag="" michael@13: fi michael@13: echo "tag=\"$tag\"; export tag" >>.buildenv michael@13: michael@13: # determine platform id michael@13: s=`(uname -s) 2>/dev/null` || s='Unknown' michael@13: r=`(uname -r) 2>/dev/null` || r='0.0' michael@13: plid="${s}/${r}" michael@13: echo "plid=\"$plid\"; export plid" >>.buildenv michael@13: michael@13: # determine platform-specific build environment michael@13: case $plid in michael@13: FreeBSD/* ) l_build_path="/bin:/sbin:/usr/bin:/usr/sbin" ;; michael@13: NetBSD/* ) l_build_path="/bin:/sbin:/usr/bin:/usr/sbin" ;; michael@13: Linux/* ) l_build_path="/bin:/sbin:/usr/bin:/usr/sbin" ;; michael@13: SunOS/* ) l_build_path="/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin" ;; michael@13: UnixWare/*) l_build_path="/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin" ;; michael@13: AIX/* ) l_build_path="/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin" ;; michael@13: Darwin/* ) l_build_path="/bin:/sbin:/usr/bin:/usr/sbin" ;; michael@13: OSF1/V5.* ) l_build_path="/bin:/sbin:/usr/bin:/usr/sbin" ;; michael@13: HP-UX/* ) l_build_path="/bin:/sbin:/usr/bin:/usr/sbin" ;; michael@13: IRIX*/6.* ) l_build_path="/bin:/sbin:/usr/bin:/usr/sbin" ;; michael@428: CYGWIN*/* ) l_build_path="/bin:/usr/bin:/usr/sbin" ;; michael@13: * ) l_build_path="/bin:/sbin:/usr/bin:/usr/sbin" ;; michael@13: esac michael@13: case $plid in michael@13: FreeBSD/* ) l_build_ldlp="/lib:/usr/lib" ;; michael@13: NetBSD/* ) l_build_ldlp="/lib:/usr/lib" ;; michael@13: Linux/* ) l_build_ldlp="/lib:/usr/lib" ;; michael@13: SunOS/* ) l_build_ldlp="/usr/lib:/usr/ccs/lib" ;; michael@13: UnixWare/*) l_build_ldlp="/usr/lib:/usr/ccs/lib" ;; michael@13: AIX/* ) l_build_ldlp="/usr/lib:/usr/ccs/lib" ;; michael@13: Darwin/* ) l_build_ldlp="/usr/lib" ;; michael@13: OSF1/V5.* ) l_build_ldlp="/usr/lib" ;; michael@13: HP-UX/* ) l_build_ldlp="/usr/lib" ;; michael@13: IRIX*/6.* ) l_build_ldlp="/usr/lib" ;; michael@428: CYGWIN*/* ) l_build_ldlp="/lib:/usr/lib" ;; michael@13: * ) l_build_ldlp="/usr/lib" ;; michael@13: esac michael@13: case $plid in michael@13: * ) l_build_ulim=":" ;; michael@13: esac michael@13: echo "l_build_path=\"$l_build_path\"; export l_build_path" >>.buildenv michael@13: echo "l_build_ldlp=\"$l_build_ldlp\"; export l_build_ldlp" >>.buildenv michael@13: echo "l_build_ulim=\"$l_build_ulim\"; export l_build_ulim" >>.buildenv michael@13: michael@428: # ACTIVATE AGAIN AFTER ALL 4.2.5 VERSIONS WERE UPGRADED TO AT LEAST 4.2.7 michael@428: # determine status of unprivileged operation michael@428: if [ ".%{?l_unprivileged:set}" = .set ]; then michael@428: l_unprivileged="%{l_unprivileged}" michael@428: else michael@428: l_unprivileged="no" michael@428: fi michael@428: echo "l_unprivileged=\"$l_unprivileged\"; export l_unprivileged" >>.buildenv michael@428: michael@13: # display verbosity header michael@13: set +x; VERBOSE "PREPARATION: Build GNU gzip (Compression Tool)"; set -x michael@13: michael@13: # bootstrap GNU zip tool michael@13: ${l_tar} xf `SOURCE gzip-%{V_gzip}.tar` 2>/dev/null || true michael@13: ( cd gzip-%{V_gzip} michael@428: ( echo "ac_cv_prog_cc_g=no" michael@428: echo "ac_cv_header_getopt_h=no" michael@428: ) >config.cache michael@13: case $plid in michael@13: Darwin/* ) echo "gzip_cv_assembler=no" >>config.cache ;; michael@13: esac michael@13: CC="${l_cc}" \ michael@13: GREP="grep" \ michael@13: ./configure \ michael@13: --cache-file=./config.cache michael@13: ${l_make} || exit $? michael@13: ( mv gzip ..; ${l_make} clean || true; mv ../gzip . ) || exit $? michael@13: ) || exit $? michael@13: l_gzip="`pwd`/gzip-%{V_gzip}/gzip"; export l_gzip michael@13: echo "l_gzip=\"$l_gzip\"; export l_gzip" >>.buildenv michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "PREPARATION: Unpack GNU configuration guessing utilities"; set -x michael@13: michael@13: # unpack GNU config.guess michael@13: ${l_gzip} -dc `SOURCE config-%{V_config}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "PREPARATION: Build GNU patch (Source Patching Tool)"; set -x michael@13: michael@13: # bootstrap GNU patch tool michael@13: ${l_gzip} -dc `SOURCE patch-%{V_patch}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: ( cd patch-%{V_patch} michael@428: chmod a+x install-sh michael@428: echo '#!' >update-version.sh michael@428: cp `SOURCE patch.Makefile.in` Makefile.in michael@428: cp `SOURCE patch.strnlen.c` gl/lib/strnlen.c michael@13: ( echo 'ac_cv_func_setmode=${ac_cv_func_setmode=no}' michael@13: echo 'ac_cv_prog_cc_g=no' michael@13: false=`sh $shtool path false` michael@13: echo "ac_cv_path_ed_PROGRAM=\${ac_cv_path_ed_PROGRAM=$false}" michael@13: ) >config.cache michael@13: CC="${l_cc}" \ michael@13: ./configure \ michael@13: --cache-file=./config.cache \ michael@428: --enable-merge \ michael@13: --disable-largefile michael@13: ${l_make} || exit $? michael@250: ( mv src/patch ..; ${l_make} clean || true; mv ../patch . ) || exit $? michael@13: ) || exit $? michael@13: l_patch="`pwd`/patch-%{V_patch}/patch"; export l_patch michael@428: case `sh $shtool platform -n -L -S "" -C "+" -F "%-%"` in michael@428: *-cygwin* ) michael@428: # Cygwin under Windows Vista dislikes executables with michael@428: # "patch" in the same and would require a "*.manifest" michael@428: # file applied with the "mt.exe" from the "Windows michael@428: # Software Development Kit (SDK)" in order to escape from michael@428: # UAC. An easy alternative is to just rename the file to a michael@428: # different name. michael@428: mv patch-%{V_patch}/patch patch-%{V_patch}/pitch michael@428: l_patch="`pwd`/patch-%{V_patch}/pitch" michael@428: ;; michael@428: esac michael@13: echo "l_patch=\"$l_patch\"; export l_patch" >>.buildenv michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "BUILD: Build GNU tar (Archiving Tool)"; set -x michael@13: michael@13: # build GNU tar tool michael@13: ${l_gzip} -dc `SOURCE tar-%{V_tar}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: ( cd tar-%{V_tar} michael@13: ${l_patch} -p0 <`SOURCE tar.patch` michael@13: ( echo 'am_cv_func_iconv=no' michael@13: echo 'am_cv_lib_iconv=no' michael@13: echo 'ac_cv_lib_iconv_iconv=no' michael@13: echo 'ac_cv_header_iconv_h=no' michael@13: echo 'ac_cv_type_iconv_t=no' michael@13: ) >config.cache michael@13: CC="${l_cc}" \ michael@13: MAKEINFO="true" \ michael@13: GREP="grep" \ michael@428: FORCE_UNSAFE_CONFIGURE=1 \ michael@13: ./configure \ michael@13: --cache-file=./config.cache \ michael@13: --prefix=%{l_prefix} \ michael@428: --with-gzip=%{l_prefix}/lib/openpkg/gzip \ michael@428: --with-bzip2=%{l_prefix}/lib/openpkg/bzip2 \ michael@13: --disable-nls michael@13: ${l_make} || exit $? michael@13: ( mv src/tar ..; ${l_make} clean || true; mv ../tar . ) || exit $? michael@13: ) || exit $? michael@13: l_tar="`pwd`/tar-%{V_tar}/tar"; export l_tar michael@13: echo "l_tar=\"$l_tar\"; export l_tar" >>.buildenv michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "PREPARATION: Unpack Distribution Tarballs"; set -x michael@13: michael@13: # unpack distribution tarballs michael@428: ${l_gzip} -dc `SOURCE rpm-%{V_rpm_major}.%{V_rpm_minor}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@428: ${l_gzip} -dc `SOURCE popt-%{V_popt}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@428: ${l_gzip} -dc `SOURCE sqlite-%{V_sqlite}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: ${l_gzip} -dc `SOURCE zlib-%{V_zlib}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: ${l_gzip} -dc `SOURCE bzip2-%{V_bzip2}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@428: ${l_gzip} -dc `SOURCE xz-%{V_xz}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: ${l_gzip} -dc `SOURCE curl-%{V_curl}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@428: ${l_gzip} -dc `SOURCE pcre-%{V_pcre}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: ${l_gzip} -dc `SOURCE make-%{V_make}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: ${l_gzip} -dc `SOURCE bash-%{V_bash}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: ${l_gzip} -dc `SOURCE uuid-%{V_uuid}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: ${l_gzip} -dc `SOURCE beecrypt-%{V_beecrypt}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: ${l_gzip} -dc `SOURCE perl-%{V_perl}-mini.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: ${l_gzip} -dc `SOURCE openssl-%{V_openssl}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@428: ${l_gzip} -dc `SOURCE libarchive-%{V_libarchive}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@428: ${l_gzip} -dc `SOURCE diffutils-%{V_diffutils}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@428: ${l_gzip} -dc `SOURCE svs-%{V_svs}.tar.gz` | ${l_tar} xf - 2>/dev/null || true michael@13: michael@13: # update config.guess/config.sub michael@428: for dir in curl-%{V_curl} make-%{V_make} bash-%{V_bash}/support; do michael@13: chmod u+w $dir/config.guess $dir/config.sub >/dev/null 2>&1 || true michael@13: cp config/config.guess $dir/ michael@13: cp config/config.sub $dir/ michael@13: done michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "PREPARATION: Apply OpenPKG Patches to Distributions"; set -x michael@13: michael@13: # apply OpenPKG patches to distribution trees michael@428: ( cd rpm-%{V_rpm_major}.%{V_rpm_minor} michael@428: sed -e "s;@l_prefix@;%{l_prefix};g" <`SOURCE rpm.patch` | ${l_patch} -p0 michael@13: ) || exit $? michael@13: ( cd make-%{V_make} michael@13: ${l_patch} -p0 <`SOURCE make.patch` michael@13: ) || exit $? michael@13: ( cd bash-%{V_bash} michael@13: ${l_patch} -p0 <`SOURCE bash.patch` michael@428: ${l_patch} -p0 <`SOURCE bash.patch.vendor` michael@13: sleep 1 michael@13: touch y.tab.[ch] michael@13: touch configure config.h.in michael@13: ) || exit $? michael@13: ( cd beecrypt-%{V_beecrypt} michael@13: ${l_patch} -p0 <`SOURCE beecrypt.patch` michael@13: ) || exit $? michael@13: ( cd perl-%{V_perl} michael@13: ${l_patch} -p0 <`SOURCE perl.patch` michael@13: ) || exit $? michael@13: ( cd openssl-%{V_openssl} michael@13: ${l_patch} -p0 <`SOURCE openssl.patch` michael@13: ) || exit $? michael@428: ( cd popt-%{V_popt} michael@428: ${l_patch} -p0 <`SOURCE popt.patch` michael@428: ) || exit $? michael@428: ( cd sqlite-%{V_sqlite} michael@428: ${l_patch} -p0 <`SOURCE sqlite.patch` michael@428: ) || exit $? michael@428: ( cd curl-%{V_curl} michael@428: ${l_patch} -p0 <`SOURCE curl.patch` michael@428: ) || exit $? michael@428: ( cd pcre-%{V_pcre} michael@428: ${l_patch} -p0 <`SOURCE pcre.patch` michael@428: ) || exit $? michael@428: ( cd diffutils-%{V_diffutils} michael@428: ${l_patch} -p0 <`SOURCE diffutils.patch` michael@428: ) || exit $? michael@428: ( cd libarchive-%{V_libarchive} michael@428: ${l_patch} -p0 <`SOURCE libarchive.patch` michael@428: ) || exit $? michael@428: ( cd zlib-%{V_zlib} michael@428: ${l_patch} -p0 <`SOURCE zlib.patch` michael@428: ) || exit $? michael@428: ( cd xz-%{V_xz} michael@428: ${l_patch} -p0 <`SOURCE xz.patch` michael@428: ) || exit $? michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "PREPARATION: Build GNU make (Build Tool)"; set -x michael@13: michael@13: # bootstrap GNU make tool michael@13: ( cd make-%{V_make} michael@13: CC="${l_cc}" \ michael@13: ./configure \ michael@13: --without-libiconv-prefix \ michael@13: --without-libintl-prefix \ michael@13: --disable-nls \ michael@13: --disable-largefile michael@13: ${l_make} michael@13: ( mv make ..; ${l_make} clean || true; mv ../make . ) || exit $? michael@13: ) || exit $? michael@13: l_make="`pwd`/make-%{V_make}/make"; export l_make michael@13: echo "l_make=\"$l_make\"; export l_make" >>.buildenv michael@13: michael@13: %build michael@13: # skip in bootstrap phase 2 (see openpkg.boot) michael@13: [ ".$OPENPKG_BOOT" = .1 ] && exit 0 michael@13: michael@13: # switch into a temporary build area michael@13: cd openpkg-%{version} michael@13: . ./.buildenv michael@13: michael@434: # force usage of proper architecture parameter michael@434: bitopt= michael@434: case `sh $shtool platform -n -L -S "" -C "+" -F "%-%"` in michael@434: amd64-* ) bitopt=-m64 ;; michael@434: ia64-* ) bitopt=-m64 ;; michael@434: sparc64-* ) bitopt=-m64 ;; michael@434: esac michael@434: michael@13: # display verbosity header michael@13: set +x; VERBOSE "BUILD: Build GNU bash (Bourne-Again Shell)"; set -x michael@13: michael@13: # build GNU bash tool michael@13: ( cd bash-%{V_bash} michael@13: sh $shtool subst \ michael@13: -e 's;@l_openpkg_release@;OpenPKG;' \ michael@13: version.c michael@13: ( # force disabled wide-character support michael@13: echo "ac_cv_header_wchar_h=no" michael@13: echo "ac_cv_header_wctype_h=no" michael@13: echo "ac_cv_func_mbsrtowcs=no" michael@13: # force disabled internationalization support michael@13: echo "ac_cv_header_libintl_h=no" michael@13: echo "ac_cv_func_gettext=no" michael@13: echo "ac_cv_func_textdomain=no" michael@13: echo "ac_cv_func_bindtextdomain=no" michael@13: echo "ac_cv_lib_intl_bindtextdomain=no" michael@13: # disable building with debug symbols michael@13: echo "ac_cv_prog_cc_g=no" michael@13: ) >config.cache michael@428: AUTOCONF="true" michael@428: export AUTOCONF michael@428: CC="${l_cc}" michael@428: export CC michael@434: CCFLAGS_FOR_BUILD="$bitopt -O" \ michael@434: export CCFLAGS_FOR_BUILD michael@428: case "$plid" in michael@434: Darwin/* ) LDFLAGS="$bitopt -Wl,-search_paths_first" ;; michael@428: esac michael@13: ./configure \ michael@13: --cache-file=./config.cache \ michael@13: --prefix=%{l_prefix} \ michael@13: --without-curses \ michael@13: --without-gnu-malloc \ michael@13: --disable-nls michael@13: ${l_make} || exit $? michael@13: ( mv bash ..; ${l_make} clean || true; mv ../bash . ) || exit $? michael@13: ) || exit $? michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "BUILD: Build GNU bzip2 (Compression Library)"; set -x michael@13: michael@13: # build BZIP2 library michael@13: ( cd bzip2-%{V_bzip2} michael@434: ${l_make} CC="${l_cc}" CFLAGS="$bitopt -O" libbz2.a bzip2 || exit $? michael@13: ( echo "# libbz2.la - a libtool library file" michael@13: echo "# Generated by ltmain.sh - GNU libtool x.x.x" michael@13: echo "dlname=''" michael@13: echo "library_names=''" michael@13: echo "old_library='libbz2.a'" michael@13: echo "dependency_libs=''" michael@13: echo "current=0" michael@13: echo "age=0" michael@13: echo "revision=0" michael@13: echo "installed=no" michael@13: echo "dlopen=''" michael@13: echo "dlpreopen=''" michael@13: echo "libdir='%{l_prefix}'" michael@13: ) >libbz2.la michael@13: ln -s . .libs michael@13: ) || exit $? michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "BUILD: Build Zlib (Compression Library)"; set -x michael@13: michael@13: # build ZLIB library michael@13: ( cd zlib-%{V_zlib} michael@434: CC="${l_cc}" CFLAGS="$bitopt -O" ./configure michael@13: ${l_make} CC="${l_cc}" libz.a || exit $? # intentionally do not pass CFLAGS here michael@13: ) || exit $? michael@13: michael@13: # display verbosity header michael@428: set +x; VERBOSE "BUILD: Build XZ (Compression Library)"; set -x michael@428: michael@428: # build XZ library michael@428: ( cd xz-%{V_xz} michael@428: opts="" michael@428: case "$plid" in michael@428: Darwin/* ) opts="--disable-assembler" ;; michael@428: esac michael@428: CC="${l_cc}" \ michael@434: CFLAGS="$bitopt -O" \ michael@428: ./configure \ michael@428: --prefix=%{l_prefix} \ michael@429: --libdir="%{l_prefix}/lib" \ michael@428: --mandir=%{l_prefix}/man \ michael@428: --without-libiconv-prefix \ michael@428: --without-libintl-prefix \ michael@428: --disable-nls \ michael@428: --disable-shared \ michael@428: $opts michael@428: ${l_make} || exit $? michael@428: ) || exit $? michael@428: michael@428: # display verbosity header michael@13: set +x; VERBOSE "BUILD: Build OSSP uuid (UUID Generation Tool)"; set -x michael@13: michael@13: # build OSSP uuid tool michael@13: ( cd uuid-%{V_uuid} michael@13: CC="${l_cc}" \ michael@434: CFLAGS="$bitopt -O" \ michael@434: LDFLAGS="$bitopt" \ michael@13: GREP="grep" \ michael@13: ./configure \ michael@13: --prefix=%{l_prefix} \ michael@13: --disable-shared michael@13: ${l_make} || exit $? michael@13: ) || exit $? michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "BUILD: Build Perl (Programming Language)"; set -x michael@13: michael@13: # build Perl tool michael@13: ( cd perl-%{V_perl} michael@13: chmod -R u+w . michael@13: sh $shtool subst \ michael@13: -e 's;\(.*for thislib in $libswanted.*\);libswanted=`echo " $libswanted " | sed -e "s/ bind / /g" -e "s/ db / /g" -e "s/ gdbm / /g" -e "s/ iconv / /g"`\; \1;' \ michael@13: -e 's;package=perl5;package=perl;' \ michael@13: Configure michael@13: sh $shtool subst \ michael@13: -e 's; */usr/local/lib;;' \ michael@13: hints/freebsd.sh hints/netbsd.sh michael@13: libdirs="" michael@13: for dir in %{l_prefix}/lib /lib64 /usr/lib64 /lib /usr/lib /usr/ccs/lib; do michael@13: [ -d $dir ] && libdirs="$libdirs $dir" michael@13: done michael@13: ./Configure \ michael@13: -d -e -s \ michael@13: -Dprefix=%{l_prefix} \ michael@13: -Dvendorprefix=%{l_prefix} \ michael@13: -Dinstallprefix=%{l_prefix} \ michael@13: -Dinstallstyle="lib/perl5" \ michael@13: -Dman1dir=%{l_prefix}/man/man1 \ michael@13: -Dman3dir=%{l_prefix}/man/man3 \ michael@13: -Dcc="${l_cc}" -Uoptimize \ michael@13: -Dlocincpth="%{l_prefix}/include" \ michael@13: -Dloclibpth="%{l_prefix}/lib" \ michael@13: -Dldflags="-L""%{l_prefix}/lib" \ michael@13: -Dlibpth="$libdirs" \ michael@13: -Dglibpth="$libdirs" \ michael@13: -Dscriptdir="%{l_prefix}/bin" \ michael@13: -Uinstallusrbinperl \ michael@13: -Adefine:useshrplib='false' \ michael@13: -Ui_malloc -Ui_iconv -Ui_db michael@428: case `sh $shtool platform -n -L -S "" -C "+" -F "%-%"` in michael@428: *-cygwin* ) miniperl="miniperl.exe" ;; michael@428: * ) miniperl="miniperl" ;; michael@428: esac michael@428: ${l_make} $miniperl || exit $? michael@13: rm -f *.o >/dev/null 2>&1 || true michael@13: ) || exit $? michael@13: l_perl="`pwd`/perl-%{V_perl}/miniperl"; export l_perl michael@13: echo "l_perl=\"$l_perl\"; export l_perl" >>.buildenv michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "BUILD: Build OpenSSL (Crypography and SSL/TLS Toolkit)"; set -x michael@13: michael@13: # build OpenSSL toolkit michael@13: ( cd openssl-%{V_openssl} michael@13: sh $shtool subst \ michael@13: -e 's;-m486;-march=i486;g' \ michael@13: -e 's;BN_LLONG *;;' \ michael@13: Configure michael@13: sh $shtool subst \ michael@13: -e 's;test "$OSTYPE" = msdosdjgpp;true;' \ michael@13: util/point.sh michael@13: sh $shtool subst \ michael@13: -e "1s;^.*\$;#!$l_perl;" \ michael@13: Configure `find . -name "*.pl" -print` michael@434: sh $shtool subst \ michael@434: -e 's;xarch=amd64;m64;g' \ michael@434: Configure michael@13: opts="" michael@13: case `sh $shtool platform -n -L -S "" -C "+" -F "%-%"` in michael@13: *-solaris* ) opts="-lnsl -lsocket" ;; michael@13: esac michael@13: case `sh $shtool platform -n -L -S "" -C "+" -F "%-%"` in michael@13: amd64-* ) opts="$opts -fPIC" ;; michael@13: ia64-* ) opts="$opts -fPIC" ;; michael@13: sparc64-freebsd* ) opts="$opts -fPIC" ;; michael@13: esac michael@13: CC="${l_cc}" \ michael@13: PERL="${l_perl}" \ michael@13: ./config \ michael@13: --prefix=%{l_prefix} \ michael@13: no-asm no-shared no-dso \ michael@13: no-zlib no-idea no-threads no-krb5 no-hw \ michael@13: $opts michael@13: ${l_make} CC="${l_cc}" build_libs build_apps || exit $? michael@13: ( mkdir lib; cd lib; ln -s ../lib*.a . ) || exit $? michael@13: ) || exit $? michael@13: michael@428: # build BSD libarchive michael@428: ( cd libarchive-%{V_libarchive} michael@438: sh $shtool subst \ michael@438: -e 's;\(AM_CFLAGS =\) -Wall;\1;' \ michael@438: Makefile.in michael@428: CC="${l_cc}" \ michael@434: CFLAGS="$bitopt -O -D_POSIX_PTHREAD_SEMANTICS" \ michael@428: CPPFLAGS="-I`pwd`/../zlib-%{V_zlib} -I`pwd`/../bzip2-%{V_bzip2} -I`pwd`/../xz-%{V_xz}/src/liblzma/api -I`pwd`/../openssl-%{V_openssl}/include" \ michael@434: LDFLAGS="$bitopt -L`pwd`/../zlib-%{V_zlib} -L`pwd`/../bzip2-%{V_bzip2} -L`pwd`/../xz-%{V_xz}/src/liblzma/.libs -L`pwd`/../openssl-%{V_openssl}" \ michael@428: GREP="grep" \ michael@428: ./configure \ michael@428: --prefix=%{l_prefix} \ michael@429: --libdir="%{l_prefix}/lib" \ michael@428: --enable-bsdtar \ michael@428: --enable-bsdcpio \ michael@428: --with-zlib \ michael@428: --with-bz2lib \ michael@428: --with-lzma \ michael@428: --without-lzmadec \ michael@428: --with-openssl \ michael@428: --without-xml2 \ michael@428: --without-expat \ michael@428: --without-iconv \ michael@428: --disable-shared michael@428: ${l_make} || exit $? michael@428: ( mv bsdcpio bsdtar ..; ${l_make} clean || true; mv ../bsdcpio ../bsdtar . ) || exit $? michael@428: ) || exit $? michael@428: michael@428: # build GNU diffutils michael@428: ( cd diffutils-%{V_diffutils} michael@428: CC="${l_cc}" \ michael@434: CFLAGS="$bitopt -O" \ michael@428: ./configure \ michael@428: --prefix=%{l_prefix} \ michael@428: --disable-nls michael@439: touch man/diff.1 man/diff3.1 && ${l_make} || exit $? michael@428: ( mv src/diff src/diff3 src/sdiff src/cmp .. michael@428: ${l_make} clean || true michael@428: mv ../diff ../diff3 ../sdiff ../cmp . michael@428: ) || exit $? michael@428: ) || exit $? michael@428: michael@13: # display verbosity header michael@13: set +x; VERBOSE "BUILD: Build cURL (URL Fetching Tool)"; set -x michael@13: michael@13: # build cURL tool michael@13: ( cd curl-%{V_curl} michael@13: ( echo 'ac_cv_header_openssl_engine_h=no' michael@13: echo 'lt_cv_prog_compiler_c_o_F77=no' michael@13: echo 'lt_cv_sys_max_cmd_len=100' michael@13: ) >config.cache michael@13: CC="${l_cc}" \ michael@434: CFLAGS="$bitopt -I`pwd`/../zlib-%{V_zlib}" \ michael@13: CPPFLAGS="-I`pwd`/../zlib-%{V_zlib}" \ michael@434: LDFLAGS="$bitopt -L`pwd`/../zlib-%{V_zlib}" \ michael@13: GREP="grep" \ michael@13: ./configure \ michael@13: --cache-file=./config.cache \ michael@429: --libdir="%{l_prefix}/lib" \ michael@13: --without-libidn \ michael@13: --disable-shared \ michael@13: --disable-thread \ michael@13: --disable-ipv6 \ michael@13: --disable-ldap \ michael@13: --with-zlib=`pwd`/../zlib-%{V_zlib} \ michael@13: --with-ssl=`pwd`/../openssl-%{V_openssl} \ michael@13: --with-ca-bundle=%{l_prefix}/etc/openpkg/openpkg.x509 michael@13: ${l_make} || exit $? michael@428: mv src/curl ..; ${l_make} clean || true; mv ../curl . michael@428: ) || exit $? michael@428: michael@428: # build PCRE library michael@428: ( cd pcre-%{V_pcre} michael@428: CC="${l_cc}" \ michael@434: CFLAGS="$bitopt -O" \ michael@428: GREP="grep" \ michael@428: ./configure \ michael@428: --disable-cpp \ michael@428: --disable-utf8 \ michael@428: --disable-shared michael@428: ${l_make} || exit $? michael@13: ) || exit $? michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "BUILD: Build BeeCrypt (Cryptography Library)"; set -x michael@13: michael@13: # build BeeCrypt library michael@13: ( cd beecrypt-%{V_beecrypt} michael@13: sh $shtool subst \ michael@13: -e 's;^[ ][ ]*#;#;' \ michael@428: aes.c base64.c blockmode.c blowfish.c entropy.c fips186.c md4.c md5.c \ michael@428: mp.c mtprng.c ripemd128.c ripemd160.c ripemd256.c ripemd320.c rsa.c \ michael@428: sha1.c sha224.c sha256.c sha2k64.c sha384.c sha512.c timestamp.c michael@13: sh $shtool subst \ michael@13: -e 's;cppglue\.lo;;g' \ michael@13: -e 's;cppglue\.cxx;;g' \ michael@13: -e '/^CXX = /s;@CXX@;@CC@;g' \ michael@13: Makefile.in michael@13: ( echo 'ac_cv_have_dev_dsp=no' michael@13: echo 'ac_cv_have_dev_audio=no' michael@13: echo 'ac_cv_func_gettimeofday=yes' michael@13: echo 'bc_cv_as_noexecstack=no' michael@13: ) >config.cache michael@13: CC="${l_cc}" \ michael@434: CFLAGS="$bitopt -O" \ michael@13: ./configure \ michael@13: --cache-file=./config.cache \ michael@13: --prefix=%{l_prefix} \ michael@429: --libdir="%{l_prefix}/lib" \ michael@428: --with-cpu=none \ michael@428: --with-arch=none \ michael@13: --without-cplusplus \ michael@13: --without-java \ michael@13: --without-python \ michael@428: --disable-expert-mode \ michael@428: --disable-aio \ michael@428: --disable-openmp \ michael@13: --disable-threads \ michael@13: --disable-shared michael@13: ${l_make} || exit $? michael@13: cp .libs/libbeecrypt.a . michael@13: ) || exit $? michael@13: michael@13: # display verbosity header michael@428: set +x; VERBOSE "BUILD: Build POPT (Option Parsing Library)"; set -x michael@428: michael@428: # build POPT library michael@428: ( cd popt-%{V_popt} michael@428: CC="${l_cc}" \ michael@434: CFLAGS="$bitopt -O" \ michael@428: CPPFLAGS="-DOPENPKG -DPOPT_fprintf=fprintf" \ michael@428: GREP="grep" \ michael@428: ./configure \ michael@428: --prefix=%{l_prefix} \ michael@429: --libdir="%{l_prefix}/lib" \ michael@428: --disable-shared \ michael@428: --with-included-gettext \ michael@428: --without-libintl-prefix \ michael@428: --without-libiconv-prefix \ michael@428: --disable-nls michael@428: ${l_make} michael@428: ) || exit $? michael@428: michael@428: # display verbosity header michael@428: set +x; VERBOSE "BUILD: Build SQLite (RDBMS Library)"; set -x michael@428: michael@428: # build SQLite library michael@428: ( cd sqlite-%{V_sqlite} michael@428: CC="${l_cc}" \ michael@434: CFLAGS="$bitopt -O" \ michael@428: LIBS="-lm" \ michael@428: GREP="grep" \ michael@428: ./configure \ michael@428: --prefix=%{l_prefix} \ michael@429: --libdir="%{l_prefix}/lib" \ michael@428: --disable-threadsafe \ michael@428: --disable-readline \ michael@428: --disable-debug \ michael@428: --disable-amalgamation \ michael@428: --disable-tcl \ michael@428: --disable-shared michael@428: ${l_make} michael@428: ) || exit $? michael@428: michael@428: # display verbosity header michael@13: set +x; VERBOSE "BUILD: Build RPM (RPM Package Manager)"; set -x michael@13: michael@13: # build RPM michael@13: ( br=`pwd` michael@428: cd rpm-%{V_rpm_major}.%{V_rpm_minor} michael@13: michael@436: # remove unused and undefined methods michael@436: sh $shtool subst \ michael@436: -e 's;^\(#include *<[^>][^>]*>\);/*\1*/;g' \ michael@436: rpmconstant/rpmconstant.h michael@436: michael@435: # provide nonstandard constructs michael@435: cat > nonstandard.h <config.cache michael@13: michael@428: # use miniperl michael@428: PERL="${l_perl}" michael@428: export PERL michael@13: michael@13: # set build tool flags michael@13: CC="${l_cc}" michael@434: CFLAGS="$bitopt" michael@428: CPPFLAGS="-DRPM_VENDOR_OPENPKG" michael@434: LDFLAGS="$bitopt" michael@428: LIBS="" michael@428: LIBS="$LIBS -lm" michael@428: export CC michael@428: export CFLAGS michael@428: export CPPFLAGS michael@428: export LDFLAGS michael@428: export LIBS michael@13: michael@428: # special platform workarounds michael@428: GREP="grep" michael@428: export GREP michael@428: michael@428: # determine POPT option, RPM macros and Lua script file paths michael@428: RPMPOPT="%{l_prefix}/lib/openpkg/rpmpopt" michael@428: RPMPOPT="$RPMPOPT:%{l_prefix}/etc/openpkg/rpmpopt" michael@428: RPMPOPT="$RPMPOPT:%{l_prefix}/etc/openpkg/rpmpopt.d/*" michael@428: RPMPOPT="$RPMPOPT:~/.openpkg/rpmpopt" michael@428: RPMPOPT="$RPMPOPT:@../../.openpkg/rpmpopt" michael@428: RPMPOPT="$RPMPOPT:@../.openpkg/rpmpopt" michael@428: RPMPOPT="$RPMPOPT:@./.openpkg/rpmpopt" michael@428: RPMMACROS="%{l_prefix}/lib/openpkg/rpmmacros" michael@428: RPMMACROS="$RPMMACROS:%{l_prefix}/etc/openpkg/rpmmacros" michael@428: RPMMACROS="$RPMMACROS:%{l_prefix}/etc/openpkg/rpmmacros.d/*" michael@428: RPMMACROS="$RPMMACROS:~/.openpkg/rpmmacros" michael@428: RPMMACROS="$RPMMACROS:@../../.openpkg/rpmmacros" michael@428: RPMMACROS="$RPMMACROS:@../.openpkg/rpmmacros" michael@428: RPMMACROS="$RPMMACROS:@./.openpkg/rpmmacros" michael@428: RPMLUA="%{l_prefix}/lib/openpkg/rpmlua" michael@428: RPMLUA="$RPMLUA:%{l_prefix}/etc/openpkg/rpmlua" michael@428: RPMLUA="$RPMLUA:%{l_prefix}/etc/openpkg/rpmlua.d/*" michael@428: RPMLUA="$RPMLUA:~/.openpkg/rpmlua" michael@428: RPMLUA="$RPMLUA:@../../.openpkg/rpmlua" michael@428: RPMLUA="$RPMLUA:@../.openpkg/rpmlua" michael@428: RPMLUA="$RPMLUA:@./.openpkg/rpmlua" michael@428: michael@428: # parametrize integrity checking framework michael@13: sh $shtool subst \ michael@428: -e "s;0000000000000000000000000000000000000000;7D121A8FC05DC18A4329E9EF67042EC961B7AE34;" \ michael@428: -e "s;0\\.0\\.0;0.9.0;" \ michael@428: rpmqv.c michael@428: michael@428: # disable building of any tests michael@428: # (mainly because those would fail because of integrity checking anyway) michael@13: sh $shtool subst \ michael@428: -e 's;tools scripts tests doc;tools scripts doc;' \ michael@333: Makefile.in michael@13: michael@428: # configure program michael@428: ./configure \ michael@13: --cache-file=./config.cache \ michael@13: --prefix=%{l_prefix} \ michael@429: --libdir="%{l_prefix}/lib" \ michael@428: --mandir="%{l_prefix}/man" \ michael@428: --includedir="%{l_prefix}/include/openpkg" \ michael@428: --with-name="OpenPKG RPM" \ michael@428: --with-path-cfg="%{l_prefix}/etc/openpkg" \ michael@428: --with-path-rpmpopt="$RPMPOPT" \ michael@428: --with-path-macros="$RPMMACROS" \ michael@428: --with-path-rpmlua="$RPMLUA" \ michael@428: --with-path-lib="%{l_prefix}/lib/openpkg" \ michael@428: --with-path-locale="%{l_prefix}/share/openpkg/locale" \ michael@428: --with-path-database="%{l_prefix}/RPM/DB" \ michael@428: --with-path-sources="%{l_prefix}/RPM" \ michael@428: --with-bugreport="openpkg-users@openpkg.org" \ michael@428: --with-beecrypt="$br/beecrypt-%{V_beecrypt}" \ michael@428: --with-openssl="$br/openssl-%{V_openssl}" \ michael@428: --with-zlib="$br/zlib-%{V_zlib}" \ michael@428: --with-bzip2="$br/bzip2-%{V_bzip2}" \ michael@428: --with-popt="$br/popt-%{V_popt}" \ michael@428: --with-sqlite="$br/sqlite-%{V_sqlite}" \ michael@428: --with-pcre="$br/pcre-%{V_pcre}" \ michael@428: --with-uuid="$br/uuid-%{V_uuid}" \ michael@428: --with-lua="internal" \ michael@428: --with-db="internal" \ michael@428: --without-db-rpc \ michael@428: --without-db-largefile \ michael@428: --with-db-tools-integrated \ michael@428: --with-db-mutex="UNIX/fcntl" \ michael@428: --without-file \ michael@428: --without-neon \ michael@428: --without-pthreads \ michael@428: --without-libelf \ michael@428: --without-selinux \ michael@428: --without-perl \ michael@13: --without-python \ michael@13: --without-apidocs \ michael@428: --disable-build-warnings \ michael@428: --disable-build-extlibdep \ michael@428: --disable-build-intlibdep \ michael@428: --disable-build-lafiles \ michael@13: --disable-shared \ michael@13: --disable-rpath \ michael@13: --disable-nls michael@13: michael@428: # build program michael@13: ${l_make} michael@13: ) || exit $? michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "BUILD: Build OpenPKG Frontend (Set-UID Wrapper)"; set -x michael@13: michael@13: # build "openpkg" executable michael@428: ${l_make} -f `SOURCE openpkg.mk` \ michael@13: CC="${l_cc}" \ michael@13: OPENPKG_PREFIX="%{l_prefix}" \ michael@13: OPENPKG_SUSR="%{l_susr}" \ michael@428: OPENPKG_MUSR="%{l_musr}" \ michael@428: OPENPKG_DOT_C="`SOURCE openpkg.c`" michael@428: michael@428: # display verbosity header michael@428: set +x; VERBOSE "BUILD: Build OpenPKG Mutual Exclusion (MutEx) Utility"; set -x michael@428: michael@428: # build "mutex" executable michael@428: ${l_make} -f `SOURCE mutex.mk` \ michael@428: CC="${l_cc}" \ michael@428: CPPFLAGS="-Ipopt-%{V_popt}" \ michael@434: LDFLAGS="$bitopt -Lpopt-%{V_popt} -Lpopt-%{V_popt}/.libs" \ michael@428: MUTEX_DOT_C="`SOURCE mutex.c`" michael@13: michael@13: %install michael@13: # skip in bootstrap phase 2 (see openpkg.boot) michael@13: [ ".$OPENPKG_BOOT" = .1 ] && exit 0 michael@13: michael@13: # switch into a temporary build area michael@13: cd openpkg-%{version} michael@13: . ./.buildenv michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "INSTALL: Create Installation Filesystem Hierarchy"; set -x michael@13: michael@13: # create installation hierarchy michael@13: rm -rf $RPM_BUILD_ROOT michael@13: sh $shtool mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix} michael@13: for dir in bin etc include info lib libexec man sbin share var cgi pub local; do michael@13: test -d $RPM_BUILD_ROOT%{l_prefix}/$dir || \ michael@13: mkdir $RPM_BUILD_ROOT%{l_prefix}/$dir michael@13: done michael@13: for i in 1 2 3 4 5 6 7 8 9; do michael@13: test -d $RPM_BUILD_ROOT%{l_prefix}/man/man$i || \ michael@13: mkdir $RPM_BUILD_ROOT%{l_prefix}/man/man$i michael@13: test -d $RPM_BUILD_ROOT%{l_prefix}/man/cat$i || \ michael@13: mkdir $RPM_BUILD_ROOT%{l_prefix}/man/cat$i michael@13: done michael@13: for dir in PKG bin etc include info lib man sbin; do michael@13: test -d $RPM_BUILD_ROOT%{l_prefix}/local/$dir || \ michael@13: mkdir $RPM_BUILD_ROOT%{l_prefix}/local/$dir michael@13: done michael@13: for i in 1 2 3 4 5 6 7 8 9; do michael@13: test -d $RPM_BUILD_ROOT%{l_prefix}/local/man/man$i || \ michael@13: mkdir $RPM_BUILD_ROOT%{l_prefix}/local/man/man$i michael@13: test -d $RPM_BUILD_ROOT%{l_prefix}/local/man/cat$i || \ michael@13: mkdir $RPM_BUILD_ROOT%{l_prefix}/local/man/cat$i michael@13: done michael@13: test -d $RPM_BUILD_ROOT%{l_prefix}/RPM || \ michael@13: mkdir $RPM_BUILD_ROOT%{l_prefix}/RPM michael@428: for dir in SRC PKG DB TR TMP; do michael@13: test -d $RPM_BUILD_ROOT%{l_prefix}/RPM/$dir || \ michael@13: mkdir $RPM_BUILD_ROOT%{l_prefix}/RPM/$dir michael@13: done michael@13: mkdir $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "INSTALL: Installation of RPM"; set -x michael@13: michael@13: # install RPM into installation hierarchy michael@428: ( cd rpm-%{V_rpm_major}.%{V_rpm_minor} michael@428: ${l_make} install DESTDIR="$RPM_BUILD_ROOT" michael@428: cp lua/rpmlua $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/lua michael@428: chmod a+x $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/lua michael@13: ) || exit $? michael@13: michael@428: # post-adjust RPM installation michael@428: mv $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/macros \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmmacros michael@428: michael@13: # display verbosity header michael@13: set +x; VERBOSE "INSTALL: Install Additional Files"; set -x michael@13: michael@13: # add additional development files michael@428: cp rpm-%{V_rpm_major}.%{V_rpm_minor}/rpmio/glob.h $RPM_BUILD_ROOT%{l_prefix}/include/openpkg/rpm/ michael@428: cp zlib-%{V_zlib}/zlib.h $RPM_BUILD_ROOT%{l_prefix}/include/openpkg/rpm/ michael@428: cp zlib-%{V_zlib}/zconf.h $RPM_BUILD_ROOT%{l_prefix}/include/openpkg/rpm/ michael@13: cp zlib-%{V_zlib}/libz.a $RPM_BUILD_ROOT%{l_prefix}/lib/librpmz.a michael@428: cp bzip2-%{V_bzip2}/bzlib.h $RPM_BUILD_ROOT%{l_prefix}/include/openpkg/rpm/ michael@13: cp bzip2-%{V_bzip2}/libbz2.a $RPM_BUILD_ROOT%{l_prefix}/lib/librpmbz2.a michael@428: cp beecrypt-%{V_beecrypt}/include/beecrypt/beecrypt.h $RPM_BUILD_ROOT%{l_prefix}/include/openpkg/rpm/ michael@13: cp beecrypt-%{V_beecrypt}/libbeecrypt.a $RPM_BUILD_ROOT%{l_prefix}/lib/librpmbeecrypt.a michael@428: cp popt-%{V_popt}/popt.h $RPM_BUILD_ROOT%{l_prefix}/include/openpkg/rpm/ michael@428: cp popt-%{V_popt}/.libs/libpopt.a $RPM_BUILD_ROOT%{l_prefix}/lib/librpmpopt.a michael@428: cp sqlite-%{V_sqlite}/sqlite3.h $RPM_BUILD_ROOT%{l_prefix}/include/openpkg/rpm/ michael@428: cp sqlite-%{V_sqlite}/.libs/libsqlite3.a $RPM_BUILD_ROOT%{l_prefix}/lib/librpmsqlite3.a michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "INSTALL: Post-Adjust Installation"; set -x michael@13: michael@13: # move C API into custom locations michael@13: mv $RPM_BUILD_ROOT%{l_prefix}/lib/librpm* \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/ michael@428: mv $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/rpm.pc \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/ michael@428: # FIXME: does the rpm.pc really work this way? michael@13: michael@13: # move rpm tool to custom location michael@13: mv $RPM_BUILD_ROOT%{l_prefix}/bin/rpm \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm michael@13: mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/rpm.8 \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm.8 michael@428: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm >/dev/null 2>&1 || true michael@13: michael@13: # move rpm2cpio tool to custom location michael@13: mv $RPM_BUILD_ROOT%{l_prefix}/bin/rpm2cpio \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm2cpio michael@13: mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/rpm2cpio.8 \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm2cpio.8 michael@428: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm2cpio >/dev/null 2>&1 || true michael@13: michael@428: # move rpmconstant tool to custom location michael@428: mv $RPM_BUILD_ROOT%{l_prefix}/bin/rpmconstant \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmconstant michael@428: mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/rpmconstant.8 \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmconstant.8 michael@428: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmconstant >/dev/null 2>&1 || true michael@428: michael@428: # move rpmcache tool to custom location michael@428: mv $RPM_BUILD_ROOT%{l_prefix}/bin/rpmcache \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmcache michael@428: mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/rpmcache.8 \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmcache.8 michael@428: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmcache >/dev/null 2>&1 || true michael@428: michael@428: # move rpmgrep tool to custom location michael@428: mv $RPM_BUILD_ROOT%{l_prefix}/bin/rpmgrep \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmgrep michael@428: mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/rpmgrep.1 \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmgrep.1 michael@428: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmgrep >/dev/null 2>&1 || true michael@428: michael@428: # move manual pages to custom location michael@428: mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/rpmdeps.8 \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmdeps.8 michael@428: mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/rpmgraph.8 \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmgraph.8 michael@13: mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/rpmbuild.8 \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpmbuild.8 michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "INSTALL: Stripping Down Installation"; set -x michael@13: michael@13: # strip RPM installation michael@13: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/bin/* \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/* >/dev/null 2>&1 || true michael@428: for file in rpmbuild gendiff; do michael@13: rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$file >/dev/null 2>&1 || true michael@13: done michael@428: for dir in RPMS SRPMS SPEC SOURCES BUILD; do michael@428: rm -rf $RPM_BUILD_ROOT%{l_prefix}/RPM/$dir >/dev/null 2>&1 || true michael@428: done michael@13: rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/* >/dev/null 2>&1 || true michael@13: rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man3/* >/dev/null 2>&1 || true michael@13: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/lib*.la >/dev/null 2>&1 || true michael@428: rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig >/dev/null 2>&1 || true michael@13: for file in \ michael@428: brp-compress brp-python-bytecompile brp-java-gcjcompile brp-strip brp-strip-comment-note \ michael@428: brp-nobuildrootpath brp-strip-shared brp-strip-static-archive brp-sparc64-linux check-files \ michael@428: cross-build executabledeps.sh find-debuginfo.sh find-lang.sh find-prov.pl find-req.pl \ michael@428: find-provides.perl find-requires.perl getpo.sh http.req javadeps.sh libtooldeps.sh mono-find-provides \ michael@428: mono-find-requires osgideps.pl pkgconfigdeps.sh perldeps.pl perl.prov perl.req pythondeps.sh \ michael@428: php.prov php.req rpmdb_loadcvt rpm.daily rpm.log rpm.xinetd symclash.py symclash.sh tgpg u_pkg.sh \ michael@428: vpkg-provides.sh vpkg-provides2.sh install-sh mkinstalldirs; do michael@428: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/$file >/dev/null 2>&1 || true michael@428: done michael@428: for file in \ michael@428: db_archive db_checkpoint db_deadlock db_dump db_hotbackup db_load \ michael@428: db_printlog db_recover db_stat db_upgrade db_verify; do michael@13: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/$file >/dev/null 2>&1 || true michael@13: done michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "INSTALL: Install Additional Tools"; set -x michael@13: michael@13: # install lsync tool michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE lsync` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/lsync michael@13: chmod a+x $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/lsync michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE dot.lsyncrc` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/local/.lsyncrc michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE lsync.8` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/lsync.8 michael@13: michael@13: # install rpm-config tool michael@13: ( l_prefix="%{l_prefix}" michael@13: l_cc="%{l_cc}" michael@13: l_cflags="" michael@13: l_cppflags="-DOPENPKG -I${l_prefix}/include/openpkg/rpm -I${l_prefix}/include/openpkg" michael@13: l_ldflags="-L${l_prefix}/lib/openpkg" michael@428: l_libs="-lrpmbuild -lrpm -lrpmio -lrpmdb -lrpmmisc -lrpmsqlite3 -lrpmpopt -lrpmbeecrypt -lrpmbz2 -lrpmz" michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: -e "s:@l_cc@:$l_cc:g" \ michael@13: -e "s:@l_cflags@:$l_cflags:g" \ michael@13: -e "s:@l_cppflags@:$l_cppflags:g" \ michael@13: -e "s:@l_ldflags@:$l_ldflags:g" \ michael@13: -e "s:@l_libs@:$l_libs:g" \ michael@428: -e "s:@l_version@:%{V_rpm_major}.%{V_rpm_minor}:g" \ michael@13: <`SOURCE rpm-config.sh` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm-config michael@13: ) || exit $? michael@13: chmod a+x $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm-config michael@428: sed -e "s:RPM_VERSION:%{V_rpm_major}.%{V_rpm_minor}:g" \ michael@13: <`SOURCE rpm-config.8` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm-config.8 michael@13: michael@13: # install OpenPKG registry commands michael@428: mv $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpm michael@428: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@428: `SOURCE rpm.sh` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm michael@428: chmod 755 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rpm michael@428: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@428: `SOURCE register.sh` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/register michael@428: chmod 755 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/register michael@428: cp `SOURCE register.8` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/register.8 michael@13: michael@428: # allow GNU shtool to be called as "openpkg shtool" from external, too. michael@428: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@428: `SOURCE shtool.sh` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/shtool.sh michael@428: chmod 755 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/shtool.sh michael@428: michael@428: # install OpenPKG tool chain command subset michael@428: cp `SOURCE curl.sh` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/curl.sh michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/curl.sh michael@428: cp `SOURCE build.pl` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/build.pl michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/build.pl michael@428: cp `SOURCE build.8` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/build.8 michael@428: cp `SOURCE index.pl` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/index.pl michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/index.pl michael@428: cp `SOURCE index.8` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/index.8 michael@428: cp `SOURCE search.pl` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/search.pl michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/search.pl michael@428: cp `SOURCE search.8` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/search.8 michael@428: cp `SOURCE mirror.pl` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/mirror.pl michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/mirror.pl michael@428: cp `SOURCE mirror.8` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/mirror.8 michael@428: cp `SOURCE makeproxy.pl` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/makeproxy.pl michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/makeproxy.pl michael@428: cp `SOURCE makeproxy.8` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/makeproxy.8 michael@428: cp `SOURCE lint-fsl.pl` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/lint-fsl.pl michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/lint-fsl.pl michael@428: cp `SOURCE lint-rc.pl` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/lint-rc.pl michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/lint-rc.pl michael@428: cp `SOURCE lint-rpm.pl` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/lint-rpm.pl michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/lint-rpm.pl michael@428: cp `SOURCE lint-spec.pl` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/lint-spec.pl michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/lint-spec.pl michael@428: cp `SOURCE dev.pl` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/dev.pl michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/dev.pl michael@428: cp `SOURCE dev.8` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/dev.8 michael@428: cp `SOURCE sea.sh` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/sea.sh michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/sea.sh michael@428: cp `SOURCE sea.8` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/sea.8 michael@428: cp `SOURCE stack.sh` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/stack.sh michael@428: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/stack.sh michael@428: cp `SOURCE stack.8` $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/stack.8 michael@13: michael@13: # install RPM extension michael@13: ( cd perl-%{V_perl} michael@13: cp miniperl $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/miniperl michael@13: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/miniperl michael@13: ) || exit $? michael@13: ( cd openssl-%{V_openssl} michael@13: cp apps/openssl $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/openssl michael@13: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/openssl michael@13: ) || exit $? michael@13: ( cd curl-%{V_curl} michael@428: cp curl $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/curl michael@13: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/curl michael@13: ) || exit $? michael@13: ( cd bzip2-%{V_bzip2} michael@13: cp bzip2 $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/bzip2 michael@13: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/bzip2 michael@13: ) || exit $? michael@13: ( cd gzip-%{V_gzip} michael@13: cp gzip $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/gzip michael@13: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/gzip michael@13: ) || exit $? michael@428: ( cd xz-%{V_xz} michael@428: cp src/xz/xz $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/xz michael@428: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/xz michael@428: ) || exit $? michael@13: ( cd patch-%{V_patch} michael@13: cp patch $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/patch michael@13: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/patch michael@13: ) || exit $? michael@13: ( cd tar-%{V_tar} michael@13: cp tar $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/tar michael@13: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/tar michael@13: ) || exit $? michael@13: ( cd bash-%{V_bash} michael@13: cp bash $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/bash michael@13: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/bash michael@13: ) || exit $? michael@13: ( cd uuid-%{V_uuid} michael@13: cp uuid $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/uuid michael@13: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/uuid michael@13: ) || exit $? michael@428: ( cd sqlite-%{V_sqlite} michael@428: cp sqlite3 $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/sqlite3 michael@428: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/sqlite3 michael@428: ) || exit $? michael@428: ( cd libarchive-%{V_libarchive} michael@428: cp bsdcpio $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/bsdcpio michael@428: cp bsdtar $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/bsdtar michael@428: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/bsdcpio michael@428: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/bsdtar michael@428: ) || exit $? michael@428: ( cd diffutils-%{V_diffutils} michael@428: ${l_strip} diff diff3 sdiff cmp michael@428: cp diff diff3 sdiff cmp $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/ michael@428: ) || exit $? michael@428: ( cd svs-%{V_svs} michael@428: sed -e "s;/bin/sh;%{l_prefix}/lib/openpkg/bash;" \ michael@428: -e "s;^\( *\)\(diff \);\1%{l_prefix}/lib/openpkg/\2;" \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/svs michael@428: chmod a+x $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/svs michael@428: cp svs.1 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/svs.1 michael@428: ) || exit $? michael@13: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@13: -e "s;@l_musr@;%{l_musr};g" \ michael@13: -e "s;@l_mgrp@;%{l_mgrp};g" \ michael@13: <`SOURCE uuid.sh` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/uuid michael@13: chmod a+x $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/uuid michael@13: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@13: <`SOURCE uuid.8` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/uuid.8 michael@13: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@13: <`SOURCE release.sh` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/release michael@13: chmod a+x $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/release michael@13: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@13: <`SOURCE release.8` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/release.8 michael@13: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@13: -e "s;@l_musr@;%{l_musr};g" \ michael@13: -e "s;@l_mgrp@;%{l_mgrp};g" \ michael@13: <`SOURCE rpmdb` >$RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmdb michael@13: chmod a+x $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmdb michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE rpmtool` >$RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmtool michael@13: chmod a+x $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rpmtool michael@428: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@428: -e "s;@l_musr@;%{l_musr};g" \ michael@428: -e "s;@l_mgrp@;%{l_mgrp};g" \ michael@428: <`SOURCE license.sh` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/license michael@428: chmod a+x $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/license michael@428: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@428: <`SOURCE license.8` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/license.8 michael@13: michael@13: # install OpenPKG tool chain execution frontend and execution wrapper michael@428: cp openpkg $RPM_BUILD_ROOT%{l_prefix}/bin/openpkg michael@13: ${l_strip} $RPM_BUILD_ROOT%{l_prefix}/bin/openpkg michael@13: chmod 4775 $RPM_BUILD_ROOT%{l_prefix}/bin/openpkg michael@13: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@13: <`SOURCE openpkg.sh` >$RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/openpkg michael@13: chmod 755 $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/openpkg michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE openpkg.1` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/man/man1/openpkg.1 michael@13: michael@13: # install more OpenPKG tool chain commands michael@13: sed -e "s;@l_prefix@;%{l_prefix};g" \ michael@13: <`SOURCE man.sh` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/man michael@13: chmod a+x $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/man michael@13: michael@428: # install OpenPKG mutex utility michael@428: cp mutex $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/mutex michael@428: michael@13: # install an own copy of shtool michael@13: cp $shtool $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/shtool michael@13: chmod a+x $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/shtool michael@13: michael@13: # display verbosity header michael@13: set +x; VERBOSE "INSTALL: Install Configuration Files"; set -x michael@13: michael@13: # install a few README files michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE root.README` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/README michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE local.README` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/local/README michael@13: michael@13: # install Bash environment michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE dot.bashrc` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/.bashrc michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE dot.bash_login` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/.bash_login michael@13: michael@13: # install Run-Command files michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: -e "s:@l_susr@:%{l_susr}:g" \ michael@13: -e "s:@l_musr@:%{l_musr}:g" \ michael@13: <`SOURCE rc` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/etc/rc michael@13: chmod 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE rc.conf` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/etc/rc.conf michael@13: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.conf michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE rc.func` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/etc/rc.func michael@13: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.func michael@13: mkdir $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: -e "s:@l_musr@:%{l_musr}:g" \ michael@13: <`SOURCE rc.openpkg` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/rc.openpkg michael@13: chmod 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/rc.openpkg michael@13: ( echo "#!/bin/sh" michael@13: echo "exec %{l_prefix}/etc/rc \${1+\"\$@\"}" michael@13: ) >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rc michael@13: chmod 755 $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rc michael@13: ln $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rc \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/rc michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE rc.8` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/rc.8 michael@13: michael@13: # create configuration directory michael@13: test -d $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg || \ michael@13: mkdir $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg michael@13: michael@13: # install platform identification file michael@13: sh $shtool platform -n -L -S "" -C "+" -F "%-any-%" \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/platform michael@13: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/platform michael@13: michael@13: # install UUID configuration file (ghost) michael@13: touch $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/uuid michael@13: chmod 644 $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/uuid michael@13: michael@13: # install registry configuration files (ghost) michael@13: touch \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.conf \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.prep \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.tran \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.util michael@13: chmod 644 \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.conf \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.prep \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.tran \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/register.util michael@13: michael@13: # install default managers configuration file michael@13: ( echo "##" michael@13: echo "## managers -- OpenPKG Instance Managers" michael@13: echo "##" michael@13: echo "" michael@13: echo "%{l_susr}" michael@13: echo "%{l_musr}" michael@13: echo "" michael@13: ) >$RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/managers michael@13: michael@428: # install default release information file michael@428: release_tag="" michael@428: release_url="" michael@428: l_stack=""; [ ".%{?l_stack:set}" = .set ] && l_stack="%{l_stack}" michael@428: case "$l_stack" in michael@428: http: | https: | ftp: | file: ) michael@428: release_url="$l_stack" michael@428: ;; michael@428: [a-zA-Z]* ) michael@428: release_tag="$l_stack" michael@428: ;; michael@428: esac michael@428: ( echo "##" michael@428: echo "## release -- OpenPKG Release Information" michael@428: echo "##" michael@428: echo "" michael@428: echo "TAG=$release_tag" michael@428: echo "URL=$release_url" michael@428: echo "" michael@428: ) >$RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/release michael@428: michael@13: # install overriding RPM configuration files michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: <`SOURCE rpmpopt` \ michael@428: >$RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/rpmpopt michael@13: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@13: -e "s:@l_prefix_static@:%{l_prefix}:g" \ michael@13: -e "s;@l_build_path@;$l_build_path;g" \ michael@13: -e "s;@l_build_ldlp@;$l_build_ldlp;g" \ michael@13: -e "s;@l_build_ulim@;$l_build_ulim;g" \ michael@428: -e "s;@l_unprivileged@;$l_unprivileged;g" \ michael@13: -e "s:@TAG@:$tag:g" \ michael@13: -e "s:@SUSR@:$susr:g" \ michael@13: -e "s:@SGRP@:$sgrp:g" \ michael@13: -e "s:@MUSR@:$musr:g" \ michael@13: -e "s:@MGRP@:$mgrp:g" \ michael@13: -e "s:@RUSR@:$rusr:g" \ michael@13: -e "s:@RGRP@:$rgrp:g" \ michael@13: -e "s:@NUSR@:$nusr:g" \ michael@13: -e "s:@NGRP@:$ngrp:g" \ michael@13: <`SOURCE rpmmacros` \ michael@13: >$RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/rpmmacros michael@428: sed -e "s:@l_prefix@:%{l_prefix}:g" \ michael@428: <`SOURCE rpmlua` \ michael@428: >$RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/rpmlua michael@13: cp `SOURCE openpkg.org.pgp` \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/openpkg.org.pgp michael@13: cp `SOURCE openpkg.com.pgp` \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/openpkg.com.pgp michael@13: cp `SOURCE openpkg.net.pgp` \ michael@13: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/openpkg.net.pgp michael@13: michael@428: # install license data michael@428: test -d $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/license.d || \ michael@428: mkdir $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/license.d michael@428: cp `SOURCE license-BOOT.txt` \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/license.d/BOOT michael@428: cp `SOURCE license-COMMUNITY.txt` \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/license.d/COMMUNITY michael@428: cp `SOURCE license-EVAL.txt` \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/license.d/EVAL michael@428: cp `SOURCE license-EXAMPLE.txt` \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/license.d/EXAMPLE michael@428: cp `SOURCE license-PROMO.txt` \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/license.d/PROMO michael@428: cp `SOURCE license-RECOVERY.txt` \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/license.d/RECOVERY michael@428: cp `SOURCE license.lua` \ michael@428: $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/license.lua michael@428: touch $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/license michael@428: michael@428: # provide directories for easy overriding of RPM configuration files michael@428: test -d $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/rpmmacros.d || \ michael@428: mkdir $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/rpmmacros.d michael@428: test -d $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/rpmpopt.d || \ michael@428: mkdir $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/rpmpopt.d michael@428: test -d $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/rpmlua.d || \ michael@428: mkdir $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/rpmlua.d michael@428: michael@13: # display verbosity header michael@13: set +x; VERBOSE "INSTALL: Done. Thank you for flying OpenPKG..."; set -x michael@13: michael@13: %files michael@13: %defattr(-,%{?l_musr}%{!?l_musr:%{l_fsusr}},%{?l_mgrp}%{!?l_mgrp:%{l_fsgrp}}) michael@13: %{l_prefix}/README michael@13: %config(noreplace) %{l_prefix}/.bashrc michael@13: %config(noreplace) %{l_prefix}/.bash_login michael@13: %dir %{l_prefix}/RPM michael@13: %dir %{l_prefix}/RPM/SRC michael@13: %dir %{l_prefix}/RPM/PKG michael@428: %dir %{l_prefix}/RPM/TR michael@13: %dir %{l_prefix}/RPM/DB michael@13: %dir %{l_prefix}/RPM/TMP michael@13: %dir %{l_prefix}/cgi michael@13: %dir %{l_prefix}/bin michael@13: %attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/openpkg michael@13: %dir %{l_prefix}/etc michael@13: %{l_prefix}/etc/rc michael@13: %config(noreplace) %{l_prefix}/etc/rc.conf michael@13: %{l_prefix}/etc/rc.func michael@13: %dir %{l_prefix}/etc/rc.d michael@13: %{l_prefix}/etc/rc.d/rc.openpkg michael@13: %dir %{l_prefix}/etc/openpkg michael@428: %ghost %{l_prefix}/etc/openpkg/license michael@428: %dir %{l_prefix}/etc/openpkg/license.d michael@428: %{l_prefix}/etc/openpkg/license.d/BOOT michael@428: %{l_prefix}/etc/openpkg/license.d/COMMUNITY michael@428: %{l_prefix}/etc/openpkg/license.d/EVAL michael@428: %{l_prefix}/etc/openpkg/license.d/EXAMPLE michael@428: %{l_prefix}/etc/openpkg/license.d/PROMO michael@428: %{l_prefix}/etc/openpkg/license.d/RECOVERY michael@13: %ghost %{l_prefix}/etc/openpkg/uuid michael@428: %config %{l_prefix}/etc/openpkg/release michael@13: %config %{l_prefix}/etc/openpkg/platform michael@13: %config %{l_prefix}/etc/openpkg/rpmmacros michael@428: %config %{l_prefix}/etc/openpkg/rpmpopt michael@428: %config %{l_prefix}/etc/openpkg/rpmlua michael@428: %dir %{l_prefix}/etc/openpkg/rpmmacros.d michael@428: %dir %{l_prefix}/etc/openpkg/rpmpopt.d michael@428: %dir %{l_prefix}/etc/openpkg/rpmlua.d michael@13: %ghost %{l_prefix}/etc/openpkg/register.conf michael@13: %ghost %{l_prefix}/etc/openpkg/register.prep michael@13: %ghost %{l_prefix}/etc/openpkg/register.tran michael@13: %ghost %{l_prefix}/etc/openpkg/register.util michael@13: %config %attr(664,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/openpkg/managers michael@13: %{l_prefix}/etc/openpkg/openpkg.org.pgp michael@13: %{l_prefix}/etc/openpkg/openpkg.com.pgp michael@13: %{l_prefix}/etc/openpkg/openpkg.net.pgp michael@13: %dir %{l_prefix}/include michael@13: %dir %{l_prefix}/include/openpkg michael@13: %dir %{l_prefix}/include/openpkg/rpm michael@13: %{l_prefix}/include/openpkg/rpm/argv.h michael@13: %{l_prefix}/include/openpkg/rpm/beecrypt.h michael@13: %{l_prefix}/include/openpkg/rpm/bzlib.h michael@13: %{l_prefix}/include/openpkg/rpm/db.h michael@428: %{l_prefix}/include/openpkg/rpm/envvar.h michael@428: %{l_prefix}/include/openpkg/rpm/fs.h michael@13: %{l_prefix}/include/openpkg/rpm/fts.h michael@13: %{l_prefix}/include/openpkg/rpm/glob.h michael@428: %{l_prefix}/include/openpkg/rpm/mire.h michael@13: %{l_prefix}/include/openpkg/rpm/misc.h michael@428: %{l_prefix}/include/openpkg/rpm/pkgio.h michael@13: %{l_prefix}/include/openpkg/rpm/popt.h michael@428: %{l_prefix}/include/openpkg/rpm/rpm4compat.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmal.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmbc.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmbuild.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmcb.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmcli.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmconstant.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmdav.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmdb.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmds.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmevr.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmfc.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmfi.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmgc.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmgi.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmhash.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmio-stub.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmio.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmiotypes.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmku.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmlib.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmlog.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmmacro.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmmg.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmns.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmnss.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmpgp.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmps.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmspec.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmsq.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmssl.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmsw.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmsx.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmtag.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmte.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmts.h michael@13: %{l_prefix}/include/openpkg/rpm/rpmurl.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmuuid.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmversion.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmwf.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmxar.h michael@428: %{l_prefix}/include/openpkg/rpm/rpmzlog.h michael@428: %{l_prefix}/include/openpkg/rpm/signature.h michael@428: %{l_prefix}/include/openpkg/rpm/sqlite3.h michael@13: %{l_prefix}/include/openpkg/rpm/ugid.h michael@428: %{l_prefix}/include/openpkg/rpm/yarn.h michael@13: %{l_prefix}/include/openpkg/rpm/zconf.h michael@13: %{l_prefix}/include/openpkg/rpm/zlib.h michael@13: %dir %{l_prefix}/info michael@13: %dir %{l_prefix}/lib michael@13: %dir %{l_prefix}/lib/openpkg michael@13: %{l_prefix}/lib/openpkg/bash michael@428: %{l_prefix}/lib/openpkg/bsdcpio michael@428: %{l_prefix}/lib/openpkg/bsdtar michael@13: %{l_prefix}/lib/openpkg/bzip2 michael@13: %{l_prefix}/lib/openpkg/curl michael@428: %{l_prefix}/lib/openpkg/db_tool michael@428: %{l_prefix}/lib/openpkg/cmp michael@428: %{l_prefix}/lib/openpkg/diff michael@428: %{l_prefix}/lib/openpkg/diff3 michael@428: %{l_prefix}/lib/openpkg/sdiff michael@13: %{l_prefix}/lib/openpkg/gzip michael@13: %{l_prefix}/lib/openpkg/librpm.a michael@13: %{l_prefix}/lib/openpkg/librpmbeecrypt.a michael@13: %{l_prefix}/lib/openpkg/librpmbuild.a michael@13: %{l_prefix}/lib/openpkg/librpmbz2.a michael@13: %{l_prefix}/lib/openpkg/librpmdb.a michael@13: %{l_prefix}/lib/openpkg/librpmio.a michael@428: %{l_prefix}/lib/openpkg/librpmmisc.a michael@13: %{l_prefix}/lib/openpkg/librpmpopt.a michael@428: %{l_prefix}/lib/openpkg/librpmsqlite3.a michael@13: %{l_prefix}/lib/openpkg/librpmz.a michael@428: %{l_prefix}/lib/openpkg/license.lua michael@13: %{l_prefix}/lib/openpkg/miniperl michael@428: %{l_prefix}/lib/openpkg/mutex michael@13: %{l_prefix}/lib/openpkg/openpkg michael@13: %{l_prefix}/lib/openpkg/openssl michael@13: %{l_prefix}/lib/openpkg/patch michael@13: %{l_prefix}/lib/openpkg/rc michael@13: %{l_prefix}/lib/openpkg/rpm michael@428: %{l_prefix}/lib/openpkg/rpm.pc michael@13: %{l_prefix}/lib/openpkg/rpmdb michael@428: %{l_prefix}/lib/openpkg/rpmdeps michael@428: %{l_prefix}/lib/openpkg/lua michael@428: %{l_prefix}/lib/openpkg/rpmmacros michael@13: %{l_prefix}/lib/openpkg/rpmpopt michael@13: %{l_prefix}/lib/openpkg/rpmtool michael@13: %{l_prefix}/lib/openpkg/shtool michael@428: %{l_prefix}/lib/openpkg/sqlite3 michael@13: %{l_prefix}/lib/openpkg/tar michael@13: %{l_prefix}/lib/openpkg/uuid michael@428: %{l_prefix}/lib/openpkg/xz michael@13: %dir %{l_prefix}/libexec michael@13: %dir %{l_prefix}/libexec/openpkg michael@13: %{l_prefix}/libexec/openpkg/build.8 michael@13: %{l_prefix}/libexec/openpkg/build.pl michael@13: %{l_prefix}/libexec/openpkg/curl.sh michael@428: %{l_prefix}/libexec/openpkg/dev.8 michael@428: %{l_prefix}/libexec/openpkg/dev.pl michael@428: %{l_prefix}/libexec/openpkg/index.8 michael@428: %{l_prefix}/libexec/openpkg/index.pl michael@428: %{l_prefix}/libexec/openpkg/license michael@428: %{l_prefix}/libexec/openpkg/license.8 michael@13: %{l_prefix}/libexec/openpkg/lsync michael@13: %{l_prefix}/libexec/openpkg/lsync.8 michael@428: %{l_prefix}/libexec/openpkg/lint-fsl.pl michael@428: %{l_prefix}/libexec/openpkg/lint-rc.pl michael@428: %{l_prefix}/libexec/openpkg/lint-rpm.pl michael@428: %{l_prefix}/libexec/openpkg/lint-spec.pl michael@428: %{l_prefix}/libexec/openpkg/makeproxy.8 michael@428: %{l_prefix}/libexec/openpkg/makeproxy.pl michael@13: %{l_prefix}/libexec/openpkg/man michael@428: %{l_prefix}/libexec/openpkg/mirror.8 michael@428: %{l_prefix}/libexec/openpkg/mirror.pl michael@13: %{l_prefix}/libexec/openpkg/rc michael@13: %{l_prefix}/libexec/openpkg/rc.8 michael@13: %{l_prefix}/libexec/openpkg/register michael@13: %{l_prefix}/libexec/openpkg/register.8 michael@13: %{l_prefix}/libexec/openpkg/release michael@13: %{l_prefix}/libexec/openpkg/release.8 michael@13: %{l_prefix}/libexec/openpkg/rpm michael@13: %{l_prefix}/libexec/openpkg/rpm-config michael@13: %{l_prefix}/libexec/openpkg/rpm-config.8 michael@13: %{l_prefix}/libexec/openpkg/rpm.8 michael@428: %{l_prefix}/libexec/openpkg/rpmconstant michael@428: %{l_prefix}/libexec/openpkg/rpmconstant.8 michael@13: %{l_prefix}/libexec/openpkg/rpm2cpio michael@13: %{l_prefix}/libexec/openpkg/rpm2cpio.8 michael@13: %{l_prefix}/libexec/openpkg/rpmbuild.8 michael@428: %{l_prefix}/libexec/openpkg/rpmcache michael@428: %{l_prefix}/libexec/openpkg/rpmcache.8 michael@428: %{l_prefix}/libexec/openpkg/rpmdeps.8 michael@428: %{l_prefix}/libexec/openpkg/rpmgraph.8 michael@428: %{l_prefix}/libexec/openpkg/rpmgrep michael@428: %{l_prefix}/libexec/openpkg/rpmgrep.1 michael@428: %{l_prefix}/libexec/openpkg/sea.8 michael@428: %{l_prefix}/libexec/openpkg/sea.sh michael@428: %{l_prefix}/libexec/openpkg/search.8 michael@428: %{l_prefix}/libexec/openpkg/search.pl michael@428: %{l_prefix}/libexec/openpkg/stack.8 michael@428: %{l_prefix}/libexec/openpkg/stack.sh michael@428: %{l_prefix}/libexec/openpkg/shtool.sh michael@428: %{l_prefix}/libexec/openpkg/svs michael@428: %{l_prefix}/libexec/openpkg/svs.1 michael@13: %{l_prefix}/libexec/openpkg/uuid michael@13: %{l_prefix}/libexec/openpkg/uuid.8 michael@13: %dir %{l_prefix}/man michael@13: %dir %{l_prefix}/man/man1 michael@13: %dir %{l_prefix}/man/man2 michael@13: %dir %{l_prefix}/man/man3 michael@13: %dir %{l_prefix}/man/man4 michael@13: %dir %{l_prefix}/man/man5 michael@13: %dir %{l_prefix}/man/man6 michael@13: %dir %{l_prefix}/man/man7 michael@13: %dir %{l_prefix}/man/man8 michael@13: %dir %{l_prefix}/man/man9 michael@13: %dir %{l_prefix}/man/cat1 michael@13: %dir %{l_prefix}/man/cat2 michael@13: %dir %{l_prefix}/man/cat3 michael@13: %dir %{l_prefix}/man/cat4 michael@13: %dir %{l_prefix}/man/cat5 michael@13: %dir %{l_prefix}/man/cat6 michael@13: %dir %{l_prefix}/man/cat7 michael@13: %dir %{l_prefix}/man/cat8 michael@13: %dir %{l_prefix}/man/cat9 michael@13: %{l_prefix}/man/man1/openpkg.1 michael@13: %dir %{l_prefix}/sbin michael@13: %dir %{l_prefix}/pub michael@13: %dir %{l_prefix}/share michael@13: %dir %{l_prefix}/var michael@13: %dir %{l_prefix}/local michael@13: %{l_prefix}/local/README michael@13: %{l_prefix}/local/.lsyncrc michael@13: %dir %{l_prefix}/local/PKG michael@13: %dir %{l_prefix}/local/bin michael@13: %dir %{l_prefix}/local/etc michael@13: %dir %{l_prefix}/local/include michael@13: %dir %{l_prefix}/local/info michael@13: %dir %{l_prefix}/local/lib michael@13: %dir %{l_prefix}/local/man michael@13: %dir %{l_prefix}/local/man/man1 michael@13: %dir %{l_prefix}/local/man/man2 michael@13: %dir %{l_prefix}/local/man/man3 michael@13: %dir %{l_prefix}/local/man/man4 michael@13: %dir %{l_prefix}/local/man/man5 michael@13: %dir %{l_prefix}/local/man/man6 michael@13: %dir %{l_prefix}/local/man/man7 michael@13: %dir %{l_prefix}/local/man/man8 michael@13: %dir %{l_prefix}/local/man/man9 michael@13: %dir %{l_prefix}/local/man/cat1 michael@13: %dir %{l_prefix}/local/man/cat2 michael@13: %dir %{l_prefix}/local/man/cat3 michael@13: %dir %{l_prefix}/local/man/cat4 michael@13: %dir %{l_prefix}/local/man/cat5 michael@13: %dir %{l_prefix}/local/man/cat6 michael@13: %dir %{l_prefix}/local/man/cat7 michael@13: %dir %{l_prefix}/local/man/cat8 michael@13: %dir %{l_prefix}/local/man/cat9 michael@13: %dir %{l_prefix}/local/sbin michael@13: michael@13: %clean michael@13: # skip in bootstrap phase 2 (see openpkg.boot) michael@13: [ ".$OPENPKG_BOOT" = .1 ] && exit 0 michael@13: michael@13: # cleanup build area michael@13: rm -rf openpkg-%{version} >/dev/null 2>&1 || true michael@13: michael@13: # cleanup installation area michael@13: rm -rf $RPM_BUILD_ROOT >/dev/null 2>&1 || true michael@13: michael@13: %pre michael@13: # always performed for upgrades and because it doesn't harm! michael@13: # [ ".$1" != .1 ] && exit 0 michael@13: michael@13: # this procedure is only usable with root privileges michael@13: # (for non-root installations it is not required at all) michael@13: cusr=`(id -un) 2>/dev/null ||\ michael@13: (id | sed -e 's;^[^(]*(\([^)]*\)).*;\1;') 2>/dev/null ||\ michael@13: (whoami) 2>/dev/null ||\ michael@13: (who am i | cut "-d " -f1) 2>/dev/null ||\ michael@13: echo $LOGNAME` michael@13: michael@13: # determine runtime details (for both inside and outside RPM!!) michael@428: # - bootstrapping: $xxx is set from etc.wrapbin.sh michael@13: # - upgrading new: %{l_[smrn]{usr,grp}} is set via rpmmacros michael@13: # - upgrading old: %{l_[smrn]{usr,grp}} is not set at all michael@13: [ ".$susr" = . ] && susr="%{?l_susr}%{!?l_susr:root}" michael@13: [ ".$sgrp" = . ] && sgrp="%{?l_sgrp}%{!?l_sgrp:wheel}" michael@13: [ ".$musr" = . ] && musr="%{?l_musr}%{!?l_musr:%{l_fsusr}}" michael@13: [ ".$mgrp" = . ] && mgrp="%{?l_mgrp}%{!?l_mgrp:%{l_fsgrp}}" michael@13: [ ".$rusr" = . ] && rusr="%{?l_rusr}%{!?l_rusr:%{l_fsusr}-r}" michael@13: [ ".$rgrp" = . ] && rgrp="%{?l_rgrp}%{!?l_rgrp:%{l_fsgrp}-r}" michael@13: [ ".$nusr" = . ] && nusr="%{?l_nusr}%{!?l_nusr:%{l_fsusr}-n}" michael@13: [ ".$ngrp" = . ] && ngrp="%{?l_ngrp}%{!?l_ngrp:%{l_fsgrp}-n}" michael@13: [ ".$suid" = . ] && suid="%{?l_suid}" michael@13: [ ".$sgid" = . ] && sgid="%{?l_sgid}" michael@13: [ ".$muid" = . ] && muid="%{?l_muid}" michael@13: [ ".$mgid" = . ] && mgid="%{?l_mgid}" michael@13: [ ".$ruid" = . ] && ruid="%{?l_ruid}" michael@13: [ ".$rgid" = . ] && rgid="%{?l_rgid}" michael@13: [ ".$nuid" = . ] && nuid="%{?l_nuid}" michael@13: [ ".$ngid" = . ] && ngid="%{?l_ngid}" michael@13: michael@13: # if any of these optional params are not used we won't have a michael@13: # corresponding macro either, so make use of one conditionally michael@13: [ ".$suid" = . ] && [ ".%{?l_suid:set}" = .set ] && suid="%{?l_suid}" michael@13: [ ".$sgid" = . ] && [ ".%{?l_sgid:set}" = .set ] && sgid="%{?l_sgid}" michael@13: [ ".$muid" = . ] && [ ".%{?l_muid:set}" = .set ] && muid="%{?l_muid}" michael@13: [ ".$mgid" = . ] && [ ".%{?l_mgid:set}" = .set ] && mgid="%{?l_mgid}" michael@13: [ ".$ruid" = . ] && [ ".%{?l_ruid:set}" = .set ] && ruid="%{?l_ruid}" michael@13: [ ".$rgid" = . ] && [ ".%{?l_rgid:set}" = .set ] && rgid="%{?l_rgid}" michael@13: [ ".$nuid" = . ] && [ ".%{?l_nuid:set}" = .set ] && nuid="%{?l_nuid}" michael@13: [ ".$ngid" = . ] && [ ".%{?l_ngid:set}" = .set ] && ngid="%{?l_ngid}" michael@13: michael@13: # determine prefix michael@13: [ ".$prefix" = . ] && prefix="%{l_prefix}" michael@13: prefix=`echo "$prefix" | sed -e 's;//*;/;g' -e 's;/$;;'` michael@13: michael@428: # Pre-flight check before update to make sure that the currently michael@428: # activated license is still valid. This is done just be friendly michael@428: # to people and to not too easily shoot theirself into the foot michael@428: # by blindly upgrading and then having to recognize that the new michael@428: # OpenPKG Framework is no longer covered by the old license. michael@428: if [ ".$1" = .2 ]; then michael@428: ( OPENPKG_FRAMEWORK_RELEASE="%{release}" michael@428: export OPENPKG_FRAMEWORK_RELEASE michael@428: # LATER: michael@428: # $prefix/bin/openpkg rpm -q openpkg >/dev/null 2>&1 || exit $? michael@428: # if [ $? -ne 0 ]; then michael@428: # NOW: michael@428: output="`$prefix/bin/openpkg rpm -q openpkg 2>&1 | grep 'ENVIRONMENT ANOMALY'`" michael@428: if [ ".$output" != . ]; then michael@428: id="`($prefix/bin/openpkg license active) 2>/dev/null`" michael@428: [ ".$id" = . ] && id="UNKNOWN" michael@428: ( echo "Attention, your currently active license \"$id\" does" michael@428: echo "not allow you to use this newer version of the OpenPKG Framework!" michael@428: echo "We cancel this update to prevent you from a run-time failure." michael@428: echo "Please first upgrade to a newer license with the command:" michael@428: echo " \$ $prefix/bin/openpkg license update $id " michael@428: ) | $prefix/lib/openpkg/rpmtool msg -b -t error michael@428: exit 42 michael@428: fi michael@428: ) || exit $? michael@428: fi michael@428: michael@13: # register instance in presence file michael@13: presence="/etc/openpkg" michael@13: exists=`cat $presence 2>/dev/null | egrep "^ *${prefix} *\$"` michael@13: if [ ".$exists" = . ]; then michael@13: ( umask 022 michael@13: echo "${prefix}" >>$presence michael@13: ) 2>/dev/null || true michael@13: fi michael@13: michael@13: # determine user/group ids michael@13: for class in s m r n; do michael@13: eval "xusr=\"\$${class}usr\"" michael@13: eval "xgrp=\"\$${class}grp\"" michael@13: eval "xuid=\"\$${class}uid\"" michael@13: eval "xgid=\"\$${class}gid\"" michael@13: if [ ".$xuid" = . ]; then michael@428: case "$plid" in michael@428: Darwin/10.[1-9]* | Darwin/1[1-9].* ) michael@428: xuid=`dscl . -read "/users/${xusr}" UniqueID 2>/dev/null | awk '{ print $2; }'` michael@428: ;; michael@428: * ) michael@428: xuid=`(getent passwd "${xusr}"; \ michael@428: grep "^${xusr}:" /etc/passwd; \ michael@428: ypmatch "${xusr}" passwd; \ michael@428: nismatch "${xusr}" passwd; \ michael@428: nidump passwd . | grep "^${xusr}:") 2>/dev/null | \ michael@428: sed -e 'q' | awk -F: '{ print $3; }'` michael@428: ;; michael@428: esac michael@13: if [ ".$xuid" = . ]; then michael@13: # seek for a reasonably uid/gid pair michael@13: xuid=1000 michael@13: ok=0 michael@13: while [ ".$ok" = .0 ]; do michael@13: eval "u_exists=\$u_exists_$xuid" michael@13: if [ ".$u_exists" = . ]; then michael@428: case "$plid" in michael@428: Darwin/10.[1-9]* | Darwin/1[1-9].* ) michael@428: u_exists=`dscl . -search /users UniqueID "$xuid" 2>/dev/null` michael@428: ;; michael@428: * ) michael@428: u_exists=`(getent passwd; cat /etc/passwd; ypcat passwd; niscat passwd; nidump passwd .) 2>/dev/null |\ michael@428: grep "^[^:]*:[^:]*:$xuid:"` michael@428: ;; michael@428: esac michael@13: fi michael@13: eval "g_exists=\$g_exists_$xuid" michael@13: if [ ".$g_exists" = . ]; then michael@428: case "$plid" in michael@428: Darwin/10.[1-9]* | Darwin/1[1-9].* ) michael@428: g_exists=`dscl . -search /groups PrimaryGroupID "$xuid" 2>/dev/null` michael@428: ;; michael@428: * ) michael@428: g_exists=`(getent group; cat /etc/group; ypcat group; niscat group; nidump group .) 2>/dev/null |\ michael@428: grep "^[^:]*:[^:]*:$xuid:"` michael@428: esac michael@13: fi michael@13: if [ ".$u_exists" = . -a ".$g_exists" = . ]; then michael@13: ok=1 michael@13: break michael@13: fi michael@13: xuid=`expr $xuid + 1` michael@13: done michael@13: eval "u_exists_$xuid=yes" michael@13: eval "g_exists_$xuid=yes" michael@13: fi michael@13: fi michael@13: if [ ".$xgid" = . ]; then michael@13: xgid=`(getent group "${xgrp}"; \ michael@13: grep "^${xgrp}:" /etc/group; \ michael@13: ypmatch "${xgrp}" group; \ michael@13: nismatch "${xgrp}" group; \ michael@428: nidump group . | grep "^${xgrp}:"; \ michael@428: dscl . -read "/groups/${xgrp}" | grep RecordName) 2>/dev/null | \ michael@13: sed -e 'q' | awk -F: '{ print $3; }'` michael@13: if [ ".$xgid" = . ]; then michael@13: xgid="$xuid" michael@13: fi michael@13: fi michael@13: eval "${class}uid=\"$xuid\"" michael@13: eval "${class}gid=\"$xgid\"" michael@13: done michael@13: michael@13: # determine platform id michael@13: s=`(uname -s) 2>/dev/null` || s='Unknown' michael@13: r=`(uname -r) 2>/dev/null` || r='0.0' michael@13: plid="${s}/${r}" michael@13: michael@13: # add entry to /etc/shells michael@13: shell="${prefix}/lib/openpkg/bash" michael@13: if [ -f /etc/shells ]; then michael@13: exists=`cat /etc/shells 2>/dev/null | grep "^$shell"` michael@13: if [ ".$exists" = . ]; then michael@13: if [ ".$cusr" != ".root" ]; then michael@13: echo "openpkg:WARNING: skipping addition of $shell to /etc/shells" 1>&2 michael@13: echo "openpkg:WARNING: (would require root-privileges)" 1>&2 michael@13: else michael@13: echo "${shell}" >>/etc/shells michael@13: fi michael@13: fi michael@13: fi michael@13: michael@13: # clear pending deferred actions michael@13: rm -f %{l_prefix}.pre-group-process.sh %{l_prefix}.pre-post-process.sh >/dev/null 2>&1 michael@13: michael@13: # create the hierarchy user/group michael@13: for req in "superuser:${susr}:${suid}:${sgrp}:${sgid}" \ michael@13: "management:${musr}:${muid}:${mgrp}:${mgid}" \ michael@13: "restricted:${rusr}:${ruid}:${rgrp}:${rgid}" \ michael@13: "non-privileged:${nusr}:${nuid}:${ngrp}:${ngid}"; do michael@13: # split request into class/usr/uid/grp/gid michael@13: OIFS="$IFS"; IFS=":"; set -- $req; IFS="$OIFS" michael@13: class="$1"; usr="$2"; uid="$3"; grp="$4"; gid="$5" michael@13: michael@13: # check whether user already exists michael@13: exists=`(getent passwd "$usr"; \ michael@13: grep "^$usr:" /etc/passwd; \ michael@13: ypmatch "$usr" passwd; \ michael@13: nismatch "$usr" passwd; \ michael@428: nidump passwd . | grep "^$usr:"; \ michael@428: dscl . -read "/users/$usr" | grep RecordName) 2>/dev/null | \ michael@13: sed -e 'q'` michael@13: if [ ".$exists" = . ]; then michael@13: if [ ".$cusr" != ".root" ]; then michael@13: echo "openpkg:WARNING: skipping creation of OpenPKG $class user $usr" 1>&2 michael@13: echo "openpkg:WARNING: (would require root-privileges)" 1>&2 michael@13: else michael@13: # add entry to passwd database michael@13: realname="${prefix} OpenPKG ($class)" michael@13: case "$plid" in michael@13: FreeBSD/* | NetBSD/* ) michael@13: file=/etc/master.passwd michael@13: entry="${usr}:*:${uid}:${gid}::0:0:${realname}:${prefix}:${shell}" michael@13: update="(PATH=\$PATH:/usr/sbin; pwd_mkdb -p /etc/master.passwd)" michael@13: ;; michael@13: Linux/* ) michael@13: file=/etc/passwd michael@13: entry="${usr}:*:${uid}:${gid}:${realname}:${prefix}:${shell}" michael@13: update="(PATH=\$PATH:/usr/sbin; pwconv)" michael@13: ;; michael@13: SunOS/5.* | UnixWare/* ) michael@13: file=/etc/passwd michael@13: entry="${usr}:*:${uid}:${gid}:${realname}:${prefix}:${shell}" michael@13: update="(PATH=\$PATH:/usr/sbin; pwconv)" michael@13: ;; michael@13: AIX/* ) michael@13: # intentionally do nothing here michael@13: : michael@13: ;; michael@13: OSF1/V5.* ) michael@13: file=/etc/passwd michael@13: entry="${usr}:*:${uid}:${gid}:${realname}:${prefix}:${shell}" michael@13: update="(PATH=\$PATH:/usr/sbin; mkpasswd /etc/passwd)" michael@13: ;; michael@13: HP-UX/* ) michael@13: file=/etc/passwd michael@13: entry="${usr}:*:${uid}:${gid}:${realname}:${prefix}:${shell}" michael@13: update=":" michael@13: ;; michael@13: Darwin/* ) michael@13: # intentionally do nothing here michael@13: : michael@13: ;; michael@13: IRIX*/6.* ) michael@13: file=/etc/passwd michael@13: entry="${usr}:*:${uid}:${gid}:${realname}:${prefix}:${shell}" michael@13: if [ -f /etc/shadow ] michael@13: then update="(PATH=\$PATH:/sbin; pwconv)" michael@13: else update=":" michael@13: fi michael@13: ;; michael@428: CYGWIN*/* ) michael@428: file=/etc/passwd michael@428: entry="${usr}:*:${uid}:${gid}:${realname}:${prefix}:${shell}" michael@428: update=":" michael@428: ;; michael@13: esac michael@13: case "$plid" in michael@428: Darwin/10.[1-9]* | Darwin/1[1-9].* ) michael@428: dscl . -create "/users/${usr}" michael@428: dscl . -create "/users/${usr}" Password "*" michael@428: dscl . -create "/users/${usr}" UniqueID "${uid}" michael@428: dscl . -create "/users/${usr}" PrimaryGroupID "${gid}" michael@428: dscl . -create "/users/${usr}" RealName "${realname}" michael@428: dscl . -create "/users/${usr}" NFSHomeDirectory "${prefix}" michael@428: dscl . -create "/users/${usr}" UserShell "${shell}" michael@428: ;; michael@13: Darwin/* ) michael@13: niutil -create . "/users/${usr}" michael@13: niutil -createprop . "/users/${usr}" passwd "*" michael@13: niutil -createprop . "/users/${usr}" uid "${uid}" michael@13: niutil -createprop . "/users/${usr}" gid "${gid}" michael@13: niutil -createprop . "/users/${usr}" realname "${realname}" michael@13: niutil -createprop . "/users/${usr}" home "${prefix}" michael@13: niutil -createprop . "/users/${usr}" shell "${shell}" michael@13: ;; michael@13: AIX/* ) michael@13: mkuser id="${uid}" gecos="${realname}" home="${prefix}" "${usr}" michael@13: cp /etc/security/login.cfg /etc/security/login.cfg.bak && \ michael@13: sed -e "/^usw:/,/^[^ ]/s;\\( *shells =.*\\) *\$;\\1,$shell;" \ michael@13: /etc/security/login.cfg && \ michael@13: rm -f /etc/security/login.cfg.bak >/dev/null 2>&1 michael@13: # defer both the setting of the primary group and the shell, michael@13: # as they do not exist at this stage of processing. michael@13: echo "chuser pgrp=\"${grp}\" \"${usr}\"" >>%{l_prefix}.pre-group-process.sh michael@13: echo "chuser shell=\"${shell}\" \"${usr}\"" >>%{l_prefix}.pre-post-process.sh michael@13: ;; michael@13: * ) michael@13: cp $file $file.bak && \ michael@13: (grep -v '^+:' $file.bak; echo $entry; grep '^+:' $file.bak) >$file michael@13: rm -f $file.bak >/dev/null 2>&1 michael@13: eval $update michael@13: [ $? -ne 0 ] && exit $? michael@13: ;; michael@13: esac michael@13: fi michael@13: fi michael@13: michael@13: # check whether group already exists michael@13: exists=`(getent group "$grp"; \ michael@13: grep "^$grp:" /etc/group; \ michael@13: ypmatch "$grp" group; \ michael@13: nismatch "$grp" group; \ michael@428: nidump group . | grep "^$grp:"; \ michael@428: dscl . -read "/groups/$grp" | grep RecordName) 2>/dev/null | \ michael@13: sed -e 'q'` michael@13: if [ ".$exists" = . ]; then michael@13: if [ ".$cusr" != ".root" ]; then michael@13: echo "openpkg:WARNING: skipping creation of OpenPKG $class group $grp" 1>&2 michael@13: echo "openpkg:WARNING: (would require root-privileges)" 1>&2 michael@13: else michael@13: case "$plid" in michael@428: Darwin/10.[1-9]* | Darwin/1[1-9].* ) michael@428: dscl . -create "/groups/${grp}" michael@428: dscl . -create "/groups/${grp}" Password "*" michael@428: dscl . -create "/groups/${grp}" PrimaryGroupID "${gid}" michael@428: dscl . -create "/groups/${grp}" GroupMembership "${usr}" michael@428: ;; michael@13: Darwin/* ) michael@13: niutil -create . "/groups/${grp}" michael@13: niutil -createprop . "/groups/${grp}" gid "${gid}" michael@13: niutil -createprop . "/groups/${grp}" users "${usr}" michael@13: ;; michael@13: AIX/* ) michael@13: mkgroup id="${gid}" users="${usr}" "${grp}" michael@13: ;; michael@13: * ) michael@13: # add entry to group database michael@13: file=/etc/group michael@13: entry="${grp}:*:${gid}:${usr}" michael@13: cp $file $file.bak && \ michael@13: (grep -v '^+:' $file.bak; echo $entry; grep '^+:' $file.bak) >$file michael@13: rm -f $file.bak >/dev/null 2>&1 michael@13: ;; michael@13: esac michael@13: fi michael@13: fi michael@13: done michael@13: michael@13: # optional group processing (deferred adjustment of primary group) michael@13: if [ -f %{l_prefix}.pre-group-process.sh ]; then michael@13: sh %{l_prefix}.pre-group-process.sh michael@13: rm -f %{l_prefix}.pre-group-process.sh michael@13: fi michael@13: michael@13: # invalidate passwd and group tables from Name Service Cache Daemon to michael@13: # ensure chown/chgrp works immediately after pwconv on Linux and Solaris michael@13: if [ -x /usr/sbin/nscd ]; then michael@13: /usr/sbin/nscd -i passwd >/dev/null 2>&1 || true michael@428: /usr/sbin/nscd -i group >/dev/null 2>&1 || true michael@13: fi michael@13: michael@13: # create the startup/shutdown transfer script michael@428: name_old="`echo "$prefix" | sed -e 's;/;;g'`" michael@428: name="openpkg-`echo "$prefix" | sed -e 's;[^a-zA-Z0-9];;g'`" michael@13: if [ ".$cusr" != ".root" ]; then michael@13: echo "openpkg:WARNING: skipping creation of system run-command hooks" 1>&2 michael@13: echo "openpkg:WARNING: (would require root-privileges)" 1>&2 michael@13: else michael@13: case "$plid" in michael@13: FreeBSD/* ) michael@428: if [ -f /etc/rc.d/${name_old} ]; then michael@428: rm -f /etc/rc.d/${name_old} michael@428: fi michael@428: if [ ! -f /etc/rc.d/${name} ]; then michael@13: # install transfer script michael@428: rm -f /etc/rc.d/${name} >/dev/null 2>&1 michael@13: ( echo "#!/bin/sh" michael@13: echo "##" michael@428: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@13: echo "##" michael@13: echo "" michael@428: echo "# PROVIDE: ${name}" michael@13: echo "# REQUIRE: LOGIN" michael@13: echo "# KEYWORD: shutdown" michael@13: echo "" michael@13: echo ". /etc/rc.subr" michael@13: echo "" michael@13: echo "name=\"openpkg_${name}\"" michael@13: echo "start_cmd=\"openpkg_rc_all start\"" michael@13: echo "stop_cmd=\"openpkg_rc_all stop\"" michael@13: echo "restart_cmd=\"openpkg_rc_all stop start\"" michael@13: echo "" michael@13: echo "openpkg_rc_all () {" michael@428: echo " if [ -f ${prefix}/bin/openpkg ]; then" michael@428: echo " ${prefix}/bin/openpkg rc all \"\$@\"" michael@13: echo " fi" michael@13: echo "}" michael@13: echo "" michael@13: echo "load_rc_config \$name" michael@13: echo "run_rc_command \"\$1\"" michael@13: echo "" michael@428: ) >/etc/rc.d/${name} michael@428: chmod 755 /etc/rc.d/${name} michael@13: fi michael@13: ;; michael@13: NetBSD/* ) michael@428: if [ -f /etc/rc.d/${name_old} ]; then michael@428: rm -f /etc/rc.d/${name_old} michael@428: fi michael@13: if [ ! -f /etc/rc.d/${name} ]; then michael@13: ( echo "#!/bin/sh" michael@13: echo "##" michael@13: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@13: echo "##" michael@13: echo "## PROVIDE: ${name}" michael@13: echo "## REQUIRE: DAEMON LOGIN NETWORK SERVERS" michael@13: echo "##" michael@13: echo "" michael@428: echo "[ ! -f ${prefix}/bin/openpkg ] && exit 0" michael@13: echo "case \$1 in" michael@428: echo " start ) exec ${prefix}/bin/openpkg rc all start ;;" michael@428: echo " stop ) exec ${prefix}/bin/openpkg rc all stop ;;" michael@428: echo " restart ) exec ${prefix}/bin/openpkg rc all stop start ;;" michael@13: echo " status ) ;;" michael@13: echo "esac" michael@13: ) >/etc/rc.d/${name} michael@13: chmod 755 /etc/rc.d/${name} michael@13: fi michael@13: ;; michael@13: Linux/* ) michael@13: if [ -f /etc/gentoo-release ]; then michael@428: if [ -f /etc/init.d/${name_old} ]; then michael@428: rm -f /etc/init.d/${name_old} michael@428: fi michael@428: if [ ! -f /etc/init.d/${name} ]; then michael@13: # install transfer script michael@13: ( echo "#!/sbin/runscript" michael@13: echo "##" michael@428: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@13: echo "##" michael@13: echo "" michael@13: echo "depend() {" michael@13: echo " after *" michael@13: echo "}" michael@13: echo "" michael@13: echo "checkconfig() {" michael@428: echo " [ -f ${prefix}/bin/openpkg ] || return 1" michael@13: echo " case $1 in" michael@428: echo " start ) exec ${prefix}/bin/openpkg rc all start ;;" michael@428: echo " stop ) exec ${prefix}/bin/openpkg rc all stop ;;" michael@13: echo " esac" michael@13: echo "}" michael@13: echo "" michael@13: echo "start() {" michael@13: echo " checkconfig || return 1" michael@13: echo " ebegin "Starting OpenPKG ${prefix} hierarchy"" michael@428: echo " exec ${prefix}/bin/openpkg rc all start" michael@13: echo " eend 0" michael@13: echo "}" michael@13: echo "" michael@13: echo "stop() {" michael@13: echo " checkconfig || return 1" michael@13: echo " ebegin "Stopping OpenPKG ${prefix} hierarchy"" michael@428: echo " exec ${prefix}/bin/openpkg rc all stop" michael@13: echo " eend 0" michael@13: echo "}" michael@428: ) >/etc/init.d/${name} michael@428: chmod 755 /etc/init.d/${name} michael@428: /sbin/rc-update add ${name} default michael@428: fi michael@428: elif [ -f /etc/redhat-release ]; then michael@428: sroot=/etc/rc.d/init.d michael@428: if [ ! -f $sroot/${name} ]; then michael@428: # install transfer script michael@428: ( echo "#!/bin/sh" michael@428: echo "##" michael@428: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@428: echo "##" michael@428: echo "" michael@428: echo "# chkconfig: 2345 99 00" michael@428: echo "# description: OpenPKG ${prefix}" michael@428: echo "" michael@428: echo "[ ! -f ${prefix}/bin/openpkg ] && exit 0" michael@428: echo "case \$1 in" michael@428: echo " start ) exec ${prefix}/bin/openpkg rc all start ;;" michael@428: echo " stop ) exec ${prefix}/bin/openpkg rc all stop ;;" michael@428: echo "esac" michael@428: ) >$sroot/${name} michael@428: chmod 755 $sroot/${name} michael@428: # activate script michael@428: /sbin/chkconfig --add ${name} michael@428: /sbin/chkconfig ${name} on michael@13: fi michael@13: else michael@13: # sroot: script root directory michael@13: # lroot: link root directory michael@13: if [ -f /etc/debian_version ]; then michael@13: sroot=/etc/init.d michael@428: lroot=/etc/rc%%d.d michael@428: elif [ -f /etc/mandrake-release ]; then michael@13: sroot=/etc/rc.d/init.d michael@428: lroot=/etc/rc.d/rc%%d.d michael@13: elif [ -f /etc/SuSE-release ]; then michael@13: sroot=/etc/init.d michael@428: lroot=/etc/init.d/rc%%d.d michael@13: elif [ -f /etc/slackware-version ]; then michael@13: sroot=/etc/rc.d michael@428: lroot=/etc/rc.d/rc%%d.d michael@13: name="rc.${name}" michael@13: for i in 0 1 2 3 4 5 6; do michael@428: l=`echo $lroot | sed -e "s;%%d;$i;"` michael@13: if [ ! -d $l ]; then michael@13: mkdir $l 2>&1 || true michael@13: fi michael@13: done michael@13: else michael@13: echo "WARNING: you are not running one of the supported standard" 1>&2 michael@13: echo "WARNING: Linux platforms (Debian, RedHat, Mandrake, SuSE, Gentoo)." 1>&2 michael@13: echo "WARNING: Guessing the location of the system init scripts!" 1>&2 michael@13: sroot="" michael@13: lroot="" michael@13: for sr in /etc/rc.d/init.d /etc/init.d /sbin/init.d; do michael@13: if [ -d $sr ]; then michael@13: sroot="$sr" michael@13: break michael@13: fi michael@13: done michael@13: for lr in /etc/rc.d/rc2.d /etc/rc2.d /sbin/init.d/rc2.d; do michael@13: if [ -d $lr ]; then michael@428: lroot="`echo $lr | sed -e 's;2;%%d;'`" michael@13: break michael@13: fi michael@13: done michael@13: if [ ".$sroot" = . -o ".$lroot" = . ]; then michael@13: echo "ERROR: Failed to guess the location of the system init scripts!" 1>&2 michael@13: exit 1 michael@13: fi michael@13: fi michael@428: if [ -f $sroot/${name_old} ]; then michael@428: rm -f $sroot/${name_old} michael@428: fi michael@13: if [ ! -f $sroot/${name} ]; then michael@13: # install transfer script michael@13: ( echo "#!/bin/sh" michael@13: echo "##" michael@13: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@13: echo "##" michael@13: echo "" michael@428: echo "[ ! -f ${prefix}/bin/openpkg ] && exit 0" michael@13: echo "case \$1 in" michael@428: echo " start ) exec ${prefix}/bin/openpkg rc all start ;;" michael@428: echo " stop ) exec ${prefix}/bin/openpkg rc all stop ;;" michael@13: echo "esac" michael@13: ) >$sroot/${name} michael@13: chmod 755 $sroot/${name} michael@13: # create corresponding symbolic links michael@13: for i in 2 3 4 5; do michael@428: ln -s $sroot/${name} `echo $lroot | sed -e "s;%%d;$i;"`/S99${name} michael@13: done michael@13: for i in 0 1 6; do michael@428: ln -s $sroot/${name} `echo $lroot | sed -e "s;%%d;$i;"`/K00${name} michael@13: done michael@13: fi michael@13: fi michael@13: ;; michael@437: SunOS/5.1* ) michael@437: if [ ! -d /var/svc/manifest/openpkg ]; then michael@437: mkdir /var/svc/manifest/openpkg michael@437: fi michael@437: if [ ! -f /var/svc/manifest/openpkg/${name}.xml ]; then michael@437: # install SMF manifest michael@437: ( echo "" michael@437: echo "" michael@437: echo "" michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo " " michael@437: echo "" michael@437: ) >/var/svc/manifest/openpkg/${name}.xml michael@437: chmod 644 /var/svc/manifest/openpkg/${name}.xml michael@437: /usr/sbin/svccfg import /var/svc/manifest/openpkg/${name}.xml michael@437: ( echo "/usr/sbin/svcadm enable \"svc:/openpkg/${name}:default\"" michael@437: ) >%{l_prefix}.pre-post-process.sh michael@437: fi michael@437: ;; michael@428: SunOS/5.* ) michael@428: if [ -f /etc/init.d/${name_old} ]; then michael@428: rm -f /etc/init.d/${name_old} michael@329: fi michael@13: if [ ! -f /etc/init.d/${name} ]; then michael@13: # install transfer script michael@13: ( echo "#!/bin/sh" michael@13: echo "##" michael@13: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@13: echo "##" michael@13: echo "" michael@428: echo "[ ! -f ${prefix}/bin/openpkg ] && exit 0" michael@13: echo "case \$1 in" michael@428: echo " start ) exec ${prefix}/bin/openpkg rc all start ;;" michael@428: echo " stop ) exec ${prefix}/bin/openpkg rc all stop ;;" michael@13: echo "esac" michael@13: ) >/etc/init.d/${name} michael@13: chmod 755 /etc/init.d/${name} michael@13: # create corresponding symbolic links michael@13: ( cd /etc michael@13: ln init.d/${name} rc3.d/S99${name} michael@13: ln init.d/${name} rc0.d/K00${name} michael@13: ln init.d/${name} rc1.d/K00${name} michael@13: ) || exit $? michael@13: fi michael@13: ;; michael@13: UnixWare/* ) michael@428: if [ -f /etc/init.d/${name_old} ]; then michael@428: rm -f /etc/init.d/${name_old} michael@428: fi michael@13: if [ ! -f /etc/init.d/${name} ]; then michael@13: # install transfer script michael@13: ( echo "#!/bin/sh" michael@13: echo "##" michael@13: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@13: echo "##" michael@13: echo "" michael@428: echo "[ ! -f ${prefix}/bin/openpkg ] && exit 0" michael@13: echo "case \$1 in" michael@428: echo " start ) exec ${prefix}/bin/openpkg rc all start ;;" michael@428: echo " stop ) exec ${prefix}/bin/openpkg rc all stop ;;" michael@13: echo "esac" michael@13: ) >/etc/init.d/${name} michael@13: chmod 755 /etc/init.d/${name} michael@13: # create corresponding symbolic links michael@13: ( cd /etc michael@13: ln init.d/${name} rc2.d/S99${name} michael@13: ln init.d/${name} rc0.d/K00${name} michael@13: ln init.d/${name} rc1.d/K00${name} michael@13: ) || exit $? michael@13: fi michael@13: ;; michael@13: AIX/* ) michael@428: if [ -f /etc/rc.d/init.d/${name_old} ]; then michael@428: rm -f /etc/rc.d/init.d/${name_old} michael@428: fi michael@13: if [ ! -f /etc/rc.d/init.d/${name} ]; then michael@13: # install transfer script michael@13: ( echo "#!/bin/sh" michael@13: echo "##" michael@13: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@13: echo "##" michael@13: echo "" michael@428: echo "[ ! -f ${prefix}/bin/openpkg ] && exit 0" michael@13: echo "case \$1 in" michael@428: echo " start ) exec ${prefix}/bin/openpkg rc all start ;;" michael@428: echo " stop ) exec ${prefix}/bin/openpkg rc all stop ;;" michael@13: echo "esac" michael@13: ) >/etc/rc.d/init.d/${name} michael@13: chmod 755 /etc/rc.d/init.d/${name} michael@13: # create corresponding symbolic links michael@13: ( cd /etc/rc.d michael@13: ln -s ../init.d/${name} rc2.d/S99${name} michael@13: ) || exit $? michael@13: fi michael@13: ;; michael@13: OSF1/V5.* ) michael@428: if [ -f /sbin/init.d/${name_old} ]; then michael@428: rm -f /sbin/init.d/${name_old} michael@428: fi michael@13: if [ ! -f /sbin/init.d/${name} ]; then michael@13: # install transfer script michael@13: ( echo "#!/bin/sh" michael@13: echo "##" michael@13: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@13: echo "##" michael@13: echo "" michael@428: echo "[ ! -f ${prefix}/bin/openpkg ] && exit 0" michael@13: echo "case \$1 in" michael@428: echo " start ) exec ${prefix}/bin/openpkg rc all start ;;" michael@428: echo " stop ) exec ${prefix}/bin/openpkg rc all stop ;;" michael@13: echo "esac" michael@13: ) >/sbin/init.d/${name} michael@13: chmod 755 /sbin/init.d/${name} michael@13: # create corresponding symbolic links michael@13: ( cd /sbin michael@13: ln -s ../init.d/${name} rc3.d/S99${name} michael@13: ln -s ../init.d/${name} rc0.d/K00${name} michael@13: ) || exit $? michael@13: fi michael@13: ;; michael@13: HP-UX/* ) michael@428: if [ -f /sbin/init.d/${name_old} ]; then michael@428: rm -f /sbin/init.d/${name_old} michael@428: fi michael@13: if [ ! -f /sbin/init.d/${name} ]; then michael@13: # install transfer script michael@13: ( echo "#!/bin/sh" michael@13: echo "##" michael@13: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@13: echo "##" michael@13: echo "" michael@428: echo "[ ! -f ${prefix}/bin/openpkg ] && exit 0" michael@13: echo "case \$1 in" michael@428: echo " start ) exec ${prefix}/bin/openpkg rc all start ;;" michael@428: echo " stop ) exec ${prefix}/bin/openpkg rc all stop ;;" michael@13: echo "esac" michael@13: ) >/sbin/init.d/${name} michael@13: chmod 755 /sbin/init.d/${name} michael@13: # create corresponding symbolic links michael@13: ( cd /sbin michael@13: ln -s ../init.d/${name} rc2.d/S900${name} michael@13: ln -s ../init.d/${name} rc1.d/K100${name} michael@13: ) || exit $? michael@13: fi michael@13: ;; michael@13: Darwin/* ) michael@428: if [ -d /Library/StartupItems/${name_old} ]; then michael@428: rm -rf /Library/StartupItems/${name_old} michael@428: fi michael@428: darwin_rc_dir="/Library/StartupItems/${name}" michael@13: if [ ! -d ${darwin_rc_dir} ]; then michael@428: mkdir -p ${darwin_rc_dir} michael@13: fi michael@13: michael@13: # make sure hierarchy is activated in /etc/hostconfig michael@13: # FIXME: cs: simple and bad code here without any detection of existing entries michael@428: darwin_rc_var="`echo ${name} | sed -e 's;-;_;g' | tr '[a-z]' '[A-Z]'`" michael@428: echo "${darwin_rc_var}=-YES-" >>/etc/hostconfig michael@13: michael@13: # install transfer script michael@13: if [ ! -f ${darwin_rc_dir}/${name} ]; then michael@13: rm -f ${darwin_rc_dir}/${name} >/dev/null 2>&1 michael@13: ( echo "#!/bin/sh" michael@13: echo "##" michael@13: echo "## ${darwin_rc_dir}/${name}" michael@428: echo "## -- startup transfer script for OpenPKG ${prefix} hierarchy" michael@13: echo "##" michael@13: echo "" michael@428: echo "[ ! -f ${prefix}/bin/openpkg ] && exit 0" michael@13: echo "" michael@13: echo ". /etc/rc.common" michael@13: echo "" michael@428: echo "if [ \"\${${darwin_rc_var}:=-NO-}\" = \"-YES-\" ]; then" michael@13: echo " ConsoleMessage \"OpenPKG ${prefix} hierarchy\"" michael@428: echo " ${prefix}/bin/openpkg rc all start" michael@13: echo "fi" michael@13: ) >${darwin_rc_dir}/${name} michael@13: chmod 755 ${darwin_rc_dir}/${name} michael@13: fi michael@428: michael@13: # install startup parameter list michael@13: if [ ! -f ${darwin_rc_dir}/StartupParameters.plist ]; then michael@13: rm -f ${darwin_rc_dir}/StartupParameters.plist >/dev/null 2>&1 michael@13: ( echo "{" michael@13: echo " Description = \"OpenPKG ${prefix} hierarchy\";" michael@13: echo " Provides = (\"OpenPKG ${prefix}\");" michael@13: echo " Requires = (\"Disks\", \"Network Configuration\", \"Resolver\");" michael@13: echo " Uses = (\"Cron\");" michael@13: echo " OrderPreference = \"Last\";" michael@13: echo " Messages =" michael@13: echo " {" michael@13: echo " start = \"Starting OpenPKG ${prefix} hierarchy\";" michael@13: echo " stop = \"Stopping OpenPKG ${prefix} hierarchy\";" michael@13: echo " };" michael@13: echo "}" michael@13: ) >${darwin_rc_dir}/StartupParameters.plist michael@13: chmod 644 ${darwin_rc_dir}/StartupParameters.plist michael@13: fi michael@13: ;; michael@13: IRIX*/6.* ) michael@428: if [ -f /etc/init.d/${name_old} ]; then michael@428: rm -f /etc/init.d/${name_old} michael@428: fi michael@13: if [ ! -f /etc/init.d/${name} ]; then michael@13: # install transfer script michael@13: ( echo "#!/bin/sh" michael@13: echo "##" michael@13: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@13: echo "##" michael@13: echo "" michael@428: echo "[ ! -f ${prefix}/bin/openpkg ] && exit 0" michael@13: echo "case \$1 in" michael@428: echo " start ) exec ${prefix}/bin/openpkg rc all start ;;" michael@428: echo " stop ) exec ${prefix}/bin/openpkg rc all stop ;;" michael@13: echo "esac" michael@13: ) >/etc/init.d/${name} michael@13: chmod 755 /etc/init.d/${name} michael@13: # create corresponding links michael@13: ( cd /etc michael@13: ln -f init.d/${name} rc2.d/S99${name} michael@13: ln -f init.d/${name} rc0.d/K00${name} michael@13: ) || exit $? michael@13: fi michael@13: ;; michael@428: CYGWIN*/* ) michael@428: if [ -f /etc/rc.d/init.d/${name_old} ]; then michael@428: rm -f /etc/rc.d/init.d/${name_old} michael@428: fi michael@428: if [ ! -f /etc/rc.d/init.d/${name} ]; then michael@428: # install transfer script michael@428: ( echo "#!/bin/sh" michael@428: echo "##" michael@428: echo "## ${name} -- startup/shutdown transfer script for OpenPKG ${prefix} hierarchy" michael@428: echo "##" michael@428: echo "" michael@428: echo "test -f /etc/rc.d/init.d/functions && . /etc/rc.d/init.d/functions" michael@428: echo "test -f /etc/sysconfig/network && . /etc/sysconfig/network" michael@428: echo "[ ! -f ${prefix}/bin/openpkg ] && exit 0" michael@428: echo "case \$1 in" michael@428: echo " start ) exec ${prefix}/bin/openpkg rc all start ;;" michael@428: echo " stop ) exec ${prefix}/bin/openpkg rc all stop ;;" michael@428: echo "esac" michael@428: ) >/etc/rc.d/init.d/${name} michael@428: chmod 755 /etc/rc.d/init.d/${name} michael@428: # create corresponding symbolic links michael@428: ( cd /etc/rc.d michael@428: ln -s ../init.d/${name} rc2.d/S90${name} michael@428: ln -s ../init.d/${name} rc1.d/K10${name} michael@428: ) || exit $? michael@428: fi michael@428: ;; michael@13: esac michael@13: fi michael@13: michael@13: # create the cron transfer entries michael@13: if [ ".$cusr" != ".root" ]; then michael@13: echo "openpkg:WARNING: skipping creation of system cron hooks" 1>&2 michael@13: echo "openpkg:WARNING: (would require root-privileges)" 1>&2 michael@13: else michael@13: case "$plid" in michael@428: FreeBSD/* | Linux/* ) michael@13: if [ -f /etc/slackware-version ]; then michael@428: exists=`crontab -l | egrep "($prefix/bin/openpkg|$prefix/etc/rc)"` michael@13: if [ ".$exists" = . ]; then michael@13: EDITOR=/tmp/vipw.$$ michael@13: VISUAL="$EDITOR" michael@13: export EDITOR michael@13: export VISUAL michael@13: ( echo "#!/bin/sh" michael@13: echo "( echo \"# \"" michael@13: echo " echo \"# chronological tasks of ${prefix} OpenPKG hierarchy\"" michael@428: echo " echo \"0 0 1 * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron monthly\"" michael@428: echo " echo \"0 0 * * 0 [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron weekly\"" michael@428: echo " echo \"0 0 * * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron daily\"" michael@428: echo " echo \"0 * * * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron hourly\"" michael@428: echo " echo \"0,15,30,45 * * * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron quarterly\"" michael@13: echo " echo \"# \"" michael@13: echo ") >>\$1" michael@13: ) >$EDITOR michael@13: chmod a+x $EDITOR michael@13: ( PATH="$PATH:/usr/bin"; crontab -e ) || exit $? michael@13: rm -f $EDITOR michael@13: fi michael@13: else michael@428: exists=`egrep "($prefix/bin/openpkg|$prefix/etc/rc)" /etc/crontab` michael@13: if [ ".$exists" = . ]; then michael@13: ( echo "# " michael@13: echo "# chronological tasks of ${prefix} OpenPKG hierarchy" michael@428: echo "0 0 1 * * root [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron monthly" michael@428: echo "0 0 * * 0 root [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron weekly" michael@428: echo "0 0 * * * root [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron daily" michael@428: echo "0 * * * * root [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron hourly" michael@428: echo "*/15 * * * * root [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron quarterly" michael@13: echo "# " michael@13: ) >>/etc/crontab michael@13: fi michael@13: fi michael@13: ;; michael@428: SunOS/5.* | OSF1/V5.* | NetBSD/* | HP-UX/* | UnixWare/* | AIX/* | CYGWIN*/* | Darwin/* ) michael@428: exists=`crontab -l | egrep "($prefix/bin/openpkg|$prefix/etc/rc)"` michael@13: if [ ".$exists" = . ]; then michael@13: EDITOR=/tmp/vipw.$$ michael@13: VISUAL="$EDITOR" michael@13: export EDITOR michael@13: export VISUAL michael@13: ( echo "#!/bin/sh" michael@13: echo "( echo \"# \"" michael@13: echo " echo \"# chronological tasks of ${prefix} OpenPKG hierarchy\"" michael@428: echo " echo \"0 0 1 * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron monthly\"" michael@428: echo " echo \"0 0 * * 0 [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron weekly\"" michael@428: echo " echo \"0 0 * * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron daily\"" michael@428: echo " echo \"0 * * * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron hourly\"" michael@428: echo " echo \"0,15,30,45 * * * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron quarterly\"" michael@13: echo " echo \"# \"" michael@13: echo ") >>\$1" michael@13: ) >$EDITOR michael@13: chmod a+x $EDITOR michael@13: ( PATH="$PATH:/usr/bin"; crontab -e ) || exit $? michael@13: rm -f $EDITOR michael@13: fi michael@13: ;; michael@13: IRIX*/6.* ) michael@428: exists=`crontab -l | egrep "($prefix/bin/openpkg|$prefix/etc/rc)"` michael@13: if [ ".$exists" = . ]; then michael@13: ( crontab -l michael@13: echo "# " michael@13: echo "# chronological tasks of ${prefix} OpenPKG hierarchy" michael@428: echo "0 0 1 * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron monthly" michael@428: echo "0 0 * * 0 [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron weekly" michael@428: echo "0 0 * * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron daily" michael@428: echo "0 * * * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron hourly" michael@428: echo "0,15,30,45 * * * * [ -f ${prefix}/bin/openpkg ] && ${prefix}/bin/openpkg rc cron quarterly" michael@13: echo "# " michael@13: ) | /usr/bin/crontab || exit $? michael@13: fi michael@13: ;; michael@13: esac michael@13: fi michael@13: michael@13: # remember what OpenPKG RPM version was installed, so we can michael@13: # correctly upgrade the RPM database in the %post section (see below). michael@13: if [ -d ${prefix}/RPM/DB ]; then michael@13: if [ -x "${prefix}/bin/openpkg" -a -x "${prefix}/libexec/openpkg/rpm" ]; then michael@428: # OpenPKG >= 2.0 michael@13: rpm="${prefix}/bin/openpkg rpm" michael@13: else michael@13: # OpenPKG 1.x michael@13: rpm="${prefix}/bin/rpm" michael@13: fi michael@13: rm -f ${prefix}/RPM/DB/.version >/dev/null 2>&1 || true michael@428: $rpm --version 2>/dev/null |\ michael@13: sed -e 's;^;X;' \ michael@13: -e 's;^X[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$;\1;' \ michael@13: -e 's;^X[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;' \ michael@428: -e 's;^X.*$;0.0;' \ michael@13: >${prefix}/RPM/DB/.version michael@13: fi michael@13: michael@13: %post michael@13: # optional post-processing from "pre" section michael@13: if [ -f %{l_prefix}.pre-post-process.sh ]; then michael@13: sh %{l_prefix}.pre-post-process.sh michael@13: rm -f %{l_prefix}.pre-post-process.sh michael@13: fi michael@13: michael@13: # update or initially create OpenPKG UUID configuration michael@13: %{l_prefix}/bin/openpkg uuid update >/dev/null 2>&1 || true michael@13: michael@428: # when upgrading from RPM 4 to RPM 5 there will be no michael@428: # initial license at all, so create one michael@428: if [ ! -f %{l_prefix}/etc/openpkg/license ]; then michael@428: echo "BOOT" >%{l_prefix}/etc/openpkg/license michael@428: ( chown %{l_musr}:%{l_mgrp} %{l_prefix}/etc/openpkg/license michael@428: chmod 644 %{l_prefix}/etc/openpkg/license michael@428: ) >/dev/null 2>&1 || true michael@428: fi michael@428: michael@428: # finally switch from a possibly active BOOT license to EVAL license michael@428: # (notice: this is really the earliest time we can switch because the michael@428: # previous command had to create the /etc/openpkg/uuid first!) michael@428: if [ ".`cat %{l_prefix}/etc/openpkg/license`" = ".BOOT" ]; then michael@428: echo "EVAL" >%{l_prefix}/etc/openpkg/license michael@428: fi michael@428: michael@13: # determine new and old OpenPKG RPM version michael@428: V_rpm_new="%{V_rpm_major}.%{V_rpm_minor}" michael@13: if [ -f %{l_prefix}/RPM/DB/.version ]; then michael@13: V_rpm_old="`cat %{l_prefix}/RPM/DB/.version`" michael@13: rm -f %{l_prefix}/RPM/DB/.version >/dev/null 2>&1 || true michael@13: else michael@428: V_rpm_old="0.0" michael@13: fi michael@13: michael@13: # make sure all RPM database files are present and that their michael@13: # attributes are correct, etc. This is not a database rebuild michael@13: # operation, so this is fully harmless and can be done always. michael@428: %{l_prefix}/lib/openpkg/rpmdb --quiet --fixate >/dev/null 2>&1 || true michael@13: michael@13: # check RPM database for upgrade requirements michael@13: if [ ".$1" = .2 -a ".$V_rpm_old" != ".$V_rpm_new" ]; then michael@13: # RPM 4.0/4.1 does not allow concurrent database access, so we michael@13: # cannot upgrade the database immediately from here (because michael@13: # we are still running within the execution context of the michael@13: # old RPM which in turn has the database locked) and instead michael@13: # have to just drop a note to the administrator about database michael@428: # upgrading. RPM >= 4.2 in general allows concurrent database michael@13: # access, but the whole stuff is too risky here, too. michael@13: ( echo "You are upgrading the OpenPKG bootstrap from a previous" michael@13: echo "RPM $V_rpm_old based version to this RPM $V_rpm_new based" michael@428: echo "version. The RPM database in %{l_prefix}/RPM/DB/ can be" michael@428: echo "reused, but you first have to upgrade it as soon as" michael@428: echo "possible to the latest format files by executing:" michael@13: echo " \$ %{l_prefix}/bin/openpkg rpm --db-rebuild" michael@13: echo "In case of problems with the RPM database you can always" michael@13: echo "execute the command:" michael@13: echo " \$ %{l_prefix}/bin/openpkg rpm --db-cleanup" michael@13: ) | %{l_prefix}/lib/openpkg/rpmtool msg -b -t warn michael@13: fi michael@13: michael@13: # system command overriding support michael@13: # ATTENTION: THIS BETTER SHOULD BE REPLACED WITH A MORE GENERIC michael@13: # BUILD COMMAND OVERRIDE SOLUTION! michael@13: if [ ! -d %{l_prefix}/lib/openpkg/override ]; then michael@13: mkdir %{l_prefix}/lib/openpkg/override >/dev/null 2>&1 || true michael@13: fi michael@13: chown %{l_musr}:%{l_mgrp} %{l_prefix}/lib/openpkg/override >/dev/null 2>&1 || true michael@13: case "`cat %{l_prefix}/etc/openpkg/platform`" in michael@13: *-*-debian* | *-*-ubuntu* ) michael@13: # FIXME: Evil hack to workaround build problems under Debian michael@13: # (at least 3.1) (and similar platforms) where a Debian michael@13: # install-info(8) exists which is both API and functionally michael@13: # incompatible to the de-facto standardized install-info(8) michael@13: # command from GNU Texinfo. michael@13: if [ ! -f %{l_prefix}/lib/openpkg/override/install-info ]; then michael@13: ( echo "#!/bin/sh" michael@13: echo "echo 'OpenPKG: NOTICE: install-info(8) command execution overridden'" michael@13: echo "exit 0" michael@13: ) >%{l_prefix}/lib/openpkg/override/install-info michael@13: chmod 775 %{l_prefix}/lib/openpkg/override/install-info michael@13: fi michael@13: ;; michael@13: *-*-macosx* | *-*-darwin* ) michael@13: # FIXME: Evil hack to workaround the fact that Mac OS X' michael@13: # linker by default prefers the /usr/lib libraries and does michael@13: # not honor the -L options the way one would expect it. michael@13: gcc="`%{l_prefix}/lib/openpkg/shtool path gcc`" michael@13: cc="`%{l_prefix}/lib/openpkg/shtool path cc`" michael@13: ld="`%{l_prefix}/lib/openpkg/shtool path ld`" michael@13: if [ ".$gcc" != . -a ! -f %{l_prefix}/lib/openpkg/override/gcc ]; then michael@13: ( echo "#!/bin/sh" michael@13: echo "case \" \$* \" in" michael@13: echo " *\" -c \"* | *\" -E \"* ) exec $gcc \"\$@\" ;;" michael@13: echo " * ) exec $gcc -Wl,-search_paths_first \"\$@\" ;;" michael@13: echo "esac" michael@13: ) >%{l_prefix}/lib/openpkg/override/gcc michael@13: chmod 775 %{l_prefix}/lib/openpkg/override/gcc michael@13: fi michael@13: if [ ".$cc" != . -a ! -f %{l_prefix}/lib/openpkg/override/cc ]; then michael@13: ( echo "#!/bin/sh" michael@13: echo "case \" \$* \" in" michael@13: echo " *\" -c \"* | *\" -E \"* ) exec $gcc \"\$@\" ;;" michael@13: echo " * ) exec $cc -Wl,-search_paths_first \"\$@\" ;;" michael@13: echo "esac" michael@13: ) >%{l_prefix}/lib/openpkg/override/cc michael@13: chmod 775 %{l_prefix}/lib/openpkg/override/cc michael@13: fi michael@13: if [ ".$ld" != . -a ! -f %{l_prefix}/lib/openpkg/override/ld ]; then michael@13: ( echo "#!/bin/sh" michael@13: echo "exec $ld -search_paths_first \"\$@\"" michael@13: ) >%{l_prefix}/lib/openpkg/override/ld michael@13: chmod 775 %{l_prefix}/lib/openpkg/override/ld michael@13: fi michael@13: ;; michael@13: esac michael@13: michael@428: # special support for fully unprivileged environments michael@428: # where we cannot switch the user at all with su(1), michael@428: # so we provide a dummy su(1) override command. michael@428: if [ ".%{l_unprivileged}" = ".yes" ]; then michael@428: ( echo "#!/bin/sh" michael@428: echo "while [ \$# -gt 0 ]; do" michael@428: echo " case \"\$1\" in" michael@428: echo " - | -* ) shift ;;" michael@428: echo " * ) shift; break ;;" michael@428: echo " esac" michael@428: echo "done" michael@428: echo "exec /bin/sh \${1+\"\$@\"}" michael@428: ) >%{l_prefix}/lib/openpkg/override/su michael@428: chmod 775 %{l_prefix}/lib/openpkg/override/su michael@428: fi michael@428: michael@13: # FIXME: hack to workaround problems in environments with too few michael@13: # development tools. ATTENTION: see one paragraph above. michael@13: if [ ! -d %{l_prefix}/lib/openpkg/fallback ]; then michael@13: mkdir %{l_prefix}/lib/openpkg/fallback >/dev/null 2>&1 || true michael@13: fi michael@13: chown %{l_musr}:%{l_mgrp} %{l_prefix}/lib/openpkg/fallback >/dev/null 2>&1 || true michael@13: michael@428: # cruel platform hack michael@428: case "`cat %{l_prefix}/etc/openpkg/platform`" in michael@428: *-*-cygwin* ) michael@428: # Cygwin under Windows Vista dislikes executables with michael@428: # "patch" in the same and would require a "*.manifest" michael@428: # file applied with the "mt.exe" from the "Windows michael@428: # Software Development Kit (SDK)" in order to escape from michael@428: # UAC. An easy alternative is to just rename the file to a michael@428: # different name. michael@428: cp %{l_prefix}/lib/openpkg/patch \ michael@428: %{l_prefix}/lib/openpkg/pitch michael@428: %{l_prefix}/lib/openpkg/shtool subst \ michael@428: -e 's;openpkg/patch;openpkg/pitch;g' \ michael@428: %{l_prefix}/etc/openpkg/rpmmacros michael@428: ;; michael@428: esac michael@428: michael@428: # print license michael@428: ( echo "" michael@428: echo "NOTICE: Proprietary components of the OpenPKG Framework are covered" michael@428: echo "by the following terms and conditions and require a valid run-time" michael@428: echo "license, issued by the OpenPKG GmbH. An initial license, which allows" michael@428: echo "30 days of free use for evaluation purposes, is already pre-installed." michael@428: echo "Please go to http://openpkg.com/go/framework-license to obtain" michael@428: echo "your permanent license." michael@428: echo "" michael@428: %{l_prefix}/bin/openpkg --license michael@428: echo "______________________________________________________________________________" michael@428: echo "" michael@428: echo "NOTICE: Open Source components of the OpenPKG Framework are covered" michael@428: echo "by various standard Open Source distribution licenses, including" michael@428: echo "the MIT, BSD, LGPL, GPL, Public-Domain and Artistic licenses." michael@428: echo "They all allow you the use of those components free of charge." michael@428: echo "See http://www.opensource.org/licenses for more details." michael@428: echo "" michael@428: ) | %{l_prefix}/lib/openpkg/rpmtool msg -b -t notice michael@428: michael@428: # register package with central OpenPKG registry michael@428: ( nohup %{l_prefix}/bin/openpkg register \ michael@428: /dev/null 2>&1 & michael@428: ) /dev/null 2>&1 || true michael@13: michael@13: %preun michael@13: [ ".$1" != .0 ] && exit 0 michael@13: michael@13: # remove override files michael@13: if [ -d %{l_prefix}/lib/openpkg/override ]; then michael@13: rm -rf %{l_prefix}/lib/openpkg/override >/dev/null 2>&1 || true michael@13: fi michael@13: michael@13: # remove fallback files michael@13: if [ -d %{l_prefix}/lib/openpkg/fallback ]; then michael@13: rm -rf %{l_prefix}/lib/openpkg/fallback >/dev/null 2>&1 || true michael@13: fi michael@13: michael@13: # remove files which are not RPM controlled michael@13: rm -rf %{l_prefix}/RPM/TMP/* %{l_prefix}/RPM/TMP/.[a-z]* >/dev/null 2>&1 || true michael@13: rm -rf %{l_prefix}/RPM/SRC/* %{l_prefix}/RPM/SRC/.[a-z]* >/dev/null 2>&1 || true michael@13: rm -rf %{l_prefix}/RPM/PKG/* %{l_prefix}/RPM/PKG/.[a-z]* >/dev/null 2>&1 || true michael@428: rm -rf %{l_prefix}/RPM/TR/* %{l_prefix}/RPM/TR/.[a-z]* >/dev/null 2>&1 || true michael@13: rm -rf %{l_prefix}/RPM/DB/* %{l_prefix}/RPM/DB/.[a-z]* >/dev/null 2>&1 || true michael@13: michael@13: # The following code usually would be done in a %postun section. michael@13: # But because we already had to remove the database in this %preun michael@13: # section (see the 'rm' commands above) in order to make RPM happy michael@13: # inside its own removal procedure, RPM would no longer find the michael@13: # %postun script (because it's recorded in the database files). So michael@13: # we have to perform the procedure already in this %preun script. michael@13: # except for the removal of the top-level directory it does not michael@13: # matter. But the top-level directory can only be removed after michael@13: # the RPM removal procedure took place, so we play a little delay michael@13: # trick below. michael@13: michael@13: # determine current user michael@13: cusr=`(id -un) 2>/dev/null ||\ michael@13: (id | sed -e 's;^[^(]*(\([^)]*\)).*;\1;') 2>/dev/null ||\ michael@13: (whoami) 2>/dev/null ||\ michael@13: (who am i | cut "-d " -f1) 2>/dev/null ||\ michael@13: echo $LOGNAME` michael@13: michael@13: # determine runtime details (for both inside and outside RPM!!) michael@13: user="%{l_musr}" michael@13: group="%{l_mgrp}" michael@13: prefix="%{l_prefix}" michael@13: prefix=`echo "$prefix" | sed -e 's;//*;/;g' -e 's;/$;;'` michael@13: michael@13: # determine platform id michael@13: s=`(uname -s) 2>/dev/null` || s='Unknown' michael@13: r=`(uname -r) 2>/dev/null` || r='0.0' michael@13: plid="${s}/${r}" michael@13: michael@13: # unregister instance in presence file michael@13: presence="/etc/openpkg" michael@13: exists=`cat $presence 2>/dev/null | egrep "^ *${prefix} *\$"` michael@13: if [ ".$exists" != . ]; then michael@13: if [ ".$cusr" != ".root" ]; then michael@13: echo "openpkg:WARNING: skipping unregistering of $prefix in $presence" 1>&2 michael@13: echo "openpkg:WARNING: (would require root-privileges)" 1>&2 michael@13: else michael@13: cp $presence $presence.bak && \ michael@13: egrep -v "^ *${prefix} *\$" $presence.bak >$presence michael@13: rm -f $presence.bak >/dev/null 2>&1 michael@13: if [ ".`cat $presence`" = . ]; then michael@13: rm -f $presence >/dev/null 2>&1 michael@13: fi michael@13: fi michael@13: fi michael@13: michael@13: # remove entry in /etc/shells michael@13: shell="${prefix}/lib/openpkg/bash" michael@13: exists=`cat /etc/shells 2>/dev/null | grep "^$shell"` michael@13: if [ ".$exists" != . ]; then michael@13: if [ ".$cusr" != ".root" ]; then michael@13: echo "openpkg:WARNING: skipping deletion of $shell from /etc/shells" 1>&2 michael@13: echo "openpkg:WARNING: (would require root-privileges)" 1>&2 michael@13: else michael@13: cp /etc/shells /etc/shells.bak && \ michael@13: grep -v "^${shell}" /etc/shells.bak >/etc/shells michael@13: rm -f /etc/shells.bak >/dev/null 2>&1 michael@13: fi michael@13: fi michael@13: michael@13: # remove the hierarchy user/group michael@13: for req in "super-user:%{l_susr}:%{l_suid}:%{l_sgrp}:%{l_sgid}" \ michael@13: "management:%{l_musr}:%{l_muid}:%{l_mgrp}:%{l_mgid}" \ michael@13: "restricted:%{l_rusr}:%{l_ruid}:%{l_rgrp}:%{l_rgid}" \ michael@13: "non-privileged:%{l_nusr}:%{l_nuid}:%{l_ngrp}:%{l_ngid}"; do michael@13: # split request into class/usr/uid/grp/gid michael@13: OIFS="$IFS"; IFS=":"; set -- $req; IFS="$OIFS" michael@13: class="$1"; usr="$2"; uid="$3"; grp="$4"; gid="$5" michael@13: michael@13: # check whether user already exists michael@13: exists=`(getent passwd "$usr"; \ michael@13: grep "^$usr:" /etc/passwd; \ michael@13: ypmatch "$usr" passwd; \ michael@13: nismatch "$usr" passwd; \ michael@428: nidump passwd . | grep "^$usr:"; \ michael@428: dscl . -read "/users/$usr" | grep RecordName) 2>/dev/null | \ michael@13: sed -e 'q'` michael@13: if [ ".$exists" != . ]; then michael@13: if [ ".$cusr" != ".root" ]; then michael@13: echo "openpkg:WARNING: skipping deletion of OpenPKG $class user $usr" 1>&2 michael@13: echo "openpkg:WARNING: (would require root-privileges)" 1>&2 michael@13: elif [ ".$usr" = ".root" ]; then michael@13: echo "openpkg:WARNING: skipping deletion of OpenPKG $class user $usr" 1>&2 michael@13: echo "openpkg:WARNING: (would remove system standard user)" 1>&2 michael@13: else michael@13: case "$plid" in michael@13: FreeBSD/* | NetBSD/* ) michael@13: cp /etc/master.passwd /etc/master.passwd.bak && \ michael@13: grep -v "^${usr}:" /etc/master.passwd.bak >/etc/master.passwd michael@13: ( PATH="$PATH:/usr/sbin"; pwd_mkdb -p /etc/master.passwd ) || exit $? michael@13: rm -f /etc/master.passwd.bak >/dev/null 2>&1 michael@13: ;; michael@13: Linux/* | SunOS/5.* | UnixWare/* ) michael@13: cp /etc/passwd /etc/passwd.bak && \ michael@13: grep -v "^${usr}:" /etc/passwd.bak >/etc/passwd michael@13: ( PATH="$PATH:/usr/sbin"; pwconv ) || exit $? michael@13: rm -f /etc/passwd.bak >/dev/null 2>&1 michael@13: ;; michael@13: AIX/* ) michael@13: rmuser -p "${usr}" michael@13: cp /etc/security/login.cfg /etc/security/login.cfg.bak && \ michael@13: sed -e "/^usw:/,/^[^ ]/s;\\( *shells =.*\\),$shell\\(.*\\)\$;\\1\\2;" \ michael@13: /etc/security/login.cfg && \ michael@13: rm -f /etc/security/login.cfg.bak >/dev/null 2>&1 michael@13: ;; michael@13: OSF1/V5.* ) michael@13: cp /etc/passwd /etc/passwd.bak && \ michael@13: grep -v "^${usr}:" /etc/passwd.bak >/etc/passwd michael@13: ( PATH="$PATH:/usr/sbin"; mkpasswd /etc/passwd ) || exit $? michael@13: rm -f /etc/passwd.bak >/dev/null 2>&1 michael@13: ;; michael@13: HP-UX/* ) michael@13: cp /etc/passwd /etc/passwd.bak && \ michael@13: grep -v "^${usr}:" /etc/passwd.bak >/etc/passwd michael@13: rm -f /etc/passwd.bak >/dev/null 2>&1 michael@13: ;; michael@428: Darwin/10.[1-9]* | Darwin/1[1-9].* ) michael@428: dscl . -delete "/users/${usr}" michael@428: ;; michael@13: Darwin/* ) michael@13: niutil -destroy . "/users/${usr}" michael@13: ;; michael@13: IRIX*/6.* ) michael@13: cp /etc/passwd /etc/passwd.bak && \ michael@13: grep -v "^${usr}:" /etc/passwd.bak >/etc/passwd michael@13: if [ -f /etc/shadow ] michael@13: then ( PATH="$PATH:/usr/sbin"; pwconv ) || exit $? michael@13: fi michael@13: rm -f /etc/passwd.bak >/dev/null 2>&1 michael@13: ;; michael@428: CYGWIN*/* ) michael@428: cp /etc/passwd /etc/passwd.bak && \ michael@428: grep -v "^${usr}:" /etc/passwd.bak >/etc/passwd michael@428: rm -f /etc/passwd.bak >/dev/null 2>&1 michael@428: ;; michael@13: esac michael@13: fi michael@13: fi michael@13: michael@13: # check whether group already exists michael@13: exists=`(getent group "$grp"; \ michael@13: grep "^$grp:" /etc/group; \ michael@13: ypmatch "$grp" group; \ michael@13: nismatch "$grp" group; \ michael@428: nidump group . | grep "^$grp:"; \ michael@428: dscl . -read "/groups/$grp" | grep RecordName) 2>/dev/null | \ michael@13: sed -e 'q'` michael@13: if [ ".$exists" != . ]; then michael@13: if [ ".$cusr" != ".root" ]; then michael@13: echo "openpkg:WARNING: skipping deletion of OpenPKG $class group $grp" 1>&2 michael@13: echo "openpkg:WARNING: (would require root-privileges)" 1>&2 michael@13: elif [ ".$usr" = ".root" ] || [ ".$grp" = ".root" ] || [ ".$grp" = ".wheel" ]; then michael@13: echo "openpkg:WARNING: skipping deletion of OpenPKG $class group $grp" 1>&2 michael@13: echo "openpkg:WARNING: (would remove system standard group)" 1>&2 michael@13: else michael@13: case "$plid" in michael@428: Darwin/10.[1-9]* | Darwin/1[1-9].* ) michael@428: dscl . -delete "/groups/${grp}" michael@428: ;; michael@13: Darwin/* ) michael@13: niutil -destroy . "/groups/${grp}" michael@13: ;; michael@13: AIX/* ) michael@13: rmgroup "${grp}" michael@13: ;; michael@13: * ) michael@13: cp /etc/group /etc/group.bak && \ michael@13: grep -v "^${grp}:" /etc/group.bak >/etc/group michael@13: rm -f /etc/group.bak >/dev/null 2>&1 michael@13: ;; michael@13: esac michael@13: fi michael@13: fi michael@13: done michael@13: michael@13: # invalidate passwd and group tables from Name Service Cache Daemon to michael@13: # ensure chown/chgrp works immediately after pwconv on Linux and Solaris michael@13: if [ -x /usr/sbin/nscd ]; then michael@13: /usr/sbin/nscd -i passwd >/dev/null 2>&1 || true michael@13: /usr/sbin/nscd -i group >/dev/null 2>&1 || true michael@13: fi michael@13: michael@13: # remove the startup/shutdown transfer scripts michael@13: name=`echo "$prefix" | sed -e 's;/;;g'` michael@13: if [ ".$cusr" != ".root" ]; then michael@13: echo "openpkg:WARNING: skipping deletion of system run-command hooks" 1>&2 michael@13: echo "openpkg:WARNING: (would require root-privileges)" 1>&2 michael@13: else michael@13: case "$plid" in michael@13: FreeBSD/* ) michael@428: rm -f /etc/rc.d/${name} >/dev/null 2>&1 michael@13: ;; michael@13: NetBSD/* ) michael@13: rm -f /etc/rc.d/${name} >/dev/null 2>&1 michael@13: ;; michael@13: Linux/* ) michael@13: if [ -f /etc/gentoo-release ]; then michael@428: /sbin/rc-update del ${name} >/dev/null 2>&1 michael@428: rm -f /etc/init.d/${name} >/dev/null 2>&1 michael@428: elif [ -f /etc/redhat-release ]; then michael@428: /sbin/chkconfig ${name} off >/dev/null 2>&1 michael@428: /sbin/chkconfig --del ${name} >/dev/null 2>&1 michael@428: rm -f /etc/rc.d/init.d/${name} >/dev/null 2>&1 michael@13: else michael@13: # sroot: script root directory michael@13: # lroot: link root directory michael@13: if [ -f /etc/debian_version ]; then michael@13: sroot=/etc/init.d michael@428: lroot=/etc/rc%%d.d michael@428: elif [ -f /etc/mandrake-release ]; then michael@13: sroot=/etc/rc.d/init.d michael@428: lroot=/etc/rc.d/rc%%d.d michael@13: elif [ -f /etc/SuSE-release ]; then michael@13: sroot=/etc/init.d michael@428: lroot=/etc/init.d/rc%%d.d michael@13: elif [ -f /etc/slackware-version ]; then michael@13: sroot=/etc/rc.d michael@428: lroot=/etc/rc.d/rc%%d.d michael@13: name="rc.${name}" michael@13: else michael@13: echo "WARNING: you are not running one of the supported standard" 1>&2 michael@13: echo "WARNING: Linux platforms (Debian, RedHat, Mandrake, SuSE, Gentoo)." 1>&2 michael@13: echo "WARNING: Guessing the location of the system init scripts!" 1>&2 michael@13: sroot="" michael@13: lroot="" michael@13: for sr in /etc/rc.d/init.d /etc/init.d /sbin/init.d; do michael@13: if [ -d $sr ]; then michael@13: sroot="$sr" michael@13: break michael@13: fi michael@13: done michael@13: for lr in /etc/rc.d/rc2.d /etc/rc2.d /sbin/init.d/rc2.d; do michael@13: if [ -d $lr ]; then michael@428: lroot="`echo $lr | sed -e 's;2;%%d;'`" michael@13: break michael@13: fi michael@13: done michael@13: if [ ".$sroot" = . -o ".$lroot" = . ]; then michael@13: echo "ERROR: Failed to guess the location of the system init scripts!" 1>&2 michael@13: exit 1 michael@13: fi michael@13: fi michael@13: rm -f ${sroot}/${name} >/dev/null 2>&1 michael@13: for i in 2 3 4 5; do michael@428: rm -f `echo $lroot | sed -e "s;%%d;$i;"`/S99${name} >/dev/null 2>&1 michael@13: done michael@13: for i in 0 1 6; do michael@428: rm -f `echo $lroot | sed -e "s;%%d;$i;"`/K00${name} >/dev/null 2>&1 michael@13: done michael@13: if [ -f /etc/slackware-version ]; then michael@13: for i in 0 1 2 3 4 5 6; do michael@428: l=`echo $lroot | sed -e "s;%%d;$i;"` michael@13: if [ -d $l ]; then michael@13: rmdir $l >/dev/null 2>&1 || true michael@13: fi michael@13: done michael@13: fi michael@13: fi michael@13: ;; michael@437: SunOS/5.1* ) michael@437: /usr/sbin/svcadm disable "svc:/openpkg/${name}:default"; sleep 2 michael@437: /usr/sbin/svccfg delete -f "svc:/openpkg/${name}:default" >/dev/null 2>&1 || true michael@437: rm -f /var/svc/manifest/openpkg/${name}.xml >/dev/null 2>&1 michael@437: rmdir /var/svc/manifest/openpkg >/dev/null 2>&1 || true michael@437: ;; michael@13: SunOS/5.* ) michael@13: rm -f /etc/init.d/${name} >/dev/null 2>&1 michael@13: rm -f /etc/rc3.d/S99${name} >/dev/null 2>&1 michael@13: rm -f /etc/rc0.d/K00${name} >/dev/null 2>&1 michael@13: rm -f /etc/rc1.d/K00${name} >/dev/null 2>&1 michael@13: ;; michael@13: UnixWare/* ) michael@13: rm -f /etc/init.d/${name} >/dev/null 2>&1 michael@13: rm -f /etc/rc2.d/S99${name} >/dev/null 2>&1 michael@13: rm -f /etc/rc0.d/K00${name} >/dev/null 2>&1 michael@13: rm -f /etc/rc1.d/K00${name} >/dev/null 2>&1 michael@13: ;; michael@13: AIX/* ) michael@13: rm -f /etc/rc.d/init.d/${name} >/dev/null 2>&1 michael@13: rm -f /etc/rc.d/rc2.d/S99${name} >/dev/null 2>&1 michael@13: ;; michael@13: OSF1/V5.* ) michael@13: rm -f /sbin/init.d/${name} >/dev/null 2>&1 michael@13: rm -f /sbin/rc3.d/S99${name} >/dev/null 2>&1 michael@13: rm -f /sbin/rc0.d/K00${name} >/dev/null 2>&1 michael@13: ;; michael@13: HP-UX/* ) michael@13: rm -f /sbin/init.d/${name} >/dev/null 2>&1 michael@13: rm -f /etc/rc2.d/S900${name} >/dev/null 2>&1 michael@13: rm -f /etc/rc1.d/K100${name} >/dev/null 2>&1 michael@13: ;; michael@13: Darwin/* ) michael@428: darwin_rc_var="`echo ${name} | sed -e 's;-;_;g' | tr '[a-z]' '[A-Z]'`" michael@13: cp /etc/hostconfig /etc/hostconfig.bak && \ michael@428: grep -v "^${darwin_rc_var}=" /etc/hostconfig.bak >/etc/hostconfig michael@13: rm -f /etc/hostconfig.bak >/dev/null 2>&1 michael@428: rm -rf /Library/StartupItems/${name} >/dev/null 2>&1 michael@13: ;; michael@13: IRIX*/6.* ) michael@13: rm -f /etc/init.d/${name} >/dev/null 2>&1 michael@13: rm -f /etc/rc2.d/S99${name} >/dev/null 2>&1 michael@13: rm -f /etc/rc0.d/K00${name} >/dev/null 2>&1 michael@13: ;; michael@428: CYGWIN*/* ) michael@428: rm -f /etc/rc.d/init.d/${name} >/dev/null 2>&1 michael@428: rm -f /etc/rc.d/rc2.d/S90${name} >/dev/null 2>&1 michael@428: rm -f /etc/rc.d/rc1.d/K10${name} >/dev/null 2>&1 michael@428: ;; michael@13: esac michael@13: fi michael@13: michael@13: # remove the cron transfer entries michael@13: if [ ".$cusr" != ".root" ]; then michael@13: echo "openpkg:WARNING: skipping deletion of system cron hooks" 1>&2 michael@13: echo "openpkg:WARNING: (would require root-privileges)" 1>&2 michael@13: else michael@13: case "$plid" in michael@428: FreeBSD/* | Linux/* ) michael@13: if [ -f /etc/slackware-version ]; then michael@13: EDITOR=/tmp/vipw.$$ michael@13: VISUAL="$EDITOR" michael@13: export EDITOR michael@13: export VISUAL michael@13: p=`echo $prefix | sed -e 's;/;\\\\\\\\/;g'` michael@13: ( echo "cp \$1 \$1.bak" michael@13: echo "cat \$1.bak | sed -e \"//,/<\\\\/OpenPKG>/d\" >\$1" michael@13: echo "rm -f \$1.bak" michael@13: ) >$EDITOR michael@13: chmod a+x $EDITOR michael@13: ( PATH="$PATH:/usr/bin"; crontab -e ) || exit $? michael@13: rm -f $EDITOR michael@13: else michael@13: exists=`grep "" /etc/crontab` michael@13: if [ ".$exists" != . ]; then michael@13: p=`echo $prefix | sed -e 's;/;\\\\/;g'` michael@13: cp /etc/crontab /etc/crontab.bak michael@13: cat /etc/crontab.bak |\ michael@13: sed -e "//,/<\\/OpenPKG>/d" \ michael@13: >/etc/crontab michael@13: rm -f /etc/crontab.bak >/dev/null 2>&1 michael@13: fi michael@13: fi michael@13: ;; michael@428: SunOS/5.* | OSF1/V5.* | NetBSD/* | HP-UX/* | UnixWare/* | AIX/* | CYGWIN*/* | Darwin/* ) michael@13: EDITOR=/tmp/vipw.$$ michael@13: VISUAL="$EDITOR" michael@13: export EDITOR michael@13: export VISUAL michael@13: p=`echo $prefix | sed -e 's;/;\\\\\\\\/;g'` michael@13: ( echo "cp \$1 \$1.bak" michael@13: echo "cat \$1.bak | sed -e \"//,/<\\\\/OpenPKG>/d\" >\$1" michael@13: echo "rm -f \$1.bak" michael@13: ) >$EDITOR michael@13: chmod a+x $EDITOR michael@13: ( PATH="$PATH:/usr/bin"; crontab -e ) || exit $? michael@13: rm -f $EDITOR michael@13: ;; michael@13: IRIX*/6.* ) michael@13: p=`echo $prefix | sed -e 's;/;\\\\\\/;g'` michael@13: ( crontab -l | michael@13: sed -e "//,/<\/OpenPKG>/d" michael@13: ) | /usr/bin/crontab || exit $? michael@13: ;; michael@13: esac michael@13: fi michael@13: michael@13: # delayed removal of top-level directory. michael@13: ( sleep 2 michael@428: rm -rf %{l_prefix}/RPM/PKG/* >/dev/null 2>&1 || true michael@428: rm -rf %{l_prefix}/RPM/SRC/* >/dev/null 2>&1 || true michael@428: rm -rf %{l_prefix}/RPM/CACHE/* >/dev/null 2>&1 || true michael@428: rm -rf %{l_prefix}/RPM/TMP/* %{l_prefix}/RPM/TMP/.[a-z]* >/dev/null 2>&1 || true michael@13: rm -rf %{l_prefix}/RPM/DB/* %{l_prefix}/RPM/DB/.[a-z]* >/dev/null 2>&1 || true michael@13: rmdir %{l_prefix}/RPM/DB >/dev/null 2>&1 || true michael@13: rmdir %{l_prefix}/RPM >/dev/null 2>&1 || true michael@13: rmdir %{l_prefix} >/dev/null 2>&1 || true michael@13: ) /dev/null 2>/dev/null & michael@13: