#!/bin/bash
# sys/idev7 - iDevice helper (for access to iPod/iPhone/iPad over USB)

set -e

source "/home/zwelch/src/mcf/mcsh-release/install/share/mcsh/mcsh.sh"

lib_load 'sys/tool/git'
lib_load 'dev/tool/make'


######
# Native dependencies

idev7_client_packages=(
		build-essential
		git
		automake
		libtool
		pkg-config
		libplist-dev
		libplist++-dev
		python-dev
		libssl-dev
		libusb-1.0-0-dev
		libfuse-dev
	)

######
# Settings

idev7_config_init() {
	script_setting_vars idev7_install
	idev7_install=${idev7_install:-true}
}


######
# CLI

idev7_update() {
	local -a pkgs=( libusbmuxd libimobiledevice usbmuxd ifuse )

	local srcdir="$script_tempdir"
	run_mkdir "$srcdir"
	run_pushd "$srcdir"
	for x in "${pkgs[@]}"; do
		git_clone_or_update "https://github.com/libimobiledevice/${x}.git" "$x"
		run_pushd "$x"
		run ./autogen.sh --prefix="/usr"
		make_run
		! $idev7_install || run_sudo make install
		run_popd
	done
	run_popd
}


######
# Check

idev7_check_build() {
	local idev7_install=false
	idev7_update
}


######
# Main

idev7_desc() { echo "iDevice (iPod/iPhone/iPad) helper"; }
idev7_usage() {
	cat <<USAGE
<cmd> ...
idev7 Commands:
	update				Installs the newest package versions
USAGE
}
idev7_help() {
	cat <<HELP
idev7 is a iDevice helper, enabling access to modern iPod/iPhone/iPad over USB.
It is part of the mcsh package.
HELP
}

app_run "$@"

View the Developer Guide Index

View the Reference Manual Index


Generated on Fri Jul 28 14:34:45 PDT 2017 by mcsh d14 v0.23.0.