-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
77 lines (63 loc) · 2.66 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
## Usage:
##
## To build the current upstream version (as defined in WF_CURRENT_VERSION):
##
## make
##
## To build a specific version:
##
## make version=8.0.0.Final
##
## Requires:
##
## debhelper and devscripts packages
##
WF_CURRENT_VERSION = 18.0.1.Final
WF_VERSION := $(or $(version),$(WF_VERSION),$(WF_CURRENT_VERSION))
WF_TARBALL = wildfly-$(WF_VERSION).tar.gz
WF_TARBALL_ORIG = $(subst -,_,$(subst tar.gz,orig.tar.gz,$(WF_TARBALL)))
WF_DIRECTORY = wildfly-$(WF_VERSION)
WF_DOWNLOAD_URL = http://download.jboss.org/wildfly/$(WF_VERSION)/$(WF_TARBALL)
WF_DISTRIBUTION := $(or $(distribution),$(WF_DISTRIBUTION),$(shell lsb_release -sc))
GPG_KEY := $(or $(gpg),$(GPG_KEY))
PPA_VERSION := $(or $(ppa_version),$(PPA_VERSION),$(shell cat PPA_VERSION))
build: prepare $(WF_TARBALL_ORIG) ensure-debhelper-and-devscripts-packages-are-installed
ifdef GPG_KEY
cd $(WF_DIRECTORY) && dpkg-buildpackage -F -k$(GPG_KEY)
else
cd $(WF_DIRECTORY) && dpkg-buildpackage -us -uc
endif
source: prepare $(WF_TARBALL_ORIG) ensure-debhelper-and-devscripts-packages-are-installed
ifdef GPG_KEY
cd $(WF_DIRECTORY) && debuild -S -k$(GPG_KEY)
else
@echo GPG_KEY is not set. Please pass the key via gpg= on the command line, or set GPG_KEY in the environment.
endif
#(error GPG_KEY is not set. Please pass the key via gpg= on the command line, or set GPG_KEY in the environment.)
$(WF_TARBALL): /usr/bin/wget
/usr/bin/wget $(WF_DOWNLOAD_URL)
$(WF_TARBALL_ORIG): $(WF_TARBALL)
ln $(WF_TARBALL) $(WF_TARBALL_ORIG)
unpack: $(WF_TARBALL) clean
tar -xzf $(WF_TARBALL)
copy: unpack
cp -R debian $(WF_DIRECTORY)/
$(WF_DIRECTORY)/debian/wildfly.init: copy
find $(WF_DIRECTORY) -name wildfly-init-debian.sh -exec cp {} $(WF_DIRECTORY)/debian/wildfly.init \;
conffiles: copy
cd $(WF_DIRECTORY) && find domain/ standalone/ -type f -exec echo "/opt/wildfly/{}" \; > debian/wildfly.conffiles
cd $(WF_DIRECTORY) && find bin/ \( -name '*.conf' -o -name '*.properties' \) -exec echo "/opt/wildfly/{}" \; >> debian/wildfly.conffiles
prepare: $(WF_DIRECTORY)/debian/wildfly.init conffiles PPA_VERSION
cd $(WF_DIRECTORY) && \
dch --create --distribution=$(WF_DISTRIBUTION) --package=wildfly \
--newversion=$(WF_VERSION)-1~$(WF_DISTRIBUTION)ppa$(PPA_VERSION) \
"Packaging Wildfly for $(WF_DISTRIBUTION)"
.PHONY: ensure-debhelper-and-devscripts-packages-are-installed
ensure-debhelper-and-devscripts-packages-are-installed: /usr/bin/dpkg-buildpackage /usr/bin/dch
@echo Ensure that the debhelper and devscripts packages are installed
.PHONY: clean
clean:
rm -rf $(WF_DIRECTORY)
.PHONY: cleanall
cleanall: clean
rm -f $(WF_TARBALL_ORIG) $(WF_TARBALL) *.debian.tar.gz *.dsc *.changes *.build *.ppa.upload *.deb