distil/Makefile
Aurynn Shaw bf671c0210 Moves the artifice web API into the artifice package. Updates the build
system to create a working .deb, based on the makefile.
Adds a new script to start up the web daemon.
Adds a new script to test if the database is provisioned
Adds a new script used by Puppet to provision the database
Adds puppet manifests (mirrored in main puppet)
Moves api/ to artifice/api
Alters some of the relative imports
Moves artifice.py to why_is_this_called_artifice.py, as it was causing
import issues.

Change-Id: Id8a909f7ffcc64a5c4e3281c6b5ba83cef73b596
2014-04-01 16:08:49 +13:00

55 lines
1.3 KiB
Makefile

VERSION=0.1
NAME=openstack-artifice
INSTALL_PATH=/opt/stack/artifice
BILLING_PROGRAM=bill.py
BINARY_PATH=/usr/local/bin
WORK_DIR=./work
CONF_DIR=${WORK_DIR}/${INSTALL_PATH}/etc/artifice
clean:
@rm -rf ./work
@rm -f *.deb
init:
@mkdir ./work/
@mkdir -p ./work${INSTALL_PATH}
@mkdir -p ./work${BINARY_PATH}
deb: clean init
@cp -r ./artifice \
./scripts \
./README.md \
./INVOICES.md \
requirements.txt \
setup.py \
${WORK_DIR}${INSTALL_PATH}
@mkdir ${WORK_DIR}${INSTALL_PATH}/bin
@cp ./bin/collect ./bin/collect.py \
./bin/usage ./bin/usage.py \
./bin/web ./bin/web.py \
${WORK_DIR}${INSTALL_PATH}/bin
@chmod 0755 ${WORK_DIR}${INSTALL_PATH}/bin/web
@cp -r ./packaging/fs/* ${WORK_DIR}/
@mkdir -p ${CONF_DIR}
@mkdir -p ${WORK_DIR}/etc/init.d
@mkdir -p ${WORK_DIR}/etc/artifice
@chmod +x ${WORK_DIR}/etc/init.d/artifice
@cp ./examples/conf.yaml ${WORK_DIR}/etc/artifice/conf.yaml
@cp ./examples/csv_rates.yaml ${WORK_DIR}/etc/artifice/csv_rates.yaml
@fpm -s dir -t deb -n ${NAME} -v ${VERSION} \
--post-install=packaging/scripts/post_install.sh \
--depends 'libpq-dev' \
--deb-pre-depends "libmysql++-dev" \
--deb-pre-depends python2.7 \
--deb-pre-depends python-pip \
--deb-pre-depends python-dev \
--deb-pre-depends python-virtualenv \
--template-scripts \
--template-value install_path=${INSTALL_PATH} \
-C ${WORK_DIR} \
.