#!/bin/sh project='psmq' out='www/downloads.html' remote="https://distfiles.bofc.pl/${project}" gpg="https://distfiles.bofc.pl/bofc-signing.pub.gpg" asc="https://distfiles.bofc.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@git.bofc.pl:${project}
"
echo "git clone git://git.bofc.pl/${project}
"
echo "git clone http://git.bofc.pl/${project}
"
echo "
You can also add bofc.pl repository to your system and let" echo "package manager to deal with install and updates. Depending on your" echo "distributions there are couple of repositories - neccessary instructions" echo "on how to add repository is on theirs respective sites
" echo "deb comes in two files, first is psmq.deb which" echo "contains tools and broker. Second file is libpsmq.deb which" echo "contains psmq library. You need both for program to work
" echo "" files="$(get_files_from_remote "${remote}/" | \ grep "${project}-[0-9]*\.[0-9]*\.[0-9][\.-]\(r[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][\.-]\(r[0-9]\)\?" | \ grep -v "${project}-9999.tar." | \ 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(%s)\n" "${v}" \ "deb" \ "s" \ "sha1" \ "lib" \ "s" \ "sha1" \ "dbgsym" \ "s" \ "dev" \ "s" \ "dsc" \ "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(%s)\n" "${v}" \ "deb" \ "s" \ "sha1" \ "lib" \ "s" \ "sha1" \ "dbgsym" \ "s" \ "dev" \ "s" \ "dsc" \ "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>&- failed=0 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" continue fi failed=1 done exit ${failed}