diff options
Diffstat (limited to 'Build/lib/post')
-rwxr-xr-x | Build/lib/post/10-rmla.sh | 48 | ||||
-rwxr-xr-x | Build/lib/post/20-strip.sh | 55 | ||||
-rwxr-xr-x | Build/lib/post/30-info.sh | 39 | ||||
-rwxr-xr-x | Build/lib/post/40-man.sh | 35 | ||||
-rwxr-xr-x | Build/lib/post/50-depends.sh | 31 | ||||
-rwxr-xr-x | Build/lib/post/60-package.sh | 48 |
6 files changed, 256 insertions, 0 deletions
diff --git a/Build/lib/post/10-rmla.sh b/Build/lib/post/10-rmla.sh new file mode 100755 index 0000000..6db809f --- /dev/null +++ b/Build/lib/post/10-rmla.sh @@ -0,0 +1,48 @@ +# Copyright (c) 2012, Deposite Pirate +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the copyright holder nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +if [[ ! "${OPTIONS}" == *normla* ]]; then + + info "Removing any libtool library (.la) files" + + # Allow the for loop to work on files with spaces + saveifs="${IFS}" + IFS="$(echo -en "\n\b")" + + for file in $(find ${PKG} -name "*.la"); do + + filetype="$(file ${file})" + + case "${filetype}" in + *"libtool library file"*) + rm -f "${file}" + ;; + esac + + done + + IFS="${saveifs}" + +fi diff --git a/Build/lib/post/20-strip.sh b/Build/lib/post/20-strip.sh new file mode 100755 index 0000000..323288c --- /dev/null +++ b/Build/lib/post/20-strip.sh @@ -0,0 +1,55 @@ +# Copyright (c) 2012, Deposite Pirate +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the copyright holder nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +if [[ ! "${OPTIONS}" == *nostrip* ]]; then + + if [[ ! "${DEBUG}" == yes ]]; then + + info "Stripping debugging symbols from binaries" + + # Allow the for loop to work on files with spaces + saveifs="${IFS}" + IFS=$(echo -en "\n\b") + + for file in $(find ${PKG}); do + + filetype="$(file -bi ${file})" + + case "${filetype}" in + *"application/x-executable; charset=binary"*) + strip "${file}" + ;; + *"application/x-sharedlib; charset=binary"*) + strip --strip-unneeded "${file}" + ;; + esac + + done + + IFS="${saveifs}" + + fi + +fi diff --git a/Build/lib/post/30-info.sh b/Build/lib/post/30-info.sh new file mode 100755 index 0000000..170b971 --- /dev/null +++ b/Build/lib/post/30-info.sh @@ -0,0 +1,39 @@ +# Copyright (c) 2012, Deposite Pirate +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the copyright holder nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +if [[ ! "${OPTIONS}" == *noinfoz* ]]; then + + info "Compressing info files" + + rm -f \ + "${PKG}/usr/info/dir" \ + "${PKG}/usr/share/info/dir" + + for file in $(find ${PKG} -path '*usr*info/*.info*'); do + chmod 0644 "${file}" + z.info "${file}" + done + +fi diff --git a/Build/lib/post/40-man.sh b/Build/lib/post/40-man.sh new file mode 100755 index 0000000..21f3dd2 --- /dev/null +++ b/Build/lib/post/40-man.sh @@ -0,0 +1,35 @@ +# Copyright (c) 2012, Deposite Pirate +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the copyright holder nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +if [[ ! "${OPTIONS}" == *nomanz* ]]; then + + info "Compressing manual pages" + + for file in $(find ${PKG} -path '*usr*/man*/man*/*.*'); do + chmod 0644 "${file}" + z.man "${file}" + done + +fi diff --git a/Build/lib/post/50-depends.sh b/Build/lib/post/50-depends.sh new file mode 100755 index 0000000..1f4e584 --- /dev/null +++ b/Build/lib/post/50-depends.sh @@ -0,0 +1,31 @@ +# Copyright (c) 2012, Deposite Pirate +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the copyright holder nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +if [[ "${DEPENDS}" ]]; then + info "Adding runtime dependencies" + for ((n = 0; n < ${#DEPENDS[@]}; n++)); do + echo "${DEPENDS[${n}]}" >> "${PKG}/install/slack-required" + done +fi diff --git a/Build/lib/post/60-package.sh b/Build/lib/post/60-package.sh new file mode 100755 index 0000000..3c0ed89 --- /dev/null +++ b/Build/lib/post/60-package.sh @@ -0,0 +1,48 @@ +# Copyright (c) 2012, Deposite Pirate +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the copyright holder nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PKGBASENAME=${NAME}-${VERSION}-${ARCH}-${BUILD} + +info "Packing ${PKGBASENAME}" + +if [ ! -d "${PKGREPO}" -o ! -w "${PKGREPO}" ]; then + PKGREPO="${HOME}" +fi + +pushd "${PKG}" >/dev/null + +PACKAGE="${PKGREPO}/${PKGBASENAME}" + +debug "Creating ${PACKAGE}.txz" + +if [[ ! "${OPTIONS}" == *symprepend* ]]; then + pkg.pack "${PACKAGE}.txz" +else + pkg.pack -p "${PACKAGE}.txz" +fi + +cat install/slack-desc | grep "${NAME}:" > "${PACKAGE}.txt" + +popd >/dev/null |