mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-13 07:08:23 +01:00
build: add devcontainer.json + Dockerfile
chore: remove unneeded build dir
This commit is contained in:
parent
b6f312f0d0
commit
1050a4e156
103
.devcontainer/Dockerfile
Normal file
103
.devcontainer/Dockerfile
Normal file
@ -0,0 +1,103 @@
|
||||
FROM gcc:11.2.0 AS builder
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
sudo \
|
||||
git \
|
||||
ninja-build \
|
||||
libmpfr-dev \
|
||||
python3-dev && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
# ARG OPENMPI_VERSION=4.1.1
|
||||
# ADD https://download.open-mpi.org/release/open-mpi/v${OPENMPI_VERSION%.*}/openmpi-${OPENMPI_VERSION}.tar.gz /tmp/openmpi.tar.gz
|
||||
|
||||
# RUN mkdir openmpi && \
|
||||
# tar xf openmpi.tar.gz -C openmpi --strip-components 1 && \
|
||||
# cd openmpi && \
|
||||
# ./configure --prefix=/usr/local && \
|
||||
# make -j $(nproc) && \
|
||||
# make install && \
|
||||
# rm -rf /tmp/openmpi tmp/openmpi.tar.gz
|
||||
|
||||
ARG CMAKE_VERSION=3.30.5
|
||||
ADD https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh /tmp/cmake.sh
|
||||
|
||||
RUN bash ./cmake.sh --skip-license --prefix=/usr/local \
|
||||
&& rm cmake.sh
|
||||
|
||||
# ARG LAPACK_VERSION=3.12.0
|
||||
# ADD https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v${LAPACK_VERSION}.tar.gz /tmp/lapack.tar.gz
|
||||
|
||||
# RUN mkdir lapack && \
|
||||
# tar xf lapack.tar.gz -C lapack --strip-components 1 && \
|
||||
# cd lapack && \
|
||||
# mkdir build && \
|
||||
# cd build && \
|
||||
# cmake .. -G Ninja -DBUILD_SHARED_LIBS=ON && \
|
||||
# ninja install && \
|
||||
# rm -rf /tmp/lapack tmp/lapack.tar.gz
|
||||
|
||||
# ARG R_VERSION=4.4.2
|
||||
# ADD https://cran.r-project.org/src/base/R-${R_VERSION%%.*}/R-${R_VERSION}.tar.gz /tmp/R.tar.gz
|
||||
|
||||
# RUN mkdir R && \
|
||||
# tar xf R.tar.gz -C R --strip-components 1 && \
|
||||
# cd R && \
|
||||
# ./configure --prefix=/usr/local --enable-R-shlib --with-blas --with-lapack && \
|
||||
# make -j $(nproc) && \
|
||||
# make install && \
|
||||
# rm -rf /tmp/R tmp/R.tar.gz
|
||||
|
||||
# RUN /usr/local/bin/R -q -e "install.packages(c('Rcpp', 'RInside', 'qs'), repos='https://cran.rstudio.com/')"
|
||||
|
||||
# ARG EIGEN_VERSION=3.4.0
|
||||
# ADD https://gitlab.com/libeigen/eigen/-/archive/${EIGEN_VERSION}/eigen-${EIGEN_VERSION}.tar.bz2 /tmp/eigen.tar.bz2
|
||||
|
||||
# RUN mkdir eigen && \
|
||||
# tar xf eigen.tar.bz2 -C eigen --strip-components 1 && \
|
||||
# cd eigen && \
|
||||
# mkdir build && \
|
||||
# cd build && \
|
||||
# cmake .. -G Ninja && \
|
||||
# ninja install && \
|
||||
# rm -rf /tmp/eigen tmp/eigen.tar.bz2
|
||||
|
||||
ARG GDB_VERSION=15.2
|
||||
ADD https://ftp.gnu.org/gnu/gdb/gdb-${GDB_VERSION}.tar.xz /tmp/gdb.tar.xz
|
||||
|
||||
RUN mkdir gdb && \
|
||||
tar xf gdb.tar.xz -C gdb --strip-components 1 && \
|
||||
cd gdb && \
|
||||
./configure --prefix=/usr/local && \
|
||||
make -j $(nproc) && \
|
||||
make install && \
|
||||
rm -rf /tmp/gdb tmp/gdb.tar.xz
|
||||
|
||||
RUN useradd -m -s /bin/bash -G sudo vscode \
|
||||
&& echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
||||
|
||||
USER vscode
|
||||
|
||||
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
|
||||
|
||||
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.1/zsh-in-docker.sh)" -- \
|
||||
-t agnoster \
|
||||
-p zsh-syntax-highlighting
|
||||
|
||||
RUN zsh -c "git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting"
|
||||
|
||||
RUN zsh -c "git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install"
|
||||
|
||||
RUN mkdir -p /home/vscode/.config/gdb \
|
||||
&& echo "set auto-load safe-path /" > /home/vscode/.config/gdb/gdbinit
|
||||
|
||||
ENV CMAKE_GENERATOR=Ninja
|
||||
ENV CMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
|
||||
WORKDIR /home/vscode
|
||||
29
.devcontainer/devcontainer.json
Normal file
29
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,29 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
|
||||
{
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
// "features": {},
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
// Uncomment the next line to run commands after the container is created.
|
||||
// "postCreateCommand": "cat /etc/os-release",
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"twxs.cmake",
|
||||
"llvm-vs-code-extensions.vscode-clangd"
|
||||
]
|
||||
}
|
||||
},
|
||||
// in case you want to push/pull from remote repositories using ssh
|
||||
"mounts": [
|
||||
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
|
||||
"source=${localEnv:HOME}/.gitconfig,target=/home/vscode/.gitconfig,type=bind,consistency=cached"
|
||||
]
|
||||
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "devcontainer"
|
||||
}
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -232,4 +232,5 @@ m4/lt~obsolete.m4
|
||||
|
||||
.vscode
|
||||
.cache
|
||||
.build
|
||||
.build
|
||||
build
|
||||
127
build/Makefile
127
build/Makefile
@ -1,127 +0,0 @@
|
||||
# $Id: Makefile 4077 2010-02-18 04:05:37Z charlton $
|
||||
|
||||
#
|
||||
# To run step by step
|
||||
# 1. make source
|
||||
# 2. make script
|
||||
# 3. make build_all
|
||||
# and step 3 may be broken using the following
|
||||
# 3a. make prep
|
||||
# 3b. make conf
|
||||
# 3c. make build
|
||||
# 3d. make install
|
||||
# 3e. make pkg
|
||||
# 3f. make spkg
|
||||
# 3g. make finish
|
||||
#
|
||||
|
||||
NAME := IPhreeqc
|
||||
|
||||
FORCE_UPDATE := $(shell svn up ..)
|
||||
|
||||
RELEASE ?= $(shell svn st -v dist.sh | cut -b 10- | ( read one two ; echo $$one ) )
|
||||
|
||||
ifneq ($(strip $(DATE)),)
|
||||
DATE_STAMP := $(shell date -d $(DATE) "+%m-%d-%Y")
|
||||
TOUCH_STAMP := $(shell date -d $(DATE) "+%Y%m%d0000")
|
||||
endif
|
||||
|
||||
TARBALL := $(NAME)-$(VERSION)-$(RELEASE).tar.gz
|
||||
|
||||
BUILD_SCRIPT := $(NAME)-$(VERSION)-$(RELEASE).sh
|
||||
|
||||
REPOS_PATH ?= trunk
|
||||
|
||||
# (ie IPhreeqc-0.1-584-src.tar.bz2)
|
||||
SRC_PACKAGE := $(NAME)-$(VERSION)-$(RELEASE)-src.tar.bz2
|
||||
|
||||
# (ie IPhreeqc-0.1-584.tar.bz2)
|
||||
BIN_PACKAGE := $(NAME)-$(VERSION)-$(RELEASE).tar.bz2
|
||||
|
||||
all : check_args $(BIN_PACKAGE)
|
||||
echo $(VERSION) > VERSION
|
||||
|
||||
build_all : check_args $(BIN_PACKAGE)
|
||||
|
||||
prep : check_args source script
|
||||
time ./$(BUILD_SCRIPT) prep 2>&1 | tee prep-$(RELEASE).log
|
||||
|
||||
conf : check_args source script
|
||||
time ./$(BUILD_SCRIPT) conf 2>&1 | tee conf-$(RELEASE).log
|
||||
|
||||
reconf : check_args source script
|
||||
time ./$(BUILD_SCRIPT) reconf 2>&1 | tee reconf-$(RELEASE).log
|
||||
|
||||
build : check_args source script
|
||||
time ./$(BUILD_SCRIPT) build 2>&1 | tee build-$(RELEASE).log
|
||||
|
||||
install : check_args source script
|
||||
time ./$(BUILD_SCRIPT) install 2>&1 | tee install-$(RELEASE).log
|
||||
|
||||
pkg : check_args source script
|
||||
time ./$(BUILD_SCRIPT) pkg 2>&1 | tee pkg-$(RELEASE).log
|
||||
|
||||
spkg : check_args source script
|
||||
time ./$(BUILD_SCRIPT) spkg 2>&1 | tee spkg-$(RELEASE).log
|
||||
|
||||
finish : check_args source script
|
||||
time ./$(BUILD_SCRIPT) finish 2>&1 | tee finish-$(RELEASE).log
|
||||
|
||||
upto-conf : check_args source script
|
||||
time ./$(BUILD_SCRIPT) upto-conf 2>&1 | tee upto-conf-$(RELEASE).log
|
||||
|
||||
upto-build : check_args source script
|
||||
time ./$(BUILD_SCRIPT) upto-build 2>&1 | tee upto-build-$(RELEASE).log
|
||||
|
||||
upto-install : check_args source script
|
||||
time ./$(BUILD_SCRIPT) upto-install 2>&1 | tee upto-install-$(RELEASE).log
|
||||
|
||||
upto-pkg : check_args source script
|
||||
time ./$(BUILD_SCRIPT) upto-pkg 2>&1 | tee upto-pkg-$(RELEASE).log
|
||||
|
||||
upto-spkg : check_args source script
|
||||
time ./$(BUILD_SCRIPT) upto-spkg 2>&1 | tee upto-spkg-$(RELEASE).log
|
||||
|
||||
$(BIN_PACKAGE) : $(TARBALL) $(BUILD_SCRIPT)
|
||||
@echo "Building package $(BIN_PACKAGE) / $(SRC_PACKAGE)"
|
||||
time ./$(BUILD_SCRIPT) all 2>&1 | tee all-$(RELEASE).log
|
||||
|
||||
source : check_version check_date $(TARBALL)
|
||||
@echo "created $(TARBALL)"
|
||||
|
||||
$(TARBALL) : dist.sh $(DATE_STAMP).tstamp
|
||||
@echo "Creating $(TARBALL)"
|
||||
time ./dist.sh -v $(VERSION) -r $(RELEASE) -d $(DATE) -pr $(REPOS_PATH) 2>&1 | tee dist-$(RELEASE).log
|
||||
|
||||
script : check_version $(BUILD_SCRIPT)
|
||||
@echo "created $(BUILD_SCRIPT)"
|
||||
|
||||
$(BUILD_SCRIPT) : build.sh
|
||||
ln -f build.sh $(BUILD_SCRIPT)
|
||||
|
||||
$(DATE_STAMP).tstamp :
|
||||
rm -rf *.tstamp
|
||||
touch $(DATE_STAMP).tstamp
|
||||
|
||||
check_args : check_version check_date
|
||||
|
||||
check_version :
|
||||
ifeq ($(strip $(VERSION)),)
|
||||
@echo "No version specified"
|
||||
@make -s usage
|
||||
@exit 1
|
||||
endif
|
||||
|
||||
check_date :
|
||||
ifeq ($(strip $(DATE)),)
|
||||
@echo "No date specified"
|
||||
make usage
|
||||
exit 1
|
||||
endif
|
||||
|
||||
usage:
|
||||
@echo ""
|
||||
@echo "usage: make VERSION=<number> DATE=<xx/xx/xxxx> [RELEASE=<number>] [SIG=<0|1>]"
|
||||
@echo " ie make VERSION=0.1 DATE=10/24/2005"
|
||||
@echo " make VERSION=0.1 DATE=10/24/2005 RELEASE=620 SIG=1"
|
||||
@echo ""
|
||||
425
build/build.sh
425
build/build.sh
@ -1,425 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# IPhreeqc package build script
|
||||
#
|
||||
# $Id: build.sh 4133 2010-02-24 05:50:31Z charlton $
|
||||
#
|
||||
# Package maintainers: if the original source is not distributed as a
|
||||
# (possibly compressed) tarball, set the value of ${src_orig_pkg_name},
|
||||
# and redefine the unpack() helper function appropriately.
|
||||
# Also, if the Makefile rule to run the test suite is not "test", change
|
||||
# the definition of ${test_rule} below.
|
||||
|
||||
# echo everything
|
||||
set -x
|
||||
|
||||
# find out where the build script is located
|
||||
tdir=`echo "$0" | sed 's%[\\/][^\\/][^\\/]*$%%'`
|
||||
test "x$tdir" = "x$0" && tdir=.
|
||||
scriptdir=`cd $tdir; pwd`
|
||||
# find src directory.
|
||||
# If scriptdir ends in SPECS, then topdir is $scriptdir/..
|
||||
# If scriptdir ends in CYGWIN-PATCHES, then topdir is $scriptdir/../..
|
||||
# Otherwise, we assume that topdir = scriptdir
|
||||
topdir1=`echo ${scriptdir} | sed 's%/SPECS$%%'`
|
||||
topdir2=`echo ${scriptdir} | sed 's%/CYGWIN-PATCHES$%%'`
|
||||
if [ "x$topdir1" != "x$scriptdir" ] ; then # SPECS
|
||||
topdir=`cd "${scriptdir}/.."; pwd`
|
||||
else
|
||||
if [ "x$topdir2" != "x$scriptdir" ] ; then # CYGWIN-PATCHES
|
||||
topdir=`cd "${scriptdir}/../.."; pwd`
|
||||
else
|
||||
topdir=`cd "${scriptdir}"; pwd`
|
||||
fi
|
||||
fi
|
||||
|
||||
tscriptname=`basename $0 .sh`
|
||||
export PKG=`echo $tscriptname | sed -e 's/\-[^\-]*\-[^\-]*$//'`
|
||||
export VER=`echo $tscriptname | sed -e "s/${PKG}\-//" -e 's/\-[^\-]*$//'`
|
||||
export REL=`echo $tscriptname | sed -e "s/${PKG}\-${VER}\-//"`
|
||||
export MAJOR=`echo $VER | sed -e 's/\.[^.]*//g'`
|
||||
export MINOR=`echo $VER | sed -e 's/[^\.]*\.//' -e 's/\.[^\.]*//'`
|
||||
export BASEPKG=${PKG}-${VER}-${REL}
|
||||
export FULLPKG=${BASEPKG}
|
||||
export DIFF_IGNORE="-x *.aps -x *.ncb -x *.opt -x *.dep -x *.mak -x *.chm"
|
||||
|
||||
# determine correct decompression option and tarball filename
|
||||
export src_orig_pkg_name=
|
||||
if [ -e "${src_orig_pkg_name}" ] ; then
|
||||
export opt_decomp=? # Make sure tar punts if unpack() is not redefined
|
||||
elif [ -e ${BASEPKG}.tar.gz ] ; then
|
||||
export opt_decomp=z
|
||||
export src_orig_pkg_name=${BASEPKG}.tar.gz
|
||||
else
|
||||
echo Cannot find original package.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export src_orig_pkg=${topdir}/${src_orig_pkg_name}
|
||||
|
||||
# determine correct names for generated files
|
||||
export src_pkg_name=${FULLPKG}-src.tar.bz2
|
||||
export src_patch_name=${FULLPKG}.patch
|
||||
export bin_pkg_name=${FULLPKG}.tar.bz2
|
||||
|
||||
export src_pkg=${topdir}/${src_pkg_name}
|
||||
export src_patch=${topdir}/${src_patch_name}
|
||||
export bin_pkg=${topdir}/${bin_pkg_name}
|
||||
export srcdir=${topdir}/${BASEPKG}
|
||||
export objdir=${srcdir}/.build
|
||||
export instdir=${srcdir}/.inst
|
||||
export srcinstdir=${srcdir}/.sinst
|
||||
export checkfile=${topdir}/${FULLPKG}.check
|
||||
|
||||
prefix=/usr
|
||||
sysconfdir=/etc
|
||||
localstatedir=/var
|
||||
if [ -z "$MY_CFLAGS" ]; then
|
||||
MY_CFLAGS="-O2"
|
||||
fi
|
||||
if [ -z "$MY_LDFLAGS" ]; then
|
||||
MY_LDFLAGS=
|
||||
fi
|
||||
|
||||
export install_docs="\
|
||||
ABOUT-NLS \
|
||||
ANNOUNCE \
|
||||
AUTHORS \
|
||||
BUG-REPORTS \
|
||||
CHANGES \
|
||||
CONTRIBUTORS \
|
||||
COPYING \
|
||||
COPYRIGHT \
|
||||
CREDITS \
|
||||
CHANGELOG \
|
||||
ChangeLog* \
|
||||
FAQ \
|
||||
HOW-TO-CONTRIBUTE \
|
||||
INSTALL \
|
||||
KNOWNBUG \
|
||||
LEGAL \
|
||||
LICENSE \
|
||||
NEWS \
|
||||
NOTES \
|
||||
PROGLIST \
|
||||
README \
|
||||
RELEASE_NOTES \
|
||||
THANKS \
|
||||
TODO \
|
||||
"
|
||||
export install_docs="`for i in ${install_docs}; do echo $i; done | sort -u`"
|
||||
export test_rule=test
|
||||
if [ -z "$SIG" ]; then
|
||||
export SIG=0 # set to 1 to turn on signing by default
|
||||
fi
|
||||
|
||||
# helper function
|
||||
# unpacks the original package source archive into ./${BASEPKG}/
|
||||
# change this if the original package was not tarred
|
||||
# or if it doesn't unpack to a correct directory
|
||||
unpack() {
|
||||
tar xv${opt_decomp}f "$1"
|
||||
}
|
||||
|
||||
mkdirs() {
|
||||
(cd "${topdir}" && \
|
||||
rm -fr "${objdir}" "${instdir}" "${srcinstdir}" && \
|
||||
mkdir -p "${objdir}" && \
|
||||
mkdir -p "${instdir}" && \
|
||||
mkdir -p "${srcinstdir}" )
|
||||
}
|
||||
prep() {
|
||||
(cd "${topdir}" && \
|
||||
unpack "${src_orig_pkg}" && \
|
||||
cd "${topdir}" && \
|
||||
if [ -f "${src_patch}" ] ; then \
|
||||
patch -p0 --binary < "${src_patch}" ;\
|
||||
fi && \
|
||||
mkdirs )
|
||||
}
|
||||
conf() {
|
||||
(cd "${objdir}" && \
|
||||
CFLAGS="${MY_CFLAGS}" LDFLAGS="${MY_LDFLAGS}" \
|
||||
# copy links to ${objdir} for building
|
||||
find "${srcdir}" -mindepth 1 -maxdepth 1 ! -name .build ! -name .inst ! -name .sinst -exec cp -al {} . \; )
|
||||
}
|
||||
reconf() {
|
||||
(cd ${topdir} && \
|
||||
rm -fr ${objdir} && \
|
||||
mkdir -p ${objdir} && \
|
||||
conf )
|
||||
}
|
||||
build() {
|
||||
(
|
||||
# build IPhreeqc.chm
|
||||
# hhc can't handle directory names that begin with a period
|
||||
cd "${topdir}" && \
|
||||
mv "${srcdir}/.build" "${srcdir}/_build" && \
|
||||
cd "${srcdir}/_build/doc" && \
|
||||
make && \
|
||||
cd "${topdir}" && \
|
||||
mv "${srcdir}/_build" "${srcdir}/.build" && \
|
||||
# build Win32 libs
|
||||
cd "${topdir}" && \
|
||||
cd "${objdir}" && \
|
||||
MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=Release /p:Platform=Win32 )
|
||||
## MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=Debug /p:Platform=Win32 && \
|
||||
## MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=ReleaseDll /p:Platform=Win32 && \
|
||||
## MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=DebugDll /p:Platform=Win32 && \
|
||||
## MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=ReleaseCLR /p:Platform=Win32 && \
|
||||
## MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=DebugCLR /p:Platform=Win32 && \
|
||||
### build x64 libs
|
||||
## cd "${topdir}" && \
|
||||
## cd "${objdir}" && \
|
||||
## MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=Release /p:Platform=x64 && \
|
||||
## MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=Debug /p:Platform=x64 && \
|
||||
## MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=ReleaseDll /p:Platform=x64 && \
|
||||
## MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=DebugDll /p:Platform=x64 && \
|
||||
## MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=ReleaseCLR /p:Platform=x64 && \
|
||||
## MsBuild.exe IPhreeqc.2005.sln /t:IPhreeqc /p:Configuration=DebugCLR /p:Platform=x64 )
|
||||
}
|
||||
check() {
|
||||
(cd ${objdir} && \
|
||||
make ${test_rule} | tee ${checkfile} 2>&1 )
|
||||
}
|
||||
clean() {
|
||||
(cd ${objdir} && \
|
||||
make clean )
|
||||
}
|
||||
install() {
|
||||
(rm -fr "${instdir}/"* && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/clr" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/doc" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/lib" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/dll" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/include" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/database" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/examples" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/examples/c" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/examples/c/advect" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/examples/com" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/examples/com/excel" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/examples/com/python" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/examples/cpp" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/examples/cpp/advect" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/examples/fortran" && \
|
||||
mkdir "${instdir}/${FULLPKG}-vs2005-win32/examples/fortran/advect" && \
|
||||
/usr/bin/install -m 755 "${objdir}/doc/IPhreeqc.chm" "${instdir}/${FULLPKG}-vs2005-win32/doc/IPhreeqc.chm" && \
|
||||
/usr/bin/install -m 755 "${objdir}/doc/phreeqc3.chm" "${instdir}/${FULLPKG}-vs2005-win32/doc/phreeqc3.chm" && \
|
||||
/usr/bin/install -m 755 "${objdir}/doc/IPhreeqc.pdf" "${instdir}/${FULLPKG}-vs2005-win32/doc/IPhreeqc.pdf" && \
|
||||
/usr/bin/install -m 755 "${objdir}/phreeqc3-doc/NOTICE.TXT" "${instdir}/${FULLPKG}-vs2005-win32/doc/NOTICE.txt" && \
|
||||
/usr/bin/install -m 755 "${objdir}/phreeqc3-doc/RELEASE.TXT" "${instdir}/${FULLPKG}-vs2005-win32/doc/RELEASE.txt" && \
|
||||
## /usr/bin/install -m 755 "${objdir}/clr/"* "${instdir}/${FULLPKG}-vs2005-win32/clr/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/lib/"* "${instdir}/${FULLPKG}-vs2005-win32/lib/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/dll/"* "${instdir}/${FULLPKG}-vs2005-win32/dll/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/src/IPhreeqc.f.inc" "${instdir}/${FULLPKG}-vs2005-win32/include/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/src/IPhreeqc.f90.inc" "${instdir}/${FULLPKG}-vs2005-win32/include/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/src/IPhreeqc.h" "${instdir}/${FULLPKG}-vs2005-win32/include/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/src/IPhreeqc.hpp" "${instdir}/${FULLPKG}-vs2005-win32/include/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/src/IPhreeqcCallbacks.h" "${instdir}/${FULLPKG}-vs2005-win32/include/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/src/Var.h" "${instdir}/${FULLPKG}-vs2005-win32/include/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/src/phreeqcpp/PHRQ_io.h" "${instdir}/${FULLPKG}-vs2005-win32/include/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/src/phreeqcpp/Keywords.h" "${instdir}/${FULLPKG}-vs2005-win32/include/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/database/"*.dat "${instdir}/${FULLPKG}-vs2005-win32/database/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/examples/c/advect/"* "${instdir}/${FULLPKG}-vs2005-win32/examples/c/advect/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/examples/com/README.txt" "${instdir}/${FULLPKG}-vs2005-win32/examples/com/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/examples/com/excel/"* "${instdir}/${FULLPKG}-vs2005-win32/examples/com/excel/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/examples/com/python/"* "${instdir}/${FULLPKG}-vs2005-win32/examples/com/python/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/examples/cpp/advect/"* "${instdir}/${FULLPKG}-vs2005-win32/examples/cpp/advect/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/examples/fortran/advect/"* "${instdir}/${FULLPKG}-vs2005-win32/examples/fortran/advect/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/database/"phreeqc.dat "${instdir}/${FULLPKG}-vs2005-win32/examples/c/advect/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/database/"phreeqc.dat "${instdir}/${FULLPKG}-vs2005-win32/examples/com/excel/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/database/"phreeqc.dat "${instdir}/${FULLPKG}-vs2005-win32/examples/com/python/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/database/"pitzer.dat "${instdir}/${FULLPKG}-vs2005-win32/examples/com/python/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/database/"wateq4f.dat "${instdir}/${FULLPKG}-vs2005-win32/examples/com/python/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/database/"phreeqc.dat "${instdir}/${FULLPKG}-vs2005-win32/examples/cpp/advect/." && \
|
||||
/usr/bin/install -m 755 "${objdir}/database/"phreeqc.dat "${instdir}/${FULLPKG}-vs2005-win32/examples/fortran/advect/." && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/doc" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/clrx64" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/libx64" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/dllx64" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/include" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/database" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/examples" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/examples/c" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/examples/c/advect" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/examples/com" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/examples/com/excel" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/examples/com/python" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/examples/cpp" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/examples/cpp/advect" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/examples/fortran" && \
|
||||
## mkdir "${instdir}/${FULLPKG}-vs2005-x64/examples/fortran/advect" && \
|
||||
## /usr/bin/install -m 755 "${objdir}/doc/IPhreeqc.chm" "${instdir}/${FULLPKG}-vs2005-x64/doc/IPhreeqc.chm" && \
|
||||
## /usr/bin/install -m 755 "${objdir}/doc/phreeqc3.chm" "${instdir}/${FULLPKG}-vs2005-x64/doc/phreeqc3.chm" && \
|
||||
## /usr/bin/install -m 755 "${objdir}/doc/IPhreeqc.pdf" "${instdir}/${FULLPKG}-vs2005-x64/doc/IPhreeqc.pdf" && \
|
||||
## /usr/bin/install -m 755 "${objdir}/phreeqc3-doc/NOTICE.TXT" "${instdir}/${FULLPKG}-vs2005-x64/doc/NOTICE.txt" && \
|
||||
## /usr/bin/install -m 755 "${objdir}/phreeqc3-doc/RELEASE.TXT" "${instdir}/${FULLPKG}-vs2005-x64/doc/RELEASE.txt" && \
|
||||
## /usr/bin/install -m 755 "${objdir}/clrx64/"* "${instdir}/${FULLPKG}-vs2005-x64/clrx64/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/libx64/"* "${instdir}/${FULLPKG}-vs2005-x64/libx64/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/dllx64/"* "${instdir}/${FULLPKG}-vs2005-x64/dllx64/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/src/IPhreeqc.f.inc" "${instdir}/${FULLPKG}-vs2005-x64/include/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/src/IPhreeqc.f90.inc" "${instdir}/${FULLPKG}-vs2005-x64/include/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/src/IPhreeqc.h" "${instdir}/${FULLPKG}-vs2005-x64/include/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/src/IPhreeqc.hpp" "${instdir}/${FULLPKG}-vs2005-x64/include/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/src/IPhreeqcCallbacks.h" "${instdir}/${FULLPKG}-vs2005-x64/include/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/src/Var.h" "${instdir}/${FULLPKG}-vs2005-x64/include/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/src/phreeqcpp/PHRQ_io.h" "${instdir}/${FULLPKG}-vs2005-x64/include/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/src/phreeqcpp/Keywords.h" "${instdir}/${FULLPKG}-vs2005-x64/include/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/database/"*.dat "${instdir}/${FULLPKG}-vs2005-x64/database/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/examples/c/advect/"* "${instdir}/${FULLPKG}-vs2005-x64/examples/c/advect/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/examples/com/README.txt" "${instdir}/${FULLPKG}-vs2005-x64/examples/com/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/examples/com/excel/"* "${instdir}/${FULLPKG}-vs2005-x64/examples/com/excel/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/examples/com/python/"* "${instdir}/${FULLPKG}-vs2005-x64/examples/com/python/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/examples/cpp/advect/"* "${instdir}/${FULLPKG}-vs2005-x64/examples/cpp/advect/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/examples/fortran/advect/"* "${instdir}/${FULLPKG}-vs2005-x64/examples/fortran/advect/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/database/"phreeqc.dat "${instdir}/${FULLPKG}-vs2005-x64/examples/c/advect/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/database/"phreeqc.dat "${instdir}/${FULLPKG}-vs2005-x64/examples/com/excel/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/database/"phreeqc.dat "${instdir}/${FULLPKG}-vs2005-x64/examples/com/python/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/database/"pitzer.dat "${instdir}/${FULLPKG}-vs2005-x64/examples/com/python/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/database/"wateq4f.dat "${instdir}/${FULLPKG}-vs2005-x64/examples/com/python/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/database/"phreeqc.dat "${instdir}/${FULLPKG}-vs2005-x64/examples/cpp/advect/." && \
|
||||
## /usr/bin/install -m 755 "${objdir}/database/"phreeqc.dat "${instdir}/${FULLPKG}-vs2005-x64/examples/fortran/advect/." && \
|
||||
cd "${instdir}" && \
|
||||
## zip -r ${FULLPKG}-vs2005-win32.zip ${FULLPKG}-vs2005-win32 && \
|
||||
## zip -r ${FULLPKG}-vs2005-x64.zip ${FULLPKG}-vs2005-x64 && \
|
||||
## 7z a -r ${FULLPKG}-vs2005-win32.7z ${FULLPKG}-vs2005-win32 && \
|
||||
## 7z a -r ${FULLPKG}-vs2005-x64.7z ${FULLPKG}-vs2005-x64 && \
|
||||
rm -fr ${FULLPKG}-vs2005-win32 )
|
||||
## rm -fr ${FULLPKG}-vs2005-x64 )
|
||||
}
|
||||
strip() {
|
||||
(cd "${instdir}" && \
|
||||
echo 'SKIPPING find . -name "*.dll" -or -name "*.exe" | xargs strip 2>&1' ; \
|
||||
true )
|
||||
}
|
||||
list() {
|
||||
(cd ${instdir} && \
|
||||
find . -name "*" ! -type d | sed 's%^\.% %' ; \
|
||||
true )
|
||||
}
|
||||
depend() {
|
||||
(cd ${instdir} && \
|
||||
find ${instdir} -name "*.exe" -o -name "*.dll" | xargs cygcheck | \
|
||||
sed -e '/\.exe/d' -e 's,\\,/,g' | sort -bu | xargs -n1 cygpath -u \
|
||||
| xargs cygcheck -f | sed 's%^% %' | sort -u ; \
|
||||
true )
|
||||
}
|
||||
pkg() {
|
||||
(cd "${instdir}" && \
|
||||
tar cvjf "${bin_pkg}" * )
|
||||
}
|
||||
mkpatch() {
|
||||
(cd "${srcdir}" && \
|
||||
find . -name "autom4te.cache" | xargs rm -rf ; \
|
||||
unpack "${src_orig_pkg}" && \
|
||||
cd "${srcdir}" && \
|
||||
mv "${BASEPKG}" ../${BASEPKG}-orig && \
|
||||
cd "${topdir}" && \
|
||||
diff -urN -x '.build' -x '.inst' -x '.sinst' \
|
||||
${DIFF_IGNORE} \
|
||||
${BASEPKG}-orig ${BASEPKG} > \
|
||||
${srcinstdir}/${src_patch_name} ; \
|
||||
rm -rf ${BASEPKG}-orig )
|
||||
}
|
||||
# Note: maintainer-only functionality
|
||||
acceptpatch() {
|
||||
cp --backup=numbered ${srcinstdir}/${src_patch_name} ${topdir}
|
||||
}
|
||||
spkg() {
|
||||
(mkpatch && \
|
||||
if [ "${SIG}" -eq 1 ] ; then \
|
||||
name=${srcinstdir}/${src_patch_name} text="PATCH" sigfile ; \
|
||||
fi && \
|
||||
cp "${src_orig_pkg}" "${srcinstdir}/${src_orig_pkg_name}" && \
|
||||
if [ "${SIG}" -eq 1 ] ; then \
|
||||
name=${src_orig_pkg} text="ORIG_PKG" sigfile ; \
|
||||
fi && \
|
||||
cp dist.sh "${srcinstdir}/" && \
|
||||
cp Makefile "${srcinstdir}/" && \
|
||||
if [ -e ${src_orig_pkg}.sig ] ; then \
|
||||
cp ${src_orig_pkg}.sig ${srcinstdir}/ ; \
|
||||
fi && \
|
||||
cp $0 "${srcinstdir}/`basename $0`" && \
|
||||
name=$0 text="SCRIPT" sigfile && \
|
||||
if [ "${SIG}" -eq 1 ] ; then \
|
||||
cp $0.sig "${srcinstdir}/" ; \
|
||||
fi && \
|
||||
cd "${srcinstdir}" && \
|
||||
tar cvjf "${src_pkg}" * )
|
||||
}
|
||||
finish() {
|
||||
rm -rf `echo $phast_ser | sed "s^/.*^^"` && \
|
||||
rm -rf "${srcdir}"
|
||||
}
|
||||
sigfile() {
|
||||
if [ \( "${SIG}" -eq 1 \) -a \( -e $name \) -a \( \( ! -e $name.sig \) -o \( $name -nt $name.sig \) \) ]; then \
|
||||
if [ -x /usr/bin/gpg ]; then \
|
||||
echo "$text signature need to be updated"; \
|
||||
rm -f $name.sig; \
|
||||
/usr/bin/gpg --detach-sign $name; \
|
||||
else \
|
||||
echo "You need the gnupg package installed in order to make signatures."; \
|
||||
fi; \
|
||||
fi
|
||||
}
|
||||
checksig() {
|
||||
if [ -x /usr/bin/gpg ]; then \
|
||||
if [ -e ${src_orig_pkg}.sig ]; then \
|
||||
echo "ORIGINAL PACKAGE signature follows:"; \
|
||||
/usr/bin/gpg --verify ${src_orig_pkg}.sig ${src_orig_pkg}; \
|
||||
else \
|
||||
echo "ORIGINAL PACKAGE signature missing."; \
|
||||
fi; \
|
||||
if [ -e $0.sig ]; then \
|
||||
echo "SCRIPT signature follows:"; \
|
||||
/usr/bin/gpg --verify $0.sig $0; \
|
||||
else \
|
||||
echo "SCRIPT signature missing."; \
|
||||
fi; \
|
||||
if [ -e ${src_patch}.sig ]; then \
|
||||
echo "PATCH signature follows:"; \
|
||||
/usr/bin/gpg --verify ${src_patch}.sig ${src_patch}; \
|
||||
else \
|
||||
echo "PATCH signature missing."; \
|
||||
fi; \
|
||||
else
|
||||
echo "You need the gnupg package installed in order to check signatures." ; \
|
||||
fi
|
||||
}
|
||||
while test -n "$1" ; do
|
||||
case $1 in
|
||||
prep) prep ; STATUS=$? ;;
|
||||
mkdirs) mkdirs ; STATUS=$? ;;
|
||||
conf) conf ; STATUS=$? ;;
|
||||
configure) conf ; STATUS=$? ;;
|
||||
reconf) reconf ; STATUS=$? ;;
|
||||
build) build ; STATUS=$? ;;
|
||||
make) build ; STATUS=$? ;;
|
||||
check) check ; STATUS=$? ;;
|
||||
test) check ; STATUS=$? ;;
|
||||
clean) clean ; STATUS=$? ;;
|
||||
install) install ; STATUS=$? ;;
|
||||
list) list ; STATUS=$? ;;
|
||||
depend) depend ; STATUS=$? ;;
|
||||
strip) strip ; STATUS=$? ;;
|
||||
package) pkg ; STATUS=$? ;;
|
||||
pkg) pkg ; STATUS=$? ;;
|
||||
mkpatch) mkpatch ; STATUS=$? ;;
|
||||
acceptpatch) acceptpatch ; STATUS=$? ;;
|
||||
src-package) spkg ; STATUS=$? ;;
|
||||
spkg) spkg ; STATUS=$? ;;
|
||||
finish) finish ; STATUS=$? ;;
|
||||
checksig) checksig ; STATUS=$? ;;
|
||||
first) mkdirs && spkg && finish ; STATUS=$? ;;
|
||||
all) checksig && prep && conf && build && install && \
|
||||
strip && pkg && spkg && finish ; \
|
||||
STATUS=$? ;;
|
||||
*) echo "Error: bad arguments" ; exit 1 ;;
|
||||
esac
|
||||
( exit ${STATUS} ) || exit ${STATUS}
|
||||
shift
|
||||
done
|
||||
|
||||
290
build/dist.sh
290
build/dist.sh
@ -1,290 +0,0 @@
|
||||
#!/bin/sh
|
||||
# $Id: dist.sh 4132 2010-02-24 05:35:35Z charlton $
|
||||
|
||||
#
|
||||
# USAGE: ./dist.sh -v VERSION -r REVISION -d RELEASE_DATE
|
||||
# [-rs REVISION-SVN] [-pr REPOS-PATH]
|
||||
# [-zip] [-alpha ALPHA_NUM|-beta BETA_NUM|-rc RC_NUM]
|
||||
#
|
||||
# Create a distribution tarball, labelling it with the given VERSION.
|
||||
# The REVISION or REVISION-SVN will be used in the version string.
|
||||
# The tarball will be constructed from the root located at REPOS-PATH.
|
||||
# If REPOS-PATH is not specified then the default is "branches/VERSION".
|
||||
# For example, the command line:
|
||||
#
|
||||
# ./dist.sh -v 0.24.2 -r 6284
|
||||
#
|
||||
# from the top-level of a branches/0.24.2 working copy will create
|
||||
# the 0.24.2 release tarball.
|
||||
#
|
||||
# When building a alpha, beta or rc tarballs pass the apppropriate flag
|
||||
# followed by the number for that release. For example you'd do
|
||||
# the following for a Beta 1 release:
|
||||
# ./dist.sh -v 1.1.0 -r 10277 -pr branches/1.1.x -beta 1
|
||||
#
|
||||
# If neither an -alpha, -beta or -rc option with a number is
|
||||
# specified, it will build a release tarball.
|
||||
#
|
||||
# To build a Windows zip file package pass -zip.
|
||||
|
||||
# echo everything
|
||||
set -x
|
||||
|
||||
# A quick and dirty usage message
|
||||
USAGE="USAGE: ./dist.sh -v VERSION -r REVISION -d RELEASE_DATE \
|
||||
[-rs REVISION-SVN ] [-pr REPOS-PATH] \
|
||||
[-alpha ALPHA_NUM|-beta BETA_NUM|-rc RC_NUM] \
|
||||
[-zip]
|
||||
EXAMPLES: ./dist.sh -v 0.36.0 -r 8278 -d 2/7/05
|
||||
./dist.sh -v 0.36.0 -r 8278 -d 2/7/05 -pr trunk
|
||||
./dist.sh -v 0.36.0 -r 8282 -d 2/7/05 -rs 8278 -pr tags/0.36.0
|
||||
./dist.sh -v 0.36.0 -r 8282 -d 2/7/05 -rs 8278 -pr tags/0.36.0 -alpha
|
||||
./dist.sh -v 0.36.0 -r 8282 -d 2/7/05 -rs 8278 -pr tags/0.36.0 -beta 1"
|
||||
|
||||
|
||||
|
||||
|
||||
# Let's check and set all the arguments
|
||||
ARG_PREV=""
|
||||
|
||||
for ARG in $@
|
||||
do
|
||||
if [ "$ARG_PREV" ]; then
|
||||
|
||||
case $ARG_PREV in
|
||||
-v) VERSION="$ARG" ;;
|
||||
-r) REVISION="$ARG" ;;
|
||||
-rs) REVISION_SVN="$ARG" ;;
|
||||
-pr) REPOS_PATH="$ARG" ;;
|
||||
-rc) RC="$ARG" ;;
|
||||
-beta) BETA="$ARG" ;;
|
||||
-alpha) ALPHA="$ARG" ;;
|
||||
-d) RDATE="$ARG" ;;
|
||||
*) ARG_PREV=$ARG ;;
|
||||
esac
|
||||
|
||||
ARG_PREV=""
|
||||
|
||||
else
|
||||
|
||||
case $ARG in
|
||||
-v|-r|-rs|-pr|-beta|-rc|-alpha|-d)
|
||||
ARG_PREV=$ARG
|
||||
;;
|
||||
-zip)
|
||||
ZIP=1
|
||||
ARG_PREV=""
|
||||
;;
|
||||
*)
|
||||
echo " $USAGE"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$REVISION_SVN" ]; then
|
||||
REVISION_SVN=$REVISION
|
||||
fi
|
||||
|
||||
if [ -n "$ALPHA" ] && [ -n "$BETA" ] ||
|
||||
[ -n "$ALPHA" ] && [ -n "$RC" ] ||
|
||||
[ -n "$BETA" ] && [ -n "$RC" ] ; then
|
||||
echo " $USAGE"
|
||||
exit 1
|
||||
elif [ -n "$ALPHA" ] ; then
|
||||
VER_TAG="Alpha $ALPHA"
|
||||
VER_NUMTAG="-alpha$ALPHA"
|
||||
elif [ -n "$BETA" ] ; then
|
||||
VER_TAG="Beta $BETA"
|
||||
VER_NUMTAG="-beta$BETA"
|
||||
elif [ -n "$RC" ] ; then
|
||||
VER_TAG="Release Candidate $RC"
|
||||
VER_NUMTAG="-rc$RC"
|
||||
else
|
||||
VER_TAG="r$REVISION_SVN"
|
||||
VER_NUMTAG="-$REVISION"
|
||||
fi
|
||||
|
||||
if [ -n "$ZIP" ] ; then
|
||||
EXTRA_EXPORT_OPTIONS="--native-eol CRLF"
|
||||
fi
|
||||
|
||||
if [ -z "$VERSION" ] || [ -z "$REVISION" ] || [ -z "$RDATE" ]; then
|
||||
echo " $USAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VER="$VERSION"
|
||||
REL="$REVISION"
|
||||
LOWER='abcdefghijklmnopqrstuvwxyz'
|
||||
UPPER='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
VER_UC=`echo $VER | sed -e "y/$LOWER/$UPPER/"`
|
||||
|
||||
RELEASE_DATE="`date -d "$RDATE" "+%B %e, %G"`"
|
||||
V_FIXDATE="`date -d "$RDATE" "+%d-%b-%G"`"
|
||||
|
||||
if [ -z "$REPOS_PATH" ]; then
|
||||
REPOS_PATH="branches/$VERSION"
|
||||
else
|
||||
REPOS_PATH="`echo $REPOS_PATH | sed 's/^\/*//'`"
|
||||
fi
|
||||
|
||||
DISTNAME="IPhreeqc-${VERSION}${VER_NUMTAG}"
|
||||
DIST_SANDBOX=.dist_sandbox
|
||||
DISTPATH="$DIST_SANDBOX/$DISTNAME"
|
||||
|
||||
echo "Distribution will be named: $DISTNAME"
|
||||
echo " release branch's revision: $REVISION"
|
||||
echo " executable's revision: $REVISION_SVN"
|
||||
echo " constructed from path: /$REPOS_PATH"
|
||||
echo " release date: $RELEASE_DATE"
|
||||
|
||||
rm -rf "$DIST_SANDBOX"
|
||||
mkdir "$DIST_SANDBOX"
|
||||
echo "Removed and recreated $DIST_SANDBOX"
|
||||
|
||||
echo "Exporting revision $REVISION of IPhreeqc into sandbox..."
|
||||
(cd "$DIST_SANDBOX" && \
|
||||
${SVN:-svn} export -q $EXTRA_EXPORT_OPTIONS --ignore-externals -r "$REVISION" \
|
||||
"http://internalbrr.cr.usgs.gov/svn_GW/IPhreeqc/$REPOS_PATH" \
|
||||
"$DISTNAME")
|
||||
if [ $? != 0 ] ; then
|
||||
echo "svn checkout error"
|
||||
exit $?;
|
||||
fi
|
||||
|
||||
(cd "$DIST_SANDBOX" && \
|
||||
${SVN:-svn} export -q $EXTRA_EXPORT_OPTIONS --ignore-externals -r "$REVISION" \
|
||||
"http://internalbrr.cr.usgs.gov/svn_GW/phreeqc3/$REPOS_PATH/src" \
|
||||
"$DISTNAME/src/phreeqcpp")
|
||||
if [ $? != 0 ] ; then
|
||||
echo "svn checkout error"
|
||||
exit $?;
|
||||
fi
|
||||
|
||||
(cd "$DIST_SANDBOX" && \
|
||||
${SVN:-svn} export -q $EXTRA_EXPORT_OPTIONS --ignore-externals -r "$REVISION" \
|
||||
"http://internalbrr.cr.usgs.gov/svn_GW/phreeqc3/$REPOS_PATH/doc" \
|
||||
"$DISTNAME/phreeqc3-doc")
|
||||
if [ $? != 0 ] ; then
|
||||
echo "svn checkout error"
|
||||
exit $?;
|
||||
fi
|
||||
|
||||
(cd "$DIST_SANDBOX" && \
|
||||
${SVN:-svn} export -q $EXTRA_EXPORT_OPTIONS --ignore-externals -r "$REVISION" \
|
||||
"http://internalbrr.cr.usgs.gov/svn_GW/phreeqc3/$REPOS_PATH/database" \
|
||||
"$DISTNAME/database")
|
||||
if [ $? != 0 ] ; then
|
||||
echo "svn checkout error"
|
||||
exit $?;
|
||||
fi
|
||||
|
||||
(cd "$DIST_SANDBOX" && \
|
||||
${SVN:-svn} export -q $EXTRA_EXPORT_OPTIONS --ignore-externals -r "$REVISION" \
|
||||
"http://internalbrr.cr.usgs.gov/svn_GW/phreeqc/trunk/COMManuscript/C&Gfinal/examples/c" \
|
||||
"$DISTNAME/examples/c")
|
||||
if [ $? != 0 ] ; then
|
||||
echo "svn checkout error"
|
||||
exit $?;
|
||||
fi
|
||||
|
||||
(cd "$DIST_SANDBOX" && \
|
||||
${SVN:-svn} export -q $EXTRA_EXPORT_OPTIONS --ignore-externals -r "$REVISION" \
|
||||
"http://internalbrr.cr.usgs.gov/svn_GW/phreeqc/trunk/COMManuscript/C&Gfinal/examples/com" \
|
||||
"$DISTNAME/examples/com")
|
||||
if [ $? != 0 ] ; then
|
||||
echo "svn checkout error"
|
||||
exit $?;
|
||||
fi
|
||||
|
||||
(cd "$DIST_SANDBOX" && \
|
||||
${SVN:-svn} export -q $EXTRA_EXPORT_OPTIONS --ignore-externals -r "$REVISION" \
|
||||
"http://internalbrr.cr.usgs.gov/svn_GW/phreeqc/trunk/COMManuscript/C&Gfinal/examples/fortran" \
|
||||
"$DISTNAME/examples/fortran")
|
||||
if [ $? != 0 ] ; then
|
||||
echo "svn checkout error"
|
||||
exit $?;
|
||||
fi
|
||||
|
||||
(cd "$DIST_SANDBOX" && \
|
||||
${SVN:-svn} export -q $EXTRA_EXPORT_OPTIONS --ignore-externals -r "$REVISION" \
|
||||
"http://internalbrr.cr.usgs.gov/svn_GW/phreeqc3/trunk/HTMLversion/phreeqc3.chm" \
|
||||
"$DISTNAME/doc")
|
||||
if [ $? != 0 ] ; then
|
||||
echo "svn checkout error"
|
||||
exit $?;
|
||||
fi
|
||||
|
||||
|
||||
|
||||
ver_major=`echo $VERSION | cut -d '.' -f 1`
|
||||
ver_minor=`echo $VERSION | cut -d '.' -f 2`
|
||||
ver_patch=`echo $VERSION | cut -d '.' -f 3`
|
||||
|
||||
if [ -z "$ver_patch" ]; then
|
||||
ver_patch="0"
|
||||
fi
|
||||
|
||||
SED_FILES="$DISTPATH/phreeqc3-doc/RELEASE.TXT \
|
||||
$DISTPATH/src/Version.h \
|
||||
$DISTPATH/src/IPhreeqc.h"
|
||||
|
||||
for vsn_file in $SED_FILES
|
||||
do
|
||||
sed \
|
||||
-e "/#define *VER_MAJOR/s/[0-9]\+/$ver_major/" \
|
||||
-e "/#define *VER_MINOR/s/[0-9]\+/$ver_minor/" \
|
||||
-e "/#define *VER_PATCH/s/[0-9]\+/$ver_patch/" \
|
||||
-e "/#define *VER_REVISION/s/[0-9]\+/$REVISION_SVN/" \
|
||||
-e "s/@RELEASE_DATE@/$RELEASE_DATE/g" \
|
||||
-e "s/@PHREEQC_VER@/$VER/g" \
|
||||
-e "s/@PHREEQC_DATE@/$RELEASE_DATE/g" \
|
||||
-e "s/@REVISION_SVN@/$REVISION_SVN/g" \
|
||||
< "$vsn_file" > "$vsn_file.tmp"
|
||||
unix2dos "$vsn_file.tmp" 2> /dev/null
|
||||
mv -f "$vsn_file.tmp" "$vsn_file"
|
||||
cp "$vsn_file" "$vsn_file.dist"
|
||||
done
|
||||
|
||||
|
||||
if [ -z "$ZIP" ]; then
|
||||
echo "Rolling $DISTNAME.tar ..."
|
||||
(cd "$DIST_SANDBOX" > /dev/null && tar c "$DISTNAME") > \
|
||||
"$DISTNAME.tar"
|
||||
echo "Compressing to $DISTNAME.tar.gz ..."
|
||||
gzip -9f "$DISTNAME.tar"
|
||||
else
|
||||
echo "Rolling $DISTNAME.zip ..."
|
||||
(cd "$DIST_SANDBOX" > /dev/null && zip -q -r - "$DISTNAME") > \
|
||||
"$DISTNAME.zip"
|
||||
fi
|
||||
echo "Removing sandbox..."
|
||||
rm -rf "$DIST_SANDBOX"
|
||||
|
||||
echo ""
|
||||
echo "Done:"
|
||||
if [ -z "$ZIP" ]; then
|
||||
ls -l "$DISTNAME.tar.gz"
|
||||
echo ""
|
||||
echo "md5sums:"
|
||||
md5sum "$DISTNAME.tar.gz"
|
||||
type sha1sum > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo ""
|
||||
echo "sha1sums:"
|
||||
sha1sum "$DISTNAME.tar.gz"
|
||||
fi
|
||||
else
|
||||
ls -l "$DISTNAME.zip"
|
||||
echo ""
|
||||
echo "md5sum:"
|
||||
md5sum "$DISTNAME.zip"
|
||||
type sha1sum > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo ""
|
||||
echo "sha1sum:"
|
||||
sha1sum "$DISTNAME.zip"
|
||||
fi
|
||||
fi
|
||||
Loading…
x
Reference in New Issue
Block a user