Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 109 lines (87 sloc) 3.901 kB
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
1 # -*- makefile -*-
c06cab4 More renaming, this time of packaging. Not sure if I've got it 100% …
Michael Bridgen authored
2 # This is a makefile that builds Streams into a directory structure
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
3 # that makes installation and packaging easier.
4
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
5 # for brace expansion
6 SHELL=bash
7
8 # use the date/time of the latest hg log as the version number. Additional
9 # tweak: if the repo is stale (outgoing or uncommited changes) or not
10 # 'default', give it the magic revision number 666.
11 CURRENT_BRANCH:=$(shell hg branch)
12 BRANCH_SPEC:=$(shell [ "${CURRENT_BRANCH}" != "default" ] && echo "${CURRENT_BRANCH}.")
13 STALE:=$(shell (hg outgoing | grep -q '^no changes found$$' && \
14 test -z "$$(hg diff; hg status -d)") || echo "stale.")
15 FUNNY:=${BRANCH_SPEC}${STALE}
16 STREAMS_VERSION:=${FUNNY}$(shell hg log -b "$(CURRENT_BRANCH)" -l1 --template '{date|isodate}\n' | \
17 cut -d' ' -f1-2 | sed 's/[:-]//g' | sed 's/[^0-9]/./g')
18 PACKAGE:=rabbitmq-streams-${STREAMS_VERSION}
19 TMP_DIR:=packaging/tmp
20 TARGET_DIR:=${PACKAGE}
21 PACKAGE_FILE:=${CURDIR}/${TMP_DIR}/${PACKAGE}.tar.gz
22
23 LIB_TARGET_DIR:=${TMP_DIR}/lib
24 SBIN_TARGET_DIR:=${TMP_DIR}/sbin
25 INSTALL_CONFIG_DIR:=${TMP_DIR}/config
26 PLUGIN_TARGET_DIR:=${TMP_DIR}/plugins
27 INSTALL_INC_DIR:=${TMP_DIR}/include
28
29 # NB: THE SPEC FILE CALLS BACK THIS MAKEFILE!!!
30 all: package-sources
31 ${MAKE} PACKAGE_FILE="${PACKAGE_FILE}" STREAMS_VERSION="${STREAMS_VERSION}" FUNNY="${FUNNY}" \
32 -C packaging/RPMS/Fedora clean rpms
33
5497ada @aschmolck rm -rf yet another try
aschmolck authored
34
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
35 package-sources:
36 mkdir -p ${TMP_DIR}
e42e06e @aschmolck D'oh it was actually @test test-line after the rm -rf!
aschmolck authored
37 rm -rf -- ${TMP_DIR}/*
1fd0b01 @aschmolck More small rpm install fixes
aschmolck authored
38 @test -z "${FUNNY}" || \
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
39 (read -p "The repo is funny (${FUNNY}), do you really want to continue? (yes/No)? " ans; \
40 [ "$${ans}" = yes ] || (echo "ABORTING!"; exit 1))
41 hg clone -r $(CURRENT_BRANCH) . ${TMP_DIR}/${PACKAGE}
42 (cd ${TMP_DIR}; tar zcf ${PACKAGE_FILE} ${PACKAGE} \
43 --exclude='*.tar.gz' --exclude='.hg*' --exclude=.svn)
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
44
45 clean:
1fd0b01 @aschmolck More small rpm install fixes
aschmolck authored
46 rm -rf -- ${TARGET_DIR} ${TMP_DIR} ${PACKAGE_FILE}
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
47
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
48 prepare: prepare-build-dirs prepare-install-dirs
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
49
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
50 prepare-build-dirs:
51 mkdir -p ${TARGET_DIR}/config
52 mkdir -p ${TARGET_DIR}/examples
53 mkdir -p ${TARGET_DIR}/harness/{java,python}
54 mkdir -p ${TARGET_DIR}/lib/{erlang/orchestrator,java,python}
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
55
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
56 prepare-install-dirs:
57 mkdir -p ${LIB_TARGET_DIR}/{scripts,harness}
58 mkdir -p ${SBIN_TARGET_DIR}
59 mkdir -p ${INSTALL_CONFIG_DIR}
60 mkdir -p ${PLUGIN_TARGET_DIR}
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
61
62
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
63 build: build-libs build-orchestrator build-plugins build-other
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
64
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
65 build-libs: prepare
66 cp -rpf harness/python/lib/* ${TARGET_DIR}/lib/python
67 cp -p harness/java/plugin/target/plugin-1.0-SNAPSHOT.jar \
68 ${TARGET_DIR}/harness/java/feedshub_harness.jar
69 cp -p harness/java/run_plugin.sh ${TARGET_DIR}/harness/java
70 #FIXME there is some duplication here
71 cp -pr harness/python/* ${TARGET_DIR}/harness/python
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
72
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
73 ### Build erlang libraries ###
74 build-orchestrator: build-libs
1fd0b01 @aschmolck More small rpm install fixes
aschmolck authored
75 cp -rp orchestrator/{ebin,include,priv,scripts} ${TARGET_DIR}/lib/erlang/orchestrator
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
76 cp -rpL orchestrator/deps/ ${TARGET_DIR}/lib/erlang/orchestrator
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
77
78 #### Package everything else ####
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
79 # python dirs get copied whole, for everything else we just copy plugin.js and
80 # lib FIXME: we should seperate out src and target directories or have some
81 # other convention that would allow us to automatically copy just the right
82 # stuff, irrespective of language. Also, packaging tests as well would be
83 # better.
84 build-plugins:
85 for p in plugins/*/; do \
86 mkdir -p ${TARGET_DIR}/$$p; \
87 if [ -n "`find \"$$p\" -regex '.*.py'`" ]; then \
88 cp -rf $$p ${TARGET_DIR}/plugins; \
89 else \
90 cp -p $$p/plugin.js ${TARGET_DIR}/$$p; \
91 cp -prf $$p/lib ${TARGET_DIR}/$$p; \
92 fi; \
6455556 Copy plugins
Tim Clark authored
93 done
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
94
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
95 build-other:
96 cp -prf {examples,sbin} ${TARGET_DIR}
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
97
98
8f71006 @aschmolck Merge bug21474; its still not 100% finished but shouldn't conflict.
aschmolck authored
99 install: prepare build
100 cp -prf ${TARGET_DIR}/lib/* ${LIB_TARGET_DIR}
101 cp -prf ${TARGET_DIR}/plugins/* ${PLUGIN_TARGET_DIR}
102 cp -prf ${TARGET_DIR}/sbin/* ${LIB_TARGET_DIR}/scripts
103 cp -prf ${TARGET_DIR}/examples ${LIB_TARGET_DIR}
104 cp -prf ${TARGET_DIR}/harness ${LIB_TARGET_DIR}
50a14ec @aschmolck Fixed and cleaned up streams-server/streamsctl a bit and now link, ra…
aschmolck authored
105 cd ${LIB_TARGET_DIR}/erlang; ln -s ../harness; ln -s ../plugins;
106
9777caf Initial install makefile for use by rpm packaging process
Tim Clark authored
107
108
Something went wrong with that request. Please try again.