diff options
author | Jay Freeman <saurik@saurik.com> | 2009-08-09 02:50:34 +0000 |
---|---|---|
committer | Jay Freeman <saurik@saurik.com> | 2009-08-09 02:50:34 +0000 |
commit | 1fc212398c58ef27963f84fa69df552acacf7767 (patch) | |
tree | 34b4e1e2507af390799e3c606d094760a383fa4a | |
parent | 35d894811b58293feab572d52024530411fd9728 (diff) |
jlanger failed to build my zsh.
git-svn-id: http://svn.telesphoreo.org/trunk@647 514c082c-b64e-11dc-b46d-3d985efe055d
-rwxr-xr-x | bootstrap.sh | 30 | ||||
-rwxr-xr-x | construct.sh | 84 | ||||
-rwxr-xr-x | control.sh | 86 | ||||
-rwxr-xr-x | exec.sh | 5 | ||||
-rwxr-xr-x | folders.sh | 5 | ||||
-rwxr-xr-x | helper.sh | 17 | ||||
-rwxr-xr-x | make.sh | 36 | ||||
-rwxr-xr-x | package.sh | 21 | ||||
-rwxr-xr-x | remake.sh | 3 |
9 files changed, 223 insertions, 64 deletions
diff --git a/bootstrap.sh b/bootstrap.sh index e9062cb0d..62feff2ef 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -12,12 +12,13 @@ svn export "${PKG_BASE}/over" "${PKG_BOOT}" mkdir -p "${PKG_BOOT}/var/lib/dpkg/info" -PKG_REQS=(adv-cmds apt base bash coreutils cydia cydia-sources grep inetutils less libgcc nano network-cmds sed shell-cmds system-cmds tar unzip) +PKG_REQS=(apt7 base cydia cydia-sources essential openssh pam-modules profile.d) +PKG_REQS=(base cydia cydia-sources essential pam-modules profile.d) cd "${PKG_BASE}/data" PKG_REQS=($({ echo "${PKG_REQS[@]}" | tr ' ' $'\n' - find -L "${PKG_REQS[@]}" -name '*.dep' | sed -e 's/.*\/\([^\/]*\)\.dep/\1/' + find -L "${PKG_REQS[@]}" -name '*.dep' | grep -v '/_[^/]*\.dep' | sed -e 's/.*\/\([^\/]*\)\.dep/\1/' } | sort -u)) for PKG_NAME in "${PKG_REQS[@]}"; do @@ -54,9 +55,6 @@ cd "${PKG_BOOT}" PKG_RSLT="${PKG_BASE}/rslt" mkdir -p "${PKG_RSLT}" -rm -f "${PKG_RSLT}/Manual_${PKG_ARCH}.tgz" -tar -zcf "${PKG_RSLT}/Manual_${PKG_ARCH}.tgz" * - rm -rf "${PKG_RSLT}/CydiaInstaller.bundle" mkdir "${PKG_RSLT}/CydiaInstaller.bundle" @@ -138,6 +136,26 @@ EOF cp -a "${PKG_BASE}"/pwnr/* "${PKG_RSLT}"/CydiaInstaller.bundle tar -zcf "${PKG_RSLT}/Pwnage_${PKG_ARCH}.tgz" -C "${PKG_RSLT}" CydiaInstaller.bundle +function stash() { + src=$1 + dst=var/stash/${src##*/} + mv "${src}" "${dst}" + dst=${src//+([A-Za-z])/..}/${dst} + ln -s "${dst#../}" "${src}" +} + +mkdir -p var/stash +mkdir -p usr/include + +mv -v usr/lib/_ncurses/* usr/lib +rmdir usr/lib/_ncurses +ln -s /usr/lib usr/lib/_ncurses + +#stash usr/share/gettext + +rm -f "${PKG_RSLT}/Manual_${PKG_ARCH}.tgz" +tar -zcf "${PKG_RSLT}/Manual_${PKG_ARCH}.tgz" * + rm -f "${PKG_RSLT}/Manual_${PKG_ARCH}.zip" zip -qry "${PKG_RSLT}/Manual_${PKG_ARCH}.zip" * @@ -175,4 +193,4 @@ if [[ ${PKG_ARCH} == darwin-arm ]]; then zip -qry "${PKG_RSLT}/AppTapp_${PKG_ARCH}.zip" * fi -rm -rf "${PKG_BOOT}" +#rm -rf "${PKG_BOOT}" diff --git a/construct.sh b/construct.sh index 381cf81ec..3c7327bb1 100755 --- a/construct.sh +++ b/construct.sh @@ -4,53 +4,113 @@ shopt -s extglob nullglob PKG_BASE=$(dirname "$(realpath "$0")") cd "${PKG_BASE}" -PKG_RVSN=280 +PKG_RVSN=282 -PKG_REPO=/dat/web/apt.saurik.com -PKG_OVER=${PKG_REPO}/indices/override.tangelo.main.gz +PKG_REPO=/dat/web/beta.apt.saurik.com for PKG_ARCH in "${PKG_BASE}/arch"/*; do PKG_ARCH=$(basename "${PKG_ARCH}") echo "scanning ${PKG_ARCH}" - PKG_PKGS=${PKG_REPO}/dists/tangelo/main/binary-${PKG_ARCH}/Packages + PKG_DCBF=${PKG_REPO}/dists/tangelo/main/binary-${PKG_ARCH} + mkdir -p "${PKG_DCBF}" + PKG_PKGS=${PKG_DCBF}/Packages rm -rf "${PKG_BASE}/link" mkdir "${PKG_BASE}/link" + for package in "${PKG_BASE}/data"/!(*_); do PKG_NAME=$(basename "${package}") + + # XXX: add to above filter + if [[ ${PKG_NAME} == _* ]]; then + continue + fi + PKG_DATA="${PKG_BASE}/data/${PKG_NAME}" + PKG_STAT="${PKG_BASE}/stat/${PKG_ARCH}/${PKG_NAME}" PKG_PRIO=$(cat "${PKG_DATA}/_metadata/priority") + + if [[ -e ${PKG_STAT}/fail ]]; then + continue + fi + echo "${PKG_NAME}" "${PKG_PRIO#+}" "$(cat "${PKG_DATA}/_metadata/section")" PKG_FILE=${PKG_BASE}/stat/${PKG_ARCH}/${PKG_NAME}/dest-ver if [[ -e ${PKG_FILE} ]]; then - PKG_FILE=${PKG_BASE}/debs/${PKG_NAME}_$(cat "${PKG_DATA}/_metadata/version")-$(cat "${PKG_FILE}")_${PKG_ARCH}.deb - if [[ -e ${PKG_FILE} ]]; then + PKG_REAL=${PKG_BASE}/stat/${PKG_ARCH}/${PKG_NAME}/real-ver + if [[ -e ${PKG_REAL} ]]; then + PKG_RVER=$(cat "${PKG_REAL}") + else + PKG_RVER=$(cat "${PKG_STAT}/data-ver")-$(cat "${PKG_FILE}") + fi + + PKG_FILE=${PKG_BASE}/debs/${PKG_NAME}_${PKG_RVER}_${PKG_ARCH}.deb + if [[ -e ${PKG_FILE} && ! -e "${PKG_STAT}/exclude" ]]; then ln -s "${PKG_FILE}" "${PKG_BASE}/link" echo "${PKG_FILE}" fi fi done >"${PKG_BASE}/overrides.txt" - dpkg-scanpackages link "${PKG_BASE}/overrides.txt" | sed -e 's/: link\//: debs\//' >"${PKG_PKGS}" + for deb in "${PKG_BASE}/xtra/${PKG_ARCH}"/*.deb; do + ln -s "$(readlink -f "${deb}")" "${PKG_BASE}/link" + done + + dpkg-scanpackages -m link "${PKG_BASE}/overrides.txt" | sed -e 's/: link\//: debs\//' | while IFS= read -r line; do + if [[ ${line} == '' ]]; then + PKG_TAGS=$(cat "${PKG_BASE}/tags/${PKG_NAME}" 2>/dev/null || true) + if [[ -z ${PKG_TAGS} ]]; then + PKG_TAGS=$(cat "${PKG_BASE}/data/${PKG_NAME}/_metadata/tags" 2>/dev/null || true) + fi + PKG_ROLE="${PKG_BASE}/data/${PKG_NAME}/_metadata/role" + if [[ -n ${PKG_TAGS} || -e ${PKG_ROLE} ]]; then + echo -n "Tag: " + if [[ -n ${PKG_TAGS} ]]; then + echo -n "${PKG_TAGS}" + fi + if [[ -n ${PKG_TAGS} && -e ${PKG_ROLE} ]]; then + echo -n ", " + fi + if [[ -e ${PKG_ROLE} ]]; then + echo -n "role::$(cat "${PKG_ROLE}")" + fi + echo + fi + elif [[ ${line} == Package:* ]]; then + PKG_NAME=${line#Package: } + fi + + echo "${line}" + done >"${PKG_PKGS}" + + if [[ ${PKG_ARCH} == "iphoneos-arm" ]]; then + dpkg-scanpackages paid >>"${PKG_PKGS}" + fi + rm -f "${PKG_BASE}/overrides.txt" +done - gzip -c "${PKG_PKGS}" >"${PKG_PKGS}.gz" +for PKG_ARCH in "${PKG_BASE}/arch"/*; do + PKG_ARCH=$(basename "${PKG_ARCH}") + PKG_PKGS=${PKG_REPO}/dists/tangelo/main/binary-${PKG_ARCH}/Packages + bzip2 -c "${PKG_PKGS}" >"${PKG_PKGS}.bz2" done cd "${PKG_REPO}/dists/tangelo" { cat <<EOF -Origin: Jay Freeman (saurik) -Label: Telesphoreo +Origin: Telesphoreo Tangelo +Label: Cydia/Telesphoreo Suite: stable Version: 1.0r${PKG_RVSN} -Codename: tangelo +Codename: tangelo-3.7 Architectures:$(for PKG_ARCH in "${PKG_BASE}/arch"/*; do echo -n " $(basename "${PKG_ARCH}")"; done) Components: main -Description: Telesphoreo Tangelo 1.0r${PKG_RVSN} +Description: Distribution of Unix Software for iPhoneOS 3 +Support: http://cydia.saurik.com/support/* MD5Sum: EOF diff --git a/control.sh b/control.sh index 8a1f2c7ff..e82c45308 100755 --- a/control.sh +++ b/control.sh @@ -15,7 +15,7 @@ cat <<EOF Package: ${PKG_NAME} EOF -if [[ ${PKG_PRIO} == required || ${PKG_PRIO} == +* ]]; then +if [[ ${PKG_PRIO} == +* ]]; then cat <<EOF Essential: yes EOF @@ -61,36 +61,76 @@ Size: $(find "${PKG_DEST}" -type f -exec cat {} \; | gzip -c | wc -c | cut -d $' EOF fi -unset comma -for dep in "${PKG_DEPS[@]}"; do - if [[ ${comma+@} == @ ]]; then - echo -n "," - else - echo -n "Depends:" - comma= +if [[ -e ${PKG_DATA}/_metadata/predepends_ ]]; then + echo "Pre-Depends: $(cat "${PKG_DATA}/_metadata/predepends_")" +else + unset comma + + if [[ ${PKG_ZLIB} == lzma ]]; then + if [[ ${comma+@} == @ ]]; then + echo -n "," + else + echo -n "Pre-Depends:" + comma= + fi + + echo -n " dpkg (>= 1.14.25-8)" fi - echo -n " $(basename "${dep}" .dep)" - - ver=${PKG_DATA}/_metadata/${dep%.dep}.ver.${PKG_ARCH} - if [[ -e "${ver}" ]]; then - echo -n " (>= $(cat "${ver}"))" + if [[ -e ${PKG_DATA}/_metadata/predepends ]]; then + if [[ ${comma+@} == @ ]]; then + echo -n "," + else + echo -n "Pre-Depends:" + comma= + fi + + echo -n " $(cat "${PKG_DATA}/_metadata/predepends")" fi -done -if [[ -e ${PKG_DATA}/_metadata/depends ]]; then if [[ ${comma+@} == @ ]]; then - echo -n "," - else - echo -n "Depends:" - comma= + echo fi - - echo -n " $(cat "${PKG_DATA}/_metadata/depends")" fi -if [[ ${comma+@} == @ ]]; then - echo +if [[ ! -e ${PKG_DATA}/_metadata/depends_ ]]; then + unset comma + for dep in "${PKG_DEPS[@]}"; do + if [[ ${dep} == _* ]]; then + continue + fi + + if [[ ${comma+@} == @ ]]; then + echo -n "," + else + echo -n "Depends:" + comma= + fi + + echo -n " $(basename "${dep}" .dep)" + + ver=${PKG_DATA}/_metadata/${dep%.dep}.ver.${PKG_ARCH} + if [[ -e "${ver}" ]]; then + echo -n " (>= $(cat "${ver}"))" + fi + done + + if [[ -e ${PKG_DATA}/_metadata/depends ]]; then + if [[ ${comma+@} == @ ]]; then + echo -n "," + else + echo -n "Depends:" + comma= + fi + + echo -n " $(cat "${PKG_DATA}/_metadata/depends")" + fi + + if [[ ${comma+@} == @ ]]; then + echo + fi +elif [[ -s ${PKG_DATA}/_metadata/depends_ ]]; then + echo "Depends: $(cat "${PKG_DATA}/_metadata/depends_")" fi if [[ -e ${PKG_DATA}/_metadata/replaces ]]; then @@ -28,6 +28,7 @@ for dep in ${deps[@]}; do # XXX: bother dealing with weird arguments? #DEP_NAME=$(basename "${dep}" .dep) DEP_NAME=${dep} + DEP_MORE=$(PKG_MORE_ "${DEP_NAME}") DEP_DEST=$(PKG_DEST_ "${DEP_NAME}") PKG_PATH=${PKG_PATH}:${DEP_DEST} @@ -39,6 +40,10 @@ for dep in ${deps[@]}; do PKG_LIBS=${DEP_DEST}${PKG_TAPF}/lib:${PKG_LIBS} fi + if [[ -d ${DEP_MORE}${PKG_TAPF}/lib ]]; then + PKG_LIBS=${DEP_MORE}${PKG_TAPF}/lib:${PKG_LIBS} + fi + if [[ -d ${DEP_DEST}${PKG_TAPF}/lib/pkgconfig ]]; then PKG_PKGS=${DEP_DEST}${PKG_TAPF}/lib/pkgconfig:${PKG_PKGS} fi diff --git a/folders.sh b/folders.sh index 0021e7f71..b9991a416 100755 --- a/folders.sh +++ b/folders.sh @@ -12,6 +12,10 @@ function PKG_WORK_() { export -f PKG_WORK_ +function PKG_MORE_() { + echo "${PKG_BASE}/more/${PKG_ARCH}/$1" +} + function PKG_DEST_() { echo "${PKG_BASE}/dest/${PKG_ARCH}/$1" } @@ -21,6 +25,7 @@ export -f PKG_DEST_ function pkg_ { case "${1:0:1}" in (/) echo "${PKG_DEST}$1";; + (@) echo "${PKG_MORE}${1:1}";; (%) echo "${PKG_DATA}${1:1}";; (*) echo -"$1" | sed -e 's/^.//';; esac @@ -8,16 +8,29 @@ export PKG_CCPF=$("${PKG_TARG}-gcc" -v 2>&1 | grep -- --prefix | sed -e 's/.*--p source "${PKG_BASE}/folders.sh" if [[ ${PKG_NAME} != @(-|:*) ]]; then + export PKG_MORE=$(PKG_MORE_ "${PKG_NAME}") export PKG_DATA=$(PKG_DATA_ "${PKG_NAME}") export PKG_WORK=$(PKG_WORK_ "${PKG_NAME}") export PKG_DEST=$(PKG_DEST_ "${PKG_NAME}") export PKG_STAT=${PKG_BASE}/stat/${PKG_ARCH}/${PKG_NAME} export PKG_DATA=$(echo "${PKG_BASE}"/data/"${PKG_NAME}"?(_)) - export PKG_VRSN=$(cat "${PKG_DATA}/_metadata/version") - export PKG_PRIO=$(cat "${PKG_DATA}/_metadata/priority") export PKG_RVSN=$(cat "${PKG_STAT}/dest-ver" 2>/dev/null) + if [[ -e "${PKG_DATA}/_metadata/zlib" ]]; then + export PKG_ZLIB=$(cat "${PKG_DATA}/_metadata/zlib") + else + export PKG_ZLIB=lzma + fi + + if [[ -e "${PKG_DATA}/_metadata/version" ]]; then + export PKG_VRSN=$(cat "${PKG_DATA}/_metadata/version") + fi + + if [[ -e "${PKG_DATA}/_metadata/priority" ]]; then + export PKG_PRIO=$(cat "${PKG_DATA}/_metadata/priority") + fi + if [[ ! -e ${PKG_DATA} ]]; then echo "unknown package: ${PKG_NAME}" 1>&2 exit 1 @@ -23,15 +23,19 @@ fi export CODESIGN_ALLOCATE=$(which arm-apple-darwin9-codesign_allocate) -for DEP_NAME in "${PKG_DEPS[@]}"; do - "${PKG_MAKE}" "${DEP_NAME}" -done +#for DEP_NAME in "${PKG_DEPS[@]}"; do +# "${PKG_MAKE}" "${DEP_NAME}" +#done export PKG_HASH=$({ "${PKG_BASE}"/util/catdir.sh "${PKG_DATA}" -L \( -name '.svn' -o -name '_*' \) -prune -o for DEP_NAME in "${PKG_DEPS[@]}"; do "${PKG_BASE}"/util/catdir.sh "$(PKG_DEST_ "${DEP_NAME}")" + DEP_MORE="$(PKG_MORE_ "${DEP_NAME}")" + if [[ -d ${DEP_MORE} ]]; then + "${PKG_BASE}"/util/catdir.sh "${DEP_MORE}" + fi done } | md5sum | cut -d ' ' -f 1) @@ -45,6 +49,9 @@ fi mkdir -p "${PKG_STAT}" rm -f "${PKG_STAT}/data-md5" +rm -rf "${PKG_MORE}" +mkdir -p "${PKG_MORE}" + rm -rf "${PKG_DEST}" mkdir -p "${PKG_DEST}" @@ -56,7 +63,7 @@ function pkg:patch() { pkg:libtool_ ltmain.sh for diff in "${PKG_DATA}"/*.diff; do - if [[ ${diff} == */_*.diff ]]; then + if [[ ${diff} =~ .*/_[^/]*.diff$ ]]; then continue; fi @@ -115,18 +122,27 @@ export -f pkg:setup function pkg:configure() { PKG_CONFIG="$(realpath "${PKG_BASE}/util/pkg-config.sh")" \ ac_cv_prog_cc_g=no ac_cv_prog_cxx_g=no \ - "${PKG_CONF}" \ + cfg=("${PKG_CONF}" \ + ac_cv_prog_cc_g=no ac_cv_prog_cxx_g=no \ --build=x86_64-unknown-linux-gnu \ --host="${PKG_TARG}" \ --enable-static=no \ --enable-shared=yes \ --prefix=$(cat "${PKG_BASE}/arch/${PKG_ARCH}/prefix") \ --localstatedir="/var/cache/${PKG_NAME}" \ - "$@" + "$@") + echo "${cfg[@]}" + "${cfg[@]}" } export -f pkg:configure +function pkg:make() { + make AR="${PKG_TARG}-ar" CFLAGS='-O2 -mthumb' +} + +export -f pkg:make + function pkg:install() { make install DESTDIR="${PKG_DEST}" "$@" } @@ -134,7 +150,7 @@ function pkg:install() { export -f pkg:install function pkg:extract() { - for tgz in "${PKG_DATA}"/{*.tar.gz,*.tgz}; do + for tgz in "${PKG_DATA}"/*.{tar.gz,tgz}; do tar -zxf "${tgz}" done @@ -165,11 +181,11 @@ function rmdir_() { fi } -rm -rf "${PKG_DEST}/usr/share/locale" rm -rf "${PKG_DEST}/usr/share/man" rm -rf "${PKG_DEST}/usr/share/info" rm -rf "${PKG_DEST}/usr/share/gtk-doc" rm -rf "${PKG_DEST}/usr/share/doc" +rm -rf "${PKG_DEST}/usr/share/locale" rm -rf "${PKG_DEST}/usr/man" rm -rf "${PKG_DEST}/usr/local/share/man" rm -rf "${PKG_DEST}/usr/local/OpenSourceVersions" @@ -202,5 +218,7 @@ find "${PKG_DEST}" -type f -name '*.a' -print0 | while read -r -d $'\0' bin; do "${PKG_BASE}/util/arid" "${bin}" done -cp -a "${PKG_DATA}/_metadata/version" "${PKG_STAT}/data-ver" +cp -aL "${PKG_DATA}/_metadata/version" "${PKG_STAT}/data-ver" echo "${PKG_HASH}" >"${PKG_STAT}/data-md5" + +echo "hashed code ${PKG_NAME} to: $("${PKG_BASE}"/util/catdir.sh "${PKG_DEST}" | md5sum | cut -d ' ' -f 1)" diff --git a/package.sh b/package.sh index 387072e40..cea69c4f2 100755 --- a/package.sh +++ b/package.sh @@ -18,17 +18,14 @@ source "${PKG_BASE}/helper.sh" pkg: mkdir -p /DEBIAN ./control.sh "${PKG_NAME}" control >"$(pkg_ /DEBIAN/control)" -if [[ -e "${PKG_DATA}"/_metadata/preinst ]]; then - cp -a "${PKG_DATA}"/_metadata/preinst "$(pkg_ /DEBIAN)" -fi - -if [[ -e "${PKG_DATA}"/_metadata/postinst ]]; then - cp -a "${PKG_DATA}"/_metadata/postinst "$(pkg_ /DEBIAN)" -fi - -if [[ -e "${PKG_DATA}"/_metadata/prerm ]]; then - cp -a "${PKG_DATA}"/_metadata/prerm "$(pkg_ /DEBIAN)" -fi +for script in preinst extrainst_ postinst prerm postrm; do + if [[ -e "${PKG_DATA}/_metadata/${script}.c" ]]; then + ./exec.sh - "${PKG_TARG}-gcc" -o "$(pkg_ /DEBIAN)/${script}" "${PKG_DATA}/_metadata/${script}.c" + ./exec.sh - ldid -S "$(pkg_ /DEBIAN)/${script}" + elif [[ -e "${PKG_DATA}/_metadata/${script}" ]]; then + cp -a "${PKG_DATA}/_metadata/${script}" "$(pkg_ /DEBIAN)" + fi +done if [[ -e "${PKG_DATA}"/_metadata/conffiles ]]; then cp -a "${PKG_DATA}"/_metadata/conffiles "$(pkg_ /DEBIAN)" @@ -51,7 +48,7 @@ else echo "package ${PKG_PACK} already exists..." else ./control.sh "${PKG_NAME}" control "${PKG_VRSN}-${PKG_RVSN}" >"$(pkg_ /DEBIAN/control)" - dpkg-deb -b "${PKG_DEST}" "${PKG_PACK}" + dpkg-deb -Z"${PKG_ZLIB}" -b "${PKG_DEST}" "${PKG_PACK}" echo "${PKG_HASH}" >"${PKG_STAT}/dest-md5" echo "${PKG_RVSN}" >"${PKG_STAT}/dest-ver" "${PKG_BASE}"/upload.sh debs "${PKG_PACK}" diff --git a/remake.sh b/remake.sh new file mode 100755 index 000000000..36a285e38 --- /dev/null +++ b/remake.sh @@ -0,0 +1,3 @@ +#!/bin/bash +rm -f stat/${PKG_ARCH}/$1/data-md5 +./make.sh "$1" |