mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-03-25 21:40:52 +00:00
Compare commits
20 Commits
Release_4.
...
Release_4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa819618c2 | ||
|
|
9c162459b0 | ||
|
|
25b494e562 | ||
|
|
0b5cadd104 | ||
|
|
a2106e4e82 | ||
|
|
a8a00ba0f7 | ||
|
|
1595a74ada | ||
|
|
68d723ecba | ||
|
|
250d616129 | ||
|
|
fbf816d219 | ||
|
|
7f0133a196 | ||
|
|
f798f22434 | ||
|
|
248bc9f672 | ||
|
|
7a7db703f1 | ||
|
|
da195ac5cb | ||
|
|
20a0a09f5f | ||
|
|
7d8c578c57 | ||
|
|
d7f615108f | ||
|
|
c98501a898 | ||
|
|
23f145a4c2 |
154
.github/workflows/release.yml
vendored
154
.github/workflows/release.yml
vendored
@@ -22,15 +22,34 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: make githubtests
|
run: make githubtests
|
||||||
|
|
||||||
# Then create release only if tests pass
|
# Build binaries for each platform
|
||||||
create-release:
|
build:
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
goos: linux
|
||||||
|
goarch: amd64
|
||||||
|
output_name: linux_amd64
|
||||||
|
- os: ubuntu-24.04-arm
|
||||||
|
goos: linux
|
||||||
|
goarch: arm64
|
||||||
|
output_name: linux_arm64
|
||||||
|
- os: macos-15-intel
|
||||||
|
goos: darwin
|
||||||
|
goarch: amd64
|
||||||
|
output_name: darwin_amd64
|
||||||
|
- os: macos-latest
|
||||||
|
goos: darwin
|
||||||
|
goarch: arm64
|
||||||
|
output_name: darwin_arm64
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
@@ -42,77 +61,59 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
TAG=${GITHUB_REF#refs/tags/Release_}
|
TAG=${GITHUB_REF#refs/tags/Release_}
|
||||||
echo "version=$TAG" >> $GITHUB_OUTPUT
|
echo "version=$TAG" >> $GITHUB_OUTPUT
|
||||||
echo "tag_name=Release_$TAG" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Build binaries for multiple platforms
|
- name: Install build tools (macOS)
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
run: |
|
||||||
|
# Ensure Xcode Command Line Tools are installed
|
||||||
|
xcode-select --install 2>/dev/null || true
|
||||||
|
xcode-select -p
|
||||||
|
|
||||||
|
- name: Build binaries
|
||||||
env:
|
env:
|
||||||
|
GOOS: ${{ matrix.goos }}
|
||||||
|
GOARCH: ${{ matrix.goarch }}
|
||||||
VERSION: ${{ steps.get_version.outputs.version }}
|
VERSION: ${{ steps.get_version.outputs.version }}
|
||||||
|
run: |
|
||||||
|
make obitools
|
||||||
|
mkdir -p artifacts
|
||||||
|
# Create a single tar.gz with all binaries for this platform
|
||||||
|
tar -czf artifacts/obitools4_${VERSION}_${{ matrix.output_name }}.tar.gz -C build .
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: binaries-${{ matrix.output_name }}
|
||||||
|
path: artifacts/*
|
||||||
|
|
||||||
|
# Create the release
|
||||||
|
create-release:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Extract version from tag
|
||||||
|
id: get_version
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_REF#refs/tags/Release_}
|
||||||
|
echo "version=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Download all artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: release-artifacts
|
||||||
|
|
||||||
|
- name: Prepare release directory
|
||||||
run: |
|
run: |
|
||||||
mkdir -p release
|
mkdir -p release
|
||||||
|
find release-artifacts -type f -name "*.tar.gz" -exec cp {} release/ \;
|
||||||
# Build for Linux AMD64
|
|
||||||
echo "Building for Linux AMD64..."
|
|
||||||
GOOS=linux GOARCH=amd64 make
|
|
||||||
cd build
|
|
||||||
for binary in *; do
|
|
||||||
tar -czf ../release/${binary}_${VERSION}_linux_amd64.tar.gz ${binary}
|
|
||||||
done
|
|
||||||
cd ..
|
|
||||||
rm -rf build
|
|
||||||
|
|
||||||
|
|
||||||
# Build for Linux ARM64
|
|
||||||
echo "Building for Linux ARM64..."
|
|
||||||
GOOS=linux GOARCH=arm64 make
|
|
||||||
cd build
|
|
||||||
for binary in *; do
|
|
||||||
tar -czf ../release/${binary}_${VERSION}_linux_arm64.tar.gz ${binary}
|
|
||||||
done
|
|
||||||
cd ..
|
|
||||||
rm -rf build
|
|
||||||
|
|
||||||
|
|
||||||
# Build for macOS AMD64 (Intel)
|
|
||||||
echo "Building for macOS AMD64..."
|
|
||||||
GOOS=darwin GOARCH=amd64 make
|
|
||||||
cd build
|
|
||||||
for binary in *; do
|
|
||||||
tar -czf ../release/${binary}_${VERSION}_darwin_amd64.tar.gz ${binary}
|
|
||||||
done
|
|
||||||
cd ..
|
|
||||||
rm -rf build
|
|
||||||
|
|
||||||
|
|
||||||
# Build for macOS ARM64 (Apple Silicon)
|
|
||||||
echo "Building for macOS ARM64..."
|
|
||||||
GOOS=darwin GOARCH=arm64 make
|
|
||||||
cd build
|
|
||||||
for binary in *; do
|
|
||||||
tar -czf ../release/${binary}_${VERSION}_darwin_arm64.tar.gz ${binary}
|
|
||||||
done
|
|
||||||
cd ..
|
|
||||||
rm -rf build
|
|
||||||
|
|
||||||
|
|
||||||
# Build for Windows AMD64
|
|
||||||
echo "Building for Windows AMD64..."
|
|
||||||
GOOS=windows GOARCH=amd64 make
|
|
||||||
cd build
|
|
||||||
for binary in *; do
|
|
||||||
# Windows binaries have .exe extension
|
|
||||||
if [ -f "${binary}.exe" ]; then
|
|
||||||
zip ../release/${binary}_${VERSION}_windows_amd64.zip ${binary}.exe
|
|
||||||
else
|
|
||||||
zip ../release/${binary}_${VERSION}_windows_amd64.zip ${binary}
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
echo "Built archives:"
|
|
||||||
ls -lh release/
|
ls -lh release/
|
||||||
|
|
||||||
- name: Generate Release Notes
|
- name: Generate Release Notes
|
||||||
id: release_notes
|
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ steps.get_version.outputs.version }}
|
VERSION: ${{ steps.get_version.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
@@ -135,34 +136,29 @@ jobs:
|
|||||||
echo "" >> release_notes.md
|
echo "" >> release_notes.md
|
||||||
echo "## Installation" >> release_notes.md
|
echo "## Installation" >> release_notes.md
|
||||||
echo "" >> release_notes.md
|
echo "" >> release_notes.md
|
||||||
echo "Download the appropriate binary for your system and extract it:" >> release_notes.md
|
echo "Download the appropriate archive for your system and extract it:" >> release_notes.md
|
||||||
echo "" >> release_notes.md
|
echo "" >> release_notes.md
|
||||||
echo "### Linux (AMD64)" >> release_notes.md
|
echo "### Linux (AMD64)" >> release_notes.md
|
||||||
echo '```bash' >> release_notes.md
|
echo '```bash' >> release_notes.md
|
||||||
echo "tar -xzf <tool>_${VERSION}_linux_amd64.tar.gz" >> release_notes.md
|
echo "tar -xzf obitools4_${VERSION}_linux_amd64.tar.gz" >> release_notes.md
|
||||||
echo '```' >> release_notes.md
|
echo '```' >> release_notes.md
|
||||||
echo "" >> release_notes.md
|
echo "" >> release_notes.md
|
||||||
echo "### Linux (ARM64)" >> release_notes.md
|
echo "### Linux (ARM64)" >> release_notes.md
|
||||||
echo '```bash' >> release_notes.md
|
echo '```bash' >> release_notes.md
|
||||||
echo "tar -xzf <tool>_${VERSION}_linux_arm64.tar.gz" >> release_notes.md
|
echo "tar -xzf obitools4_${VERSION}_linux_arm64.tar.gz" >> release_notes.md
|
||||||
echo '```' >> release_notes.md
|
echo '```' >> release_notes.md
|
||||||
echo "" >> release_notes.md
|
echo "" >> release_notes.md
|
||||||
echo "### macOS (Intel)" >> release_notes.md
|
echo "### macOS (Intel)" >> release_notes.md
|
||||||
echo '```bash' >> release_notes.md
|
echo '```bash' >> release_notes.md
|
||||||
echo "tar -xzf <tool>_${VERSION}_darwin_amd64.tar.gz" >> release_notes.md
|
echo "tar -xzf obitools4_${VERSION}_darwin_amd64.tar.gz" >> release_notes.md
|
||||||
echo '```' >> release_notes.md
|
echo '```' >> release_notes.md
|
||||||
echo "" >> release_notes.md
|
echo "" >> release_notes.md
|
||||||
echo "### macOS (Apple Silicon)" >> release_notes.md
|
echo "### macOS (Apple Silicon)" >> release_notes.md
|
||||||
echo '```bash' >> release_notes.md
|
echo '```bash' >> release_notes.md
|
||||||
echo "tar -xzf <tool>_${VERSION}_darwin_arm64.tar.gz" >> release_notes.md
|
echo "tar -xzf obitools4_${VERSION}_darwin_arm64.tar.gz" >> release_notes.md
|
||||||
echo '```' >> release_notes.md
|
echo '```' >> release_notes.md
|
||||||
echo "" >> release_notes.md
|
echo "" >> release_notes.md
|
||||||
echo "### Windows (AMD64)" >> release_notes.md
|
echo "All OBITools4 binaries are included in each archive." >> release_notes.md
|
||||||
echo '```powershell' >> release_notes.md
|
|
||||||
echo "Expand-Archive <tool>_${VERSION}_windows_amd64.zip" >> release_notes.md
|
|
||||||
echo '```' >> release_notes.md
|
|
||||||
echo "" >> release_notes.md
|
|
||||||
echo "Available tools: Replace \`<tool>\` with one of the obitools commands." >> release_notes.md
|
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|||||||
34
README.md
34
README.md
@@ -16,12 +16,17 @@ The easiest way to run it is to copy and paste the following command into your t
|
|||||||
curl -L https://raw.githubusercontent.com/metabarcoding/obitools4/master/install_obitools.sh | bash
|
curl -L https://raw.githubusercontent.com/metabarcoding/obitools4/master/install_obitools.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, the script installs the *OBITools* commands and other associated files into the `/usr/local` directory.
|
By default, the script installs the latest version of *OBITools* commands and other associated files into the `/usr/local` directory.
|
||||||
The names of the commands in the new *OBITools4* are mostly identical to those in *OBITools2*.
|
|
||||||
Therefore, installing the new *OBITools* may hide or delete the old ones. If you want both versions to be
|
|
||||||
available on your system, the installation script offers two options:
|
|
||||||
|
|
||||||
|
### Installation Options
|
||||||
|
|
||||||
|
The installation script offers several options:
|
||||||
|
|
||||||
|
> -l, --list List all available versions and exit.
|
||||||
|
>
|
||||||
|
> -v, --version Install a specific version (e.g., `-v 4.4.3`).
|
||||||
|
> By default, the latest version is installed.
|
||||||
|
>
|
||||||
> -i, --install-dir Directory where obitools are installed
|
> -i, --install-dir Directory where obitools are installed
|
||||||
> (as example use `/usr/local` not `/usr/local/bin`).
|
> (as example use `/usr/local` not `/usr/local/bin`).
|
||||||
>
|
>
|
||||||
@@ -30,14 +35,31 @@ available on your system, the installation script offers two options:
|
|||||||
> same time on your system (as example `-p g` will produce
|
> same time on your system (as example `-p g` will produce
|
||||||
> `gobigrep` command instead of `obigrep`).
|
> `gobigrep` command instead of `obigrep`).
|
||||||
|
|
||||||
You can use these options by following the installation command:
|
### Examples
|
||||||
|
|
||||||
|
List all available versions:
|
||||||
|
```{bash}
|
||||||
|
curl -L https://raw.githubusercontent.com/metabarcoding/obitools4/master/install_obitools.sh | bash -s -- --list
|
||||||
|
```
|
||||||
|
|
||||||
|
Install a specific version:
|
||||||
|
```{bash}
|
||||||
|
curl -L https://raw.githubusercontent.com/metabarcoding/obitools4/master/install_obitools.sh | bash -s -- --version 4.4.3
|
||||||
|
```
|
||||||
|
|
||||||
|
Install in a custom directory with command prefix:
|
||||||
```{bash}
|
```{bash}
|
||||||
curl -L https://raw.githubusercontent.com/metabarcoding/obitools4/master/install_obitools.sh | \
|
curl -L https://raw.githubusercontent.com/metabarcoding/obitools4/master/install_obitools.sh | \
|
||||||
bash -s -- --install-dir test_install --obitools-prefix k
|
bash -s -- --install-dir test_install --obitools-prefix k
|
||||||
```
|
```
|
||||||
|
|
||||||
In this case, the binaries will be installed in the `test_install` directory and all command names will be prefixed with the letter `k`. Thus, `obigrep` will be named `kobigrep`.
|
In this last example, the binaries will be installed in the `test_install` directory and all command names will be prefixed with the letter `k`. Thus, `obigrep` will be named `kobigrep`.
|
||||||
|
|
||||||
|
### Note on Version Compatibility
|
||||||
|
|
||||||
|
The names of the commands in the new *OBITools4* are mostly identical to those in *OBITools2*.
|
||||||
|
Therefore, installing the new *OBITools* may hide or delete the old ones. If you want both versions to be
|
||||||
|
available on your system, use the `--install-dir` and `--obitools-prefix` options as shown above.
|
||||||
|
|
||||||
## Continuing the analysis...
|
## Continuing the analysis...
|
||||||
|
|
||||||
|
|||||||
Submodule ecoprimers deleted from b7552200bd
@@ -1,27 +1,56 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
INSTALL_DIR="/usr/local"
|
# Default values
|
||||||
OBITOOLS_PREFIX=""
|
|
||||||
# default values
|
|
||||||
URL="https://go.dev/dl/"
|
URL="https://go.dev/dl/"
|
||||||
OBIURL4="https://github.com/metabarcoding/obitools4/archive/refs/heads/master.zip"
|
GITHUB_REPO="https://github.com/metabarcoding/obitools4"
|
||||||
INSTALL_DIR="/usr/local"
|
INSTALL_DIR="/usr/local"
|
||||||
OBITOOLS_PREFIX=""
|
OBITOOLS_PREFIX=""
|
||||||
|
VERSION=""
|
||||||
|
LIST_VERSIONS=false
|
||||||
|
|
||||||
# help message
|
# Help message
|
||||||
function display_help {
|
function display_help {
|
||||||
echo "Usage: $0 [OPTIONS]"
|
echo "Usage: $0 [OPTIONS]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -i, --install-dir Directory where obitools are installed "
|
echo " -i, --install-dir Directory where obitools are installed "
|
||||||
echo " (as example use /usr/local not /usr/local/bin)."
|
echo " (e.g., use /usr/local not /usr/local/bin)."
|
||||||
echo " -p, --obitools-prefix Prefix added to the obitools command names if you"
|
echo " -p, --obitools-prefix Prefix added to the obitools command names if you"
|
||||||
echo " want to have several versions of obitools at the"
|
echo " want to have several versions of obitools at the"
|
||||||
echo " same time on your system (as example -p g will produce "
|
echo " same time on your system (e.g., -p g will produce "
|
||||||
echo " gobigrep command instead of obigrep)."
|
echo " gobigrep command instead of obigrep)."
|
||||||
|
echo " -v, --version Install a specific version (e.g., 4.4.8)."
|
||||||
|
echo " If not specified, installs the latest version."
|
||||||
|
echo " -l, --list List all available versions and exit."
|
||||||
echo " -h, --help Display this help message."
|
echo " -h, --help Display this help message."
|
||||||
|
echo ""
|
||||||
|
echo "Examples:"
|
||||||
|
echo " $0 # Install latest version"
|
||||||
|
echo " $0 -l # List available versions"
|
||||||
|
echo " $0 -v 4.4.8 # Install specific version"
|
||||||
|
echo " $0 -i /opt/local # Install to custom directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# List available versions from GitHub releases
|
||||||
|
function list_versions {
|
||||||
|
echo "Fetching available versions..." 1>&2
|
||||||
|
echo ""
|
||||||
|
curl -s "https://api.github.com/repos/metabarcoding/obitools4/releases" \
|
||||||
|
| grep '"tag_name":' \
|
||||||
|
| sed -E 's/.*"tag_name": "Release_([0-9.]+)".*/\1/' \
|
||||||
|
| sort -V -r
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get latest version from GitHub releases
|
||||||
|
function get_latest_version {
|
||||||
|
curl -s "https://api.github.com/repos/metabarcoding/obitools4/releases" \
|
||||||
|
| grep '"tag_name":' \
|
||||||
|
| sed -E 's/.*"tag_name": "Release_([0-9.]+)".*/\1/' \
|
||||||
|
| sort -V -r \
|
||||||
|
| head -1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse command line arguments
|
||||||
while [ "$#" -gt 0 ]; do
|
while [ "$#" -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-i|--install-dir)
|
-i|--install-dir)
|
||||||
@@ -32,30 +61,59 @@ while [ "$#" -gt 0 ]; do
|
|||||||
OBITOOLS_PREFIX="$2"
|
OBITOOLS_PREFIX="$2"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
-v|--version)
|
||||||
|
VERSION="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
-l|--list)
|
||||||
|
LIST_VERSIONS=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
display_help 1>&2
|
display_help
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Error: Unsupported option $1" 1>&2
|
echo "Error: Unsupported option $1" 1>&2
|
||||||
|
display_help 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# the directory from where the script is run
|
# List versions and exit if requested
|
||||||
|
if [ "$LIST_VERSIONS" = true ]; then
|
||||||
|
echo "Available OBITools4 versions:"
|
||||||
|
echo "=============================="
|
||||||
|
list_versions
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Determine version to install
|
||||||
|
if [ -z "$VERSION" ]; then
|
||||||
|
echo "Fetching latest version..." 1>&2
|
||||||
|
VERSION=$(get_latest_version)
|
||||||
|
if [ -z "$VERSION" ]; then
|
||||||
|
echo "Error: Could not determine latest version" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Latest version: $VERSION" 1>&2
|
||||||
|
else
|
||||||
|
echo "Installing version: $VERSION" 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Construct source URL for the specified version
|
||||||
|
OBIURL4="${GITHUB_REPO}/archive/refs/tags/Release_${VERSION}.zip"
|
||||||
|
|
||||||
|
# The directory from where the script is run
|
||||||
DIR="$(pwd)"
|
DIR="$(pwd)"
|
||||||
|
|
||||||
# the temp directory used, within $DIR
|
# Create temporary directory
|
||||||
# omit the -p parameter to create a temporal directory in the default location
|
|
||||||
# WORK_DIR=$(mktemp -d -p "$DIR" "obitools4.XXXXXX" 2> /dev/null || \
|
|
||||||
# mktemp -d -t "$DIR" "obitools4.XXXXXX")
|
|
||||||
|
|
||||||
WORK_DIR=$(mktemp -d "obitools4.XXXXXX")
|
WORK_DIR=$(mktemp -d "obitools4.XXXXXX")
|
||||||
|
|
||||||
# check if tmp dir was created
|
# Check if tmp dir was created
|
||||||
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
|
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
|
||||||
echo "Could not create temp dir" 1>&2
|
echo "Could not create temp dir" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -63,24 +121,30 @@ mkdir -p "${WORK_DIR}/cache" \
|
|||||||
|| (echo "Cannot create ${WORK_DIR}/cache directory" 1>&2
|
|| (echo "Cannot create ${WORK_DIR}/cache directory" 1>&2
|
||||||
exit 1)
|
exit 1)
|
||||||
|
|
||||||
|
# Create installation directory
|
||||||
mkdir -p "${INSTALL_DIR}/bin" 2> /dev/null \
|
mkdir -p "${INSTALL_DIR}/bin" 2> /dev/null \
|
||||||
|| (echo "Please enter your password for installing obitools in ${INSTALL_DIR}" 1>&2
|
|| (echo "Please enter your password for installing obitools in ${INSTALL_DIR}" 1>&2
|
||||||
sudo mkdir -p "${INSTALL_DIR}/bin")
|
sudo mkdir -p "${INSTALL_DIR}/bin")
|
||||||
|
|
||||||
if [[ ! -d "${INSTALL_DIR}/bin" ]]; then
|
if [[ ! -d "${INSTALL_DIR}/bin" ]]; then
|
||||||
echo "Could not create ${INSTALL_DIR}/bin directory for installing obitools" 1>&2
|
echo "Could not create ${INSTALL_DIR}/bin directory for installing obitools" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
INSTALL_DIR="$(cd ${INSTALL_DIR} && pwd)"
|
INSTALL_DIR="$(cd ${INSTALL_DIR} && pwd)"
|
||||||
|
|
||||||
echo "WORK_DIR=$WORK_DIR" 1>&2
|
echo "================================" 1>&2
|
||||||
echo "INSTALL_DIR=$INSTALL_DIR" 1>&2
|
echo "OBITools4 Installation" 1>&2
|
||||||
echo "OBITOOLS_PREFIX=$OBITOOLS_PREFIX" 1>&2
|
echo "================================" 1>&2
|
||||||
|
echo "VERSION=$VERSION" 1>&2
|
||||||
|
echo "WORK_DIR=$WORK_DIR" 1>&2
|
||||||
|
echo "INSTALL_DIR=$INSTALL_DIR" 1>&2
|
||||||
|
echo "OBITOOLS_PREFIX=$OBITOOLS_PREFIX" 1>&2
|
||||||
|
echo "================================" 1>&2
|
||||||
|
|
||||||
pushd "$WORK_DIR"|| exit
|
pushd "$WORK_DIR" > /dev/null || exit
|
||||||
|
|
||||||
|
# Detect OS and architecture
|
||||||
OS=$(uname -a | awk '{print $1}')
|
OS=$(uname -a | awk '{print $1}')
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
@@ -92,7 +156,9 @@ if [[ "$ARCH" == "aarch64" ]] ; then
|
|||||||
ARCH="arm64"
|
ARCH="arm64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GOFILE=$(curl "$URL" \
|
# Download and install Go
|
||||||
|
echo "Downloading Go..." 1>&2
|
||||||
|
GOFILE=$(curl -s "$URL" \
|
||||||
| grep 'class="download"' \
|
| grep 'class="download"' \
|
||||||
| grep "\.tar\.gz" \
|
| grep "\.tar\.gz" \
|
||||||
| sed -E 's@^.*/dl/(go[1-9].+\.tar\.gz)".*$@\1@' \
|
| sed -E 's@^.*/dl/(go[1-9].+\.tar\.gz)".*$@\1@' \
|
||||||
@@ -100,44 +166,71 @@ GOFILE=$(curl "$URL" \
|
|||||||
| grep -i "$ARCH" \
|
| grep -i "$ARCH" \
|
||||||
| head -1)
|
| head -1)
|
||||||
|
|
||||||
GOURL=$(curl "${URL}${GOFILE}" \
|
GOURL=$(curl -s "${URL}${GOFILE}" \
|
||||||
| sed -E 's@^.*href="(.*\.tar\.gz)".*$@\1@')
|
| sed -E 's@^.*href="(.*\.tar\.gz)".*$@\1@')
|
||||||
|
|
||||||
echo "Install GO from : $GOURL" 1>&2
|
echo "Installing Go from: $GOURL" 1>&2
|
||||||
|
|
||||||
curl "$GOURL" \
|
curl -s "$GOURL" | tar zxf -
|
||||||
| tar zxf -
|
|
||||||
|
|
||||||
PATH="$(pwd)/go/bin:$PATH"
|
PATH="$(pwd)/go/bin:$PATH"
|
||||||
export PATH
|
export PATH
|
||||||
GOPATH="$(pwd)/go"
|
GOPATH="$(pwd)/go"
|
||||||
export GOPATH
|
export GOPATH
|
||||||
|
|
||||||
export GOCACHE="$(pwd)/cache"
|
export GOCACHE="$(pwd)/cache"
|
||||||
echo "GOCACHE=$GOCACHE" 1>&2@
|
|
||||||
|
echo "GOCACHE=$GOCACHE" 1>&2
|
||||||
mkdir -p "$GOCACHE"
|
mkdir -p "$GOCACHE"
|
||||||
|
|
||||||
|
# Download OBITools4 source
|
||||||
|
echo "Downloading OBITools4 v${VERSION}..." 1>&2
|
||||||
|
echo "Source URL: $OBIURL4" 1>&2
|
||||||
|
|
||||||
curl -L "$OBIURL4" > master.zip
|
if ! curl -sL "$OBIURL4" > obitools4.zip; then
|
||||||
unzip master.zip
|
echo "Error: Could not download OBITools4 version ${VERSION}" 1>&2
|
||||||
|
echo "Please check that this version exists with: $0 --list" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Install OBITOOLS from : $OBIURL4"
|
unzip -q obitools4.zip
|
||||||
|
|
||||||
cd obitools4-master || exit
|
# Find the extracted directory
|
||||||
mkdir vendor
|
OBITOOLS_DIR=$(ls -d obitools4-* 2>/dev/null | head -1)
|
||||||
|
|
||||||
|
if [ -z "$OBITOOLS_DIR" ] || [ ! -d "$OBITOOLS_DIR" ]; then
|
||||||
|
echo "Error: Could not find extracted OBITools4 directory" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Building OBITools4..." 1>&2
|
||||||
|
cd "$OBITOOLS_DIR" || exit
|
||||||
|
mkdir -p vendor
|
||||||
|
|
||||||
|
# Build with or without prefix
|
||||||
if [[ -z "$OBITOOLS_PREFIX" ]] ; then
|
if [[ -z "$OBITOOLS_PREFIX" ]] ; then
|
||||||
make GOFLAGS="-buildvcs=false"
|
make GOFLAGS="-buildvcs=false"
|
||||||
else
|
else
|
||||||
make GOFLAGS="-buildvcs=false" OBITOOLS_PREFIX="${OBITOOLS_PREFIX}"
|
make GOFLAGS="-buildvcs=false" OBITOOLS_PREFIX="${OBITOOLS_PREFIX}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Install binaries
|
||||||
|
echo "Installing binaries to ${INSTALL_DIR}/bin..." 1>&2
|
||||||
(cp build/* "${INSTALL_DIR}/bin" 2> /dev/null) \
|
(cp build/* "${INSTALL_DIR}/bin" 2> /dev/null) \
|
||||||
|| (echo "Please enter your password for installing obitools in ${INSTALL_DIR}"
|
|| (echo "Please enter your password for installing obitools in ${INSTALL_DIR}" 1>&2
|
||||||
sudo cp build/* "${INSTALL_DIR}/bin")
|
sudo cp build/* "${INSTALL_DIR}/bin")
|
||||||
|
|
||||||
popd || exit
|
popd > /dev/null || exit
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
echo "Cleaning up..." 1>&2
|
||||||
chmod -R +w "$WORK_DIR"
|
chmod -R +w "$WORK_DIR"
|
||||||
rm -rf "$WORK_DIR"
|
rm -rf "$WORK_DIR"
|
||||||
|
|
||||||
|
echo "" 1>&2
|
||||||
|
echo "================================" 1>&2
|
||||||
|
echo "OBITools4 v${VERSION} installed successfully!" 1>&2
|
||||||
|
echo "Binaries location: ${INSTALL_DIR}/bin" 1>&2
|
||||||
|
if [[ -n "$OBITOOLS_PREFIX" ]] ; then
|
||||||
|
echo "Command prefix: ${OBITOOLS_PREFIX}" 1>&2
|
||||||
|
fi
|
||||||
|
echo "================================" 1>&2
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package obioptions
|
|||||||
// Version is automatically updated by the Makefile from version.txt
|
// Version is automatically updated by the Makefile from version.txt
|
||||||
// The patch number (third digit) is incremented on each push to the repository
|
// The patch number (third digit) is incremented on each push to the repository
|
||||||
|
|
||||||
var _Version = "Release 4.4.5"
|
var _Version = "Release 4.4.10"
|
||||||
|
|
||||||
// Version returns the version of the obitools package.
|
// Version returns the version of the obitools package.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
4.4.5
|
4.4.10
|
||||||
|
|||||||
Reference in New Issue
Block a user