FLAC="flac-1.3.0"
FLEX="flex-2.5.37"
FONTCONFIG="fontconfig-2.11.1"
-FONTFORGE="FontForge-20141126"
+FONTFORGE="FontForge-2014.11.26"
FOO2ZJS="foo2zjs"
FOOMATIC_FILTERS="foomatic-filters-4.0.17"
FREETYPE="freetype-2.5.4"
# pm (Perl module via CPAN)
# fd (freedesktop.org)
# -o Option specific to mode
-# -s Subdirectory on server
+# -s DIR Subdirectory on server
+# -v NUM Subdirectory on server is equal to package version. If -s option is specified, then
+# append version number to value of -s argument:
+# NUM= Full version number
+# NUM=1 First number of package version
+# NUM=2 First two numbers of package version
+# Ex: fpkg -s "v" -v 2 mypkg-1.2.3 http://mypkg.com would fetch from url:
+# http://mypkg.com/v1.2/mypkg-1.2.3.tar.bz2
# -w First erase destination file if it exists (except in test mode)
fpkg()
{
local MODE_OPT=""
local SRC_DIR=""
local FD_SUBDIR_FINAL=""
+ local VARG=""
+ unset VOPTION
unset ERASE_FIRST
- while getopts "d:e:f:m:o:s:w" flag ;do
+ while getopts "d:e:f:m:o:s:v:w" flag ;do
case ${flag} in
d)
# Fetch directory (where to put file)
s)
SRC_DIR=${OPTARG}
;;
+ v)
+ VOPTION="y"
+ VARG=${OPTARG}
+ ;;
w)
ERASE_FIRST="y"
;;
local URL=${2}
fi
+ if [ -n "${VOPTION}" ]; then
+ # Append version number to SRC_DIR (if specified)
+ case ${VARG} in
+ 0)
+ # Full version number
+ SRC_DIR+="$(get_pkg_ver ${PACK})"
+ ;;
+ 1)
+ SRC_DIR+="$(get_pkg_ver1 ${PACK})"
+ ;;
+ 2)
+ SRC_DIR+="$(get_pkg_ver2 ${PACK})"
+ ;;
+ 3)
+ SRC_DIR+="$(get_pkg_ver3 ${PACK})"
+ ;;
+ *)
+ echo "${FUNCNAME}(), invalid -v argument: ${VARG}"
+ return 1
+ ;;
+ esac
+ fi
+
if [ -n "${MODE}" ]; then
case ${MODE} in
gnu)
fpkg ${ZLIB} "http://www.zlib.net"
fpkg -m gnu ${BASH}
fpkg -m gnu ${BISON}
-fpkg -e "tar.gz" ${BZIP2} "http://www.bzip.org/$(get_pkg_ver ${BZIP2})"
+fpkg -e "tar.gz" -v 0 ${BZIP2} "http://www.bzip.org"
fpkg -m gnu -e "tar.xz" ${COREUTILS}
fpkg -m gnu ${DIFFUTILS}
fpkg -m gnu ${FINDUTILS}
fpkg ${XZ_UTILS} "http://tukaani.org/xz"
# Chapter 7
-fpkg -s "linux/utils/util-linux/v$(get_pkg_ver2 ${UTIL_LINUX})" \
- ${UTIL_LINUX} ${KERNEL_URL}
+fpkg -s "linux/utils/util-linux/v" -v 2 ${UTIL_LINUX} ${KERNEL_URL}
fpkg -m hv ${SHADOW}
fpkg -m sf ${E2FSPROGS}
fpkg ${SYSVINIT} "http://download.savannah.gnu.org/releases/sysvinit"
fpkg -s "manpages" ${MANPAGES} "http://tldp.org"
fpkg -m gnu -e "tar.gz" ${GPERF}
fpkg -e "tar.gz" ${LIBFFI} "ftp://sourceware.org/pub/libffi"
-fpkg ${PYTHON} "http://www.python.org/ftp/python/$(get_pkg_ver ${PYTHON})"
+fpkg -v 0 ${PYTHON} "http://www.python.org/ftp/python"
fpkg -m gnome ${GLIB}
fpkg -m fd ${PKG_CONFIG}
fpkg ${IANA} "http://www.sethwklein.net"
fpkg -e "tar.gz" ${SYSKLOGD} \
"http://www.infodrom.org/projects/sysklogd/download"
fpkg -m gnu ${GRUB}
-fpkg -e "tar.gz" ${DHCP} "ftp://ftp.isc.org/isc/dhcp/$(get_pkg_ver ${DHCP})"
+fpkg -e "tar.gz" -v 0 ${DHCP} "ftp://ftp.isc.org/isc/dhcp"
fpkg ${DHCPCD} "http://roy.marples.name/downloads/dhcpcd"
fpkg -e "tar.gz" ${ACPID} "http://www.tedfelix.com/linux"
lpkg 2 ${SHADOW}
# These packages are only for stage3
-
fpkg -m gnu ${WHICH}
fpkg -e "tar.gz" ${BASHCOMPLETION} "http://www.caliban.org/files/bash"
fpkg -s "software/utils/pciutils" ${PCIUTILS} ${KERNEL_URL}
fpkg -e "tar.gz" ${LIBPCAP} ${TCPDUMP_URL}
fpkg -e "tar.gz" ${TCPDUMP} ${TCPDUMP_URL}
fpkg ${NMAP} "http://download.insecure.org/nmap/dist"
-fpkg -e "tar.gz" -s "$(get_pkg_ver ${BIND})" ${BIND} \
- "ftp://ftp.isc.org/isc/bind9"
+fpkg -e "tar.gz" -v 0 ${BIND} "ftp://ftp.isc.org/isc/bind9"
fpkg ${IPTABLES} "http://www.netfilter.org/projects/iptables/files"
fpkg ${CURL} "http://curl.haxx.se/download"
fpkg -e "tar.gz" ${RSYNC} "http://samba.org/ftp/rsync/src"
fpkg -m hv ${GETDATE}
fpkg -e "tar.gz" ${LIBARCHIVE} "http://github.com/downloads/libarchive/libarchive"
-fpkg -e "tar.gz" ${CMAKE} "http://www.cmake.org/files/v$(get_pkg_ver2 ${CMAKE})"
+fpkg -e "tar.gz" -s "v" -v 2 ${CMAKE} "http://www.cmake.org/files"
fpkg -e "tar.gz" ${MYSQL} \
"http://anduin.linuxfromscratch.org/sources/BLFS/svn/m"
fpkg -s "libgpg-error" ${LIBGPG_ERROR} ${GNUPG_URL}
fpkg -s "libgcrypt" ${LIBGCRYPT} ${GNUPG_URL}
fpkg -e "tar.gz" ${NETTLE} "http://www.lysator.liu.se/~nisse/archive"
-fpkg -e "tar.xz" -s "gnutls/v$(get_pkg_ver2 ${GNUTLS})" ${GNUTLS} ${GNUPG_URL}
+fpkg -e "tar.xz" -s "gnutls/v" -v 2 ${GNUTLS} ${GNUPG_URL}
fpkg -e "tar.gz" ${SASL2} "ftp://ftp.andrew.cmu.edu/pub/cyrus-mail"
fpkg -e "tgz" ${OPENLDAP} \
if [ "x${INST_TYPE}" = "xworkstation" -o "x${INST_TYPE}" = "xltsp-server" ]; then
if [ "x${SOUND_CARD}" = "xyes" ]; then
- fpkg ${NASM} "http://www.nasm.us/pub/nasm/releasebuilds/$(get_pkg_ver \
- ${NASM})"
+ fpkg -v 0 ${NASM} "http://www.nasm.us/pub/nasm/releasebuilds"
fpkg ${ALSA_LIB} "ftp://ftp.alsa-project.org/pub/lib"
fpkg ${ALSA_UTILS} "ftp://ftp.alsa-project.org/pub/utils"
fpkg ${LIBDRM} "http://dri.freedesktop.org/libdrm"
fpkg -e "tar.gz" ${TALLOC} "http://samba.org/ftp/talloc"
-fpkg -e "tar.gz" -f "${LLVM}.src" ${LLVM} "http://llvm.org/releases/$(get_pkg_ver ${LLVM})"
-fpkg -s "$(get_pkg_ver ${MESALIB})" ${MESALIB} \
- ftp://ftp.freedesktop.org/pub/mesa
+fpkg -e "tar.gz" -f "${LLVM}.src" -v 0 ${LLVM} "http://llvm.org/releases"
+fpkg -v 0 ${MESALIB} "ftp://ftp.freedesktop.org/pub/mesa"
fpkg -m xorg -s data ${XCURSOR_THEMES}
fpkg -s data/xkeyboard-config ${XKEYBOARD_CONFIG} ${XORG_URL}
fpkg -m gnu ${HELP2MAN}
fpkg -m gnu ${GSL}
-fpkg -s "$(get_pkg_ver3 ${CUPS})" -f "${CUPS}-source" ${CUPS} \
- "http://www.cups.org/software"
+fpkg -v 3 -f "${CUPS}-source" ${CUPS} "http://www.cups.org/software"
fpkg -e "tar.gz" -f "$(get_pkg_name ${CUPS_PDF})_$(get_pkg_ver ${CUPS_PDF})" \
${CUPS_PDF} "http://www.cups-pdf.de/src"
fpkg -m sf -e "tar.bz2" ${SPLIX}
fpkg -e "tar.xz" -m fd -s "none" ${POPPLER}
fpkg -m gnome ${LIBCROCO}
fpkg -m gnome ${LIBRSVG}
-fpkg ${BABL} "ftp://ftp.gtk.org/pub/babl/$(get_pkg_ver2 ${BABL})"
-fpkg ${GEGL} "ftp://ftp.gimp.org/pub/gegl/$(get_pkg_ver2 ${GEGL})"
-fpkg -s "v$(get_pkg_ver2 ${GIMP})" ${GIMP} "http://download.gimp.org/pub/gimp"
+fpkg -v 2 ${BABL} "http://download.gimp.org/pub/babl"
+fpkg -v 2 ${GEGL} "http://download.gimp.org/pub/gegl"
+fpkg -s "v" -v 2 ${GIMP} "http://download.gimp.org/pub/gimp"
fpkg -m sf -s "gimp-print" -e "tar.bz2" ${GUTENPRINT}
fpkg -m sf -s "boost" ${BOOST}
fpkg ${CDRTOOLS} "ftp://ftp.berlios.de/pub/cdrecord"
fpkg -e "tar.gz" ${DVDRWTOOLS} \
"http://fy.chalmers.se/~appro/linux/DVD+RW/tools"
-fpkg -s "$(get_pkg_ver ${LIBDVDCSS})" ${LIBDVDCSS} \
- "http://www.videolan.org/pub/libdvdcss"
-fpkg -e "tar.bz2" -s "$(get_pkg_ver ${LIBDVDREAD})" ${LIBDVDREAD} \
+fpkg -v 0 ${LIBDVDCSS} "http://www.videolan.org/pub/libdvdcss"
+fpkg -e "tar.bz2" -v 0 ${LIBDVDREAD} \
"http://download.videolan.org/pub/videolan/libdvdread"
fpkg -e "tar.gz" ${DVDFS} "http://jspenguin.org:81/dvdfs"
fpkg -m sf ${GRIP}
fpkg -m sf -e "tar.bz2" ${CDRDAO}
fpkg -m sf ${ID3LIB}
-fpkg -e "tar.xz" ${EASYTAG} "https://download.gnome.org/sources/easytag/$(get_pkg_ver2 ${EASYTAG})"
-fpkg -e "tar.gz" -f "fontforge-2014-11-26-Unix-Source" -s "" ${FONTFORGE} \
- "https://github.com/fontforge/fontforge/releases/download/$(get_pkg_ver ${FONTFORGE})"
+fpkg -m gnome ${EASYTAG}
+
+fpkg -e "tar.gz" -f "FontForge-$(get_pkg_ver ${FONTFORGE} | sed 's/\./-/g')-Unix-Source" -s "" ${FONTFORGE} \
+ "https://github.com/fontforge/fontforge/releases/download/$(get_pkg_ver ${FONTFORGE} | sed 's/\.//g')"
fpkg -m gnu ${GUILE1}
-fpkg -e "tar.gz" ${LILYPOND} \
- "http://lilypond.org/download/sources/v$(get_pkg_ver2 ${LILYPOND})"
+fpkg -e "tar.gz" -s "v" -v 2 ${LILYPOND} "http://lilypond.org/download/sources"
fpkg -m hv ${CHORDPACK}
fpkg -m hv ${GUITARTEX}
fpkg -m sf -s "wxwindows" ${WXGTK}
fpkg ${AUDACITY} "http://audacity.googlecode.com/files"
-fpkg ${SYLPHEED} \
- "http://sylpheed.sraoss.jp/sylpheed/v$(get_pkg_ver2 ${SYLPHEED})"
+fpkg -s "v" -v 2 ${SYLPHEED} "http://sylpheed.sraoss.jp/sylpheed"
fpkg -m gnome ${LIBNOTIFY}
fpkg -e "tar.xz" -m sf ${VLC}
fpkg -e "tar.gz" ${SDL} "http://www.libsdl.org/release"
fpkg -e "tar.gz" ${AGG} "http://www.antigrain.com"
-fpkg ${GNASH} "http://ftp.gnu.org/pub/gnu/gnash/$(get_pkg_ver ${GNASH})"
+fpkg -v 0 ${GNASH} "http://ftp.gnu.org/pub/gnu/gnash"
fpkg -e "tar.gz" ${LIBSPF2} "http://libspf2.org/spf"
fpkg -e "tgz" ${MILTER_GREYLIST} "ftp://ftp.espci.fr/pub/milter-greylist"
fpkg -m gnome ${LIBGSF}
fpkg -m gnome ${GOFFICE}
fpkg -m gnome ${GNUMERIC}
-fpkg -e "tar.gz" ${WV} "${ABIWORD_URL}/wv/$(get_pkg_ver ${WV})"
+fpkg -e "tar.gz" -v 0 ${WV} "${ABIWORD_URL}/wv"
fpkg -e "tar.gz" ${ABIWORD} \
"${ABIWORD_URL}/abiword/$(get_pkg_ver ${ABIWORD})/source"
#fpkg_mis ${SPLINT} "${SPLINT}.src" "http://splint.org/downloads"
-fpkg -e "tar.gz" ${GEDA_GAF} "http://ftp.geda-project.org/geda-gaf/stable/v$(get_pkg_ver2 ${GEDA_GAF})/$(get_pkg_ver ${GEDA_GAF})"
+fpkg -e "tar.gz" -s "v$(get_pkg_ver2 ${GEDA_GAF})/" -v 0 ${GEDA_GAF} \
+ "http://ftp.geda-project.org/geda-gaf/stable"
fpkg -e "tar.gz" ${AVRDUDE} "http://download.savannah.gnu.org/releases/avrdude"