#!/bin/sh project='librb' out='www/downloads.html' remote="https://distfiles.kurwinet.pl/${project}" gpg="https://distfiles.kurwinet.pl/bofc-signing.pub.gpg" asc="https://distfiles.kurwinet.pl/bofc-signing.pub.asc" get_files_from_remote() { remote="${1}" curl "${remote}/" -A "${project}-generator" 2>/dev/null | grep "a href=" | \ grep -v 'a href=".."' | cut -f2 -d\" | cut -f1 -d/ } # extract links to files links="$(curl "${remote}/" -A "${project}-generator" 2>/dev/null \ | grep "${project}-[0-9]*\.[0-9]*\.[0-9]*\." | sort -r)" exec 6>&1 exec 1<>"${out}" echo > "${out}" echo "
"
echo "Below you can find source files and binary packages for various systems."
echo "(s) right of package name is a gpg signature. You can download"
echo "gpg file or"
echo "armored asc file to verify files. You can also"
echo "look for key on public keyservers, fingerprint is
"
echo " 63D0 C3DB 42AF 3B4F CF6E 7880 E84A 7E61 C785 0C62
"
echo "You can download key directly from keyserver with
"
echo " gpg --recv-keys 63D0C3DB42AF3B4FCF6E7880E84A7E61C7850C62
"
echo "Then you can verify downloaded image with command
"
echo " gpg --verify <sig-file> <package-file>"
echo "
"
echo "All files (including md5, sha256 and sha512 for all files) can also"
echo "be downloaded from: ${remote}
"
echo "
"
echo "git clone git@kurwinet.pl:${project}
"
echo "git clone git://kurwinet.pl/${project}
"
echo "git clone http://git.kurwinet.pl/${project}
"
echo "
" files="$(get_files_from_remote "${remote}/" | \ grep "${project}-[0-9]*\.[0-9]*\.[0-9]*\.")" versions="$(echo "${files}" | tr ' ' '\n' | rev | \ cut -f1 -d- | rev | cut -f1-3 -d. | sort -Vur)" for v in ${versions} do printf "%-10s%s(%s|%s) %s(%s|%s) %s(%s|%s)\n" "${v}" \ "tar.gz" \ "s" \ "sha1" \ "tar.bz2" \ "s" \ "sha1" \ "tar.xz" \ "s" \ "sha1" done echo "" distros="$(get_files_from_remote "${remote}/" | \ grep -v "${project}-[0-9]*\.[0-9]*\.[0-9]*\." | \ sort -t'-' -k1,1 -k2,2Vr)" for d in ${distros} do dname="$(echo ${d} | cut -f1 -d-)" dvers="$(echo ${d} | cut -f2 -d-)" archs="$(get_files_from_remote "${remote}/${d}/")" echo "
" for v in ${versions} do case "${dname}" in debian) ABI="$(echo "${v}" | cut -f1 -d.)" printf "%-10s%s(%s|%s) %s(%s) %s(%s) %s(%s) %s(%s) %s(%s)\n" "${v}" \ "deb" \ "s" \ "sha1" \ "dbgsym" \ "s" \ "dev" \ "s" \ "dsc" \ "s" \ "build" \ "s" \ "buildinfo" \ "s" ;; ubuntu) ABI="$(echo "${v}" | cut -f1 -d.)" printf "%-10s%s(%s|%s) %s(%s) %s(%s) %s(%s) %s(%s) %s(%s)\n" "${v}" \ "deb" \ "s" \ "sha1" \ "dbgsym" \ "s" \ "dev" \ "s" \ "dsc" \ "s" \ "build" \ "s" \ "buildinfo" \ "s" ;; rhel|centos|opensuse|fedora) printf "%-10s%s(%s|%s) %s(%s) %s(%s)\n" "${v}" \ "rpm" \ "s" \ "sha1" \ "dbginfo" \ "s" \ "devel" \ "s" ;; slackware) printf "%-10s%s(%s|%s)\n" "${v}" \ "tgz" \ "s" \ "sha1" ;; esac done echo "" done done exec 1>&6 6>&- for l in $(lynx -listonly -nonumbers -dump "${out}" | grep "https://distfiles") do echo -n "checking ${l}... " curl -sSfl -A "${project}-generator" "${l}" >/dev/null if [ ${?} -eq 0 ] then echo "ok" fi done