Commit 9c84efda authored by Daniel Brown's avatar Daniel Brown

Adding Debian package creator

parent 4e88fe48
FROM debian
WORKDIR /root
RUN apt --assume-yes update
RUN apt --assume-yes install gcc git libgsl-dev make g++ python
RUN git clone https://git.ligo.org/finesse/finesse.git
#CMD ["python", "/host/build.py"]
\ No newline at end of file
import os
import textwrap
from subprocess import call, check_output
from collections import defaultdict
import string
class SafeDict(dict):
def __missing__(self, key):
return '{' + key + '}'
os.chdir("/root/finesse")
call("git pull".split())
git_describe = str(check_output('git describe --tags'.split())).split("-")
call("./finesse.sh --build".split())
os.chdir("/root/finesse/packaging/deb")
call("mkdir -p finesse/DEBIAN".split())
vals = {
"version": git_describe[0],
"release": git_describe[1],
}
call('mkdir -p finesse/DEBIAN'.format(**vals).split())
call('mkdir -p finesse/usr/bin'.format(**vals).split())
call('cp /root/finesse/kat /root/finesse/packaging/deb/finesse/usr/bin'.format(**vals).split())
call('cp /root/finesse/kat.ini /root/finesse/packaging/deb/finesse/etc/finesse'.format(**vals).split())
call('tar -zcvf ./SOURCES/finesse-{version}-{release}.tar.gz finesse-{version}/'.format(**vals).split())
with open("/root/finesse/packaging/deb/finesse/DEBIAN/control", "w") as f:
s = string.Formatter().vformat(textwrap.dedent("""
Package: finesse
Version: {version}.{release}
Section: base
Priority: optional
Architecture: amd64
Depends: gsl-bin
Maintainer: Daniel Brown <finesse@star.sr.bham.ac.uk>
Description: FINESSE: Frequency domain INterfErometer Simulation SoftwarE
"""), (), SafeDict(**vals))
f.write(s)
call("dpkg-deb --build finesse".split())
call("cp /root/finesse/packaging/deb/finesse.deb /host/finesse.{version}.{release}.deb".format(**vals).split())
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment