Skip to content

Commit

Permalink
Merge branch 'master' into drobofs
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopadilha committed Jun 26, 2015
2 parents 011e635 + ef80297 commit f0c7172
Show file tree
Hide file tree
Showing 12 changed files with 2,151 additions and 152 deletions.
30 changes: 14 additions & 16 deletions app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,47 @@ local URL="http://zlib.net/${FILE}"

_download_tgz "${FILE}" "${URL}" "${FOLDER}"
pushd "target/${FOLDER}"
./configure --prefix="${DEPS}" --libdir="${DEST}/lib"
./configure --prefix="${DEPS}" --libdir="${DEST}/lib" --shared
make
make install
rm -v "${DEST}/lib"/*.a
popd
}

### OPENSSL ###
_build_openssl() {
local VERSION="1.0.2"
local VERSION="1.0.2c"
local FOLDER="openssl-${VERSION}"
local FILE="${FOLDER}.tar.gz"
local URL="http://www.openssl.org/source/${FILE}"

_download_tgz "${FILE}" "${URL}" "${FOLDER}"
cp -vf src/openssl-1.0.2-parallel-build.patch "target/${FOLDER}/"
cp -vf "src/${FOLDER}-parallel-build.patch" "target/${FOLDER}/"
pushd "target/${FOLDER}"
patch -p1 < openssl-1.0.2-parallel-build.patch
./Configure --prefix="${DEPS}" \
--openssldir="${DEST}/etc/ssl" \
--with-zlib-include="${DEPS}/include" \
--with-zlib-lib="${DEPS}/lib" \
shared zlib-dynamic threads linux-armv4 no-asm -DL_ENDIAN ${CFLAGS} ${LDFLAGS}
patch -p1 -i "${FOLDER}-parallel-build.patch"
./Configure --prefix="${DEPS}" --openssldir="${DEST}/etc/ssl" \
zlib-dynamic --with-zlib-include="${DEPS}/include" --with-zlib-lib="${DEPS}/lib" \
shared threads linux-armv4 no-asm -DL_ENDIAN ${CFLAGS} ${LDFLAGS} -Wa,--noexecstack -Wl,-z,noexecstack
sed -i -e "s/-O3//g" Makefile
make
make install_sw
cp -v -aR "${DEPS}/lib"/* "${DEST}/lib/"
rm -v -fr "${DEPS}/lib"
rm -v "${DEST}/lib"/*.a
cp -vfaR "${DEPS}/lib"/* "${DEST}/lib/"
rm -vfr "${DEPS}/lib"
rm -vf "${DEST}/lib/libcrypto.a" "${DEST}/lib/libssl.a"
sed -i -e "s|^exec_prefix=.*|exec_prefix=${DEST}|g" "${DEST}/lib/pkgconfig/openssl.pc"
popd
}

### SQLITE ###
_build_sqlite() {
local VERSION="3080803"
local VERSION="3081002"
local FOLDER="sqlite-autoconf-${VERSION}"
local FILE="${FOLDER}.tar.gz"
local URL="http://sqlite.org/$(date +%Y)/${FILE}"

_download_tgz "${FILE}" "${URL}" "${FOLDER}"
pushd "target/${FOLDER}"
./configure --host="${HOST}" --prefix="${DEPS}" --libdir="${DEST}/lib" --disable-static
make
make -j1
make install
popd
}
Expand Down Expand Up @@ -87,7 +84,7 @@ popd

### ARIA2 ###
_build_aria2() {
# The Drobo5N toolchain cannout compile Aria2 >= 1.18.0
# The DroboFS toolchain cannot compile Aria2 >= 1.18.0
local VERSION="1.17.1"
local FOLDER="aria2-${VERSION}"
local FILE="${FOLDER}.tar.xz"
Expand Down Expand Up @@ -131,6 +128,7 @@ local FOLDER="www"
local URL="https://github.com/ziahamza/webui-aria2.git"

_download_git "${BRANCH}" "${FOLDER}" "${URL}"
patch "target/${FOLDER}/js/services/rpc/rpc.js" "src/webui-aria2-rpc-token-warning.patch"
cp -vfaR "target/${FOLDER}" "${DEST}/"
}

Expand Down
2 changes: 1 addition & 1 deletion crosscompile.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export DROBO="fs"
export TOOLCHAIN=~/xtools/toolchain/${DROBO}
export TOOLCHAIN="${BUILD_TOOLCHAIN:-${HOME}/xtools/toolchain/${DROBO}}"
export ARCH="armv5te"
export HOST="arm-none-linux-gnueabi"
export PATH="${TOOLCHAIN}/bin:~/bin:$PATH"
Expand Down
2 changes: 2 additions & 0 deletions src/dest/etc/aria2.conf.default
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
enable-rpc=true
rpc-listen-all=true
rpc-allow-origin-all=true
rpc-user=root
rpc-passwd=root
log=/tmp/DroboApps/aria2/log.txt
log-level=warn
dir=/mnt/DroboFS/Shares/Public
Expand Down
32 changes: 12 additions & 20 deletions src/dest/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,24 @@
#
# install script

prog_dir="$(dirname $(realpath ${0}))"
name="$(basename ${prog_dir})"
logfile="/tmp/DroboApps/${name}/install.log"
prog_dir="$(dirname "$(realpath "${0}")")"
name="$(basename "${prog_dir}")"
tmp_dir="/tmp/DroboApps/${name}"
logfile="${tmp_dir}/install.log"

# script hardening
# boilerplate
if ! grep -q ^tmpfs /proc/mounts; then mount -t tmpfs tmpfs /tmp; fi
if [ ! -d "${tmp_dir}" ]; then mkdir -p "${tmp_dir}"; fi
exec 3>&1 4>&2 1>> "${logfile}" 2>&1
echo "$(date +"%Y-%m-%d %H-%M-%S"):" "${0}" "${@}"
set -o errexit # exit on uncaught error code
set -o nounset # exit on unset variable

# ensure log folder exists
if ! grep -q ^tmpfs /proc/mounts; then mount -t tmpfs tmpfs /tmp; fi
logfolder="$(dirname ${logfile})"
if [[ ! -d "${logfolder}" ]]; then mkdir -p "${logfolder}"; fi

# redirect all output to logfile
exec 3>&1 1>> "${logfile}" 2>&1

# log current date, time, and invocation parameters
echo $(date +"%Y-%m-%d %H-%M-%S"): ${0} ${@}

# enable script tracing
set -o xtrace
set -o xtrace # enable script tracing

# copy default configuration files
find "${prog_dir}" -type f -name "*.default" -print | while read deffile; do
basefile="$(dirname ${deffile})/$(basename ${deffile} .default)"
if [[ ! -f "${basefile}" ]]; then
basefile="$(dirname "${deffile}")/$(basename "${deffile}" .default)"
if [ ! -f "${basefile}" ]; then
cp -vf "${deffile}" "${basefile}"
fi
done
Loading

0 comments on commit f0c7172

Please sign in to comment.