# http://wildfly.org/downloads/
# https://github.com/mattthias/wildfly-packaging
VERSION=13.0.0.Final
REVISION=1
sudo apt-get install -y devscripts
# Download the "source" (the binary "Java EE7 Full & Web Distribution")
# wget http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.tar.gz
# https://github.com/ilanddev/wildfly-debian/tree/master/debian
# download archive
mkdir /tmp/wildfly
wget http://download.jboss.org/wildfly/${VERSION}/wildfly-${VERSION}.tar.gz -q -O /tmp/wildfly/wildfly-${VERSION}.tar.gz
# create a link to archive
cd /tmp/wildfly
ln -s wildfly-${VERSION}.tar.gz wildfly_${VERSION}.orig.tar.gz
# unpack and enter directory
tar -xzf wildfly-${VERSION}.tar.gz
cd wildfly-${VERSION}
# Lets start with packaging (create debian/ dir and changelog)
mkdir debian
dch --create --package wildfly --newversion=${VERSION}-${REVISION} "Build WildFly ${VERSION} package at $(date -I)"
# 2. debian/compat
echo "9" > debian/compat
# 3. debian/rules
echo -ne '#!/usr/bin/make -f\n%:\n\tdh $@\n' > debian/rules
# 4. debian/control
cat < debian/control
Source: wildfly
Maintainer: Foo
Standards-Version: 3.9.5
Build-Depends: debhelper
Package: wildfly
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: WildFly application server
EOF
# 5. debian/source/format
mkdir -p debian/source
echo "3.0 (quilt)" > debian/source/format
# 6. Add all dir to install
for i in $(ls | grep -v debian); do
echo $i opt/wildfly/
done > debian/wildfly.install
# Build with dpkg-buildpackage
sudo dpkg-buildpackage -us -uc