| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
# Uncomment this to turn on verbose mode. |
| 4 |
#export DH_VERBOSE=1 |
| 5 |
|
| 6 |
# Some programs are suid. Compiling them with hardening flags... |
| 7 |
# https://wiki.debian.org/Hardening |
| 8 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 9 |
DPKG_EXPORT_BUILDFLAGS = 1 |
| 10 |
include /usr/share/dpkg/buildflags.mk |
| 11 |
|
| 12 |
# This has to be exported to make some magic below work. |
| 13 |
export DH_OPTIONS |
| 14 |
|
| 15 |
# This is required to use systemd |
| 16 |
export SYSTEMD_INIT=true |
| 17 |
|
| 18 |
INSTALLDIR=debian |
| 19 |
|
| 20 |
export OARUSER=oar |
| 21 |
export OARCONFDIR=/etc/oar |
| 22 |
export PREFIX=/usr |
| 23 |
export MANDIR=/usr/share/man |
| 24 |
export OARDIR=/usr/lib/oar |
| 25 |
export BINDIR=/usr/bin |
| 26 |
export SBINDIR=/usr/sbin |
| 27 |
export CGIDIR=/usr/lib/cgi-bin |
| 28 |
export PERLLIBDIR=/usr/share/perl5 |
| 29 |
export VARLIBDIR=/var/lib |
| 30 |
export SETUP_TYPE=deb |
| 31 |
export TARGET_DIST=debian |
| 32 |
|
| 33 |
CFLAGS += -Wall |
| 34 |
|
| 35 |
%: |
| 36 |
dh $@ --with sphinxdoc |
| 37 |
|
| 38 |
override_dh_auto_build: |
| 39 |
dh_auto_build -- -e packages-build PACKAGES_DIR=$(CURDIR)/$(INSTALLDIR) |
| 40 |
|
| 41 |
|
| 42 |
override_dh_auto_install: |
| 43 |
$(MAKE) -e packages-install PACKAGES_DIR=$(CURDIR)/$(INSTALLDIR) |
| 44 |
## oar-server |
| 45 |
cat $(CURDIR)/$(INSTALLDIR)/oar-server/usr/share/oar/oar-server/cron.d/oar-server > debian/oar-server.cron.d |
| 46 |
cat $(CURDIR)/$(INSTALLDIR)/oar-server/usr/share/oar/oar-server/systemd/oar-server.service > debian/oar-server.service |
| 47 |
cat $(CURDIR)/$(INSTALLDIR)/oar-server/usr/share/oar/oar-server/systemd/oar-accounting.timer > debian/oar-server.oar-accounting.timer |
| 48 |
cat $(CURDIR)/$(INSTALLDIR)/oar-server/usr/share/oar/oar-server/systemd/oar-accounting.service > debian/oar-server.oar-accounting.service |
| 49 |
|
| 50 |
## oar-node |
| 51 |
cat $(CURDIR)/$(INSTALLDIR)/oar-node/usr/share/oar/oar-node/cron.d/oar-node > debian/oar-node.cron.d |
| 52 |
cat $(CURDIR)/$(INSTALLDIR)/oar-node/usr/share/oar/oar-node/systemd/oar-node.service > debian/oar-node.service |
| 53 |
cat $(CURDIR)/$(INSTALLDIR)/oar-node/usr/share/oar/oar-node/systemd/oar-node-script.service > debian/oar-node.oar-node-script.service |
| 54 |
cat $(CURDIR)/$(INSTALLDIR)/oar-node/usr/share/oar/oar-node/systemd/oar-nodecheck.timer > debian/oar-node.oar-nodecheck.timer |
| 55 |
cat $(CURDIR)/$(INSTALLDIR)/oar-node/usr/share/oar/oar-node/systemd/oar-nodecheck.service > debian/oar-node.oar-nodecheck.service |
| 56 |
cat $(CURDIR)/$(INSTALLDIR)/oar-node/usr/share/oar/oar-node/systemd/oar.target > debian/oar-node.oar.target |
| 57 |
|
| 58 |
## oar-common |
| 59 |
cat $(CURDIR)/$(INSTALLDIR)/oar-common/usr/share/oar/oar-common/logrotate.d/oar-common > debian/oar-common.logrotate |
| 60 |
## oar-web-status |
| 61 |
# (poar) use libjs-jquery instead of the embedded one. |
| 62 |
# -- poar is not in the debian packaging (still an experimental feature) |
| 63 |
#rm $(CURDIR)/$(INSTALLDIR)/oar-web-status/usr/share/oar/oar-web-status/poar/external/jquery.js |
| 64 |
#ln -s /usr/share/javascript/jquery/jquery.js $(CURDIR)/$(INSTALLDIR)/oar-web-status/usr/share/oar-web-status/poar/external/jquery.js |
| 65 |
|
| 66 |
## oar-doc |
| 67 |
rm -r $(CURDIR)/$(INSTALLDIR)/oar-doc/usr/share/doc/oar-doc/doctrees |
| 68 |
|
| 69 |
dh_install -i |
| 70 |
dh_installsystemd --name=oar |
| 71 |
dh_installsystemd --name=oar-node-script |
| 72 |
dh_installsystemd --name=oar-accounting |
| 73 |
dh_installsystemd --name=oar-nodecheck |
| 74 |
|
| 75 |
override_dh_clean: |
| 76 |
dh_clean |
| 77 |
|
| 78 |
$(MAKE) -e packages-clean PACKAGES_DIR=$(CURDIR)/$(INSTALLDIR) |
| 79 |
|
| 80 |
# Cleaning package |
| 81 |
$(RM) debian/oar-server.init |
| 82 |
$(RM) debian/oar-server.service |
| 83 |
$(RM) debian/oar-server.oar-accounting.service |
| 84 |
$(RM) debian/oar-server.oar-accounting.timer |
| 85 |
$(RM) debian/oar-node.init |
| 86 |
$(RM) debian/oar-node.service |
| 87 |
$(RM) debian/oar-node.oar-node-script.service |
| 88 |
$(RM) debian/oar-node.oar-nodecheck.service |
| 89 |
$(RM) debian/oar-node.oar-nodecheck.timer |
| 90 |
$(RM) debian/oar-server.default |
| 91 |
$(RM) debian/oar-node.default |
| 92 |
$(RM) debian/oar-common.logrotate |
| 93 |
$(RM) debian/oar-server.cron.d |
| 94 |
$(RM) debian/oar-node.cron.d |
| 95 |
|
| 96 |
override_dh_installinit: |
| 97 |
dh_installinit --error-handler=errorinit |
| 98 |
|
| 99 |
override_dh_compress: |
| 100 |
# avoid to compress examples as we use ucf after. |
| 101 |
dh_compress -Xexamples |
| 102 |
|
| 103 |
override_dh_fixperms: |
| 104 |
dh_fixperms |
| 105 |
chmod +x debian/oar-server/usr/share/oar/oar-server/server_epilogue |
| 106 |
chmod +x debian/oar-server/usr/share/oar/oar-server/server_prologue |
| 107 |
chmod +x debian/oar-server/usr/share/oar/oar-server/shut_down_nodes.sh |
| 108 |
chmod +x debian/oar-server/usr/share/oar/oar-server/wake_up_nodes.sh |
| 109 |
chmod +x debian/oar-common/usr/share/oar/oar-common/oarnodesetting_ssh |
| 110 |
chmod +x debian/oar-common/usr/share/oar/oar-common/update_cpuset_id.sh |
| 111 |
chmod +x debian/oar-web-status/usr/share/oar/oar-web-status/userInfos.cgi |
| 112 |
chmod +x debian/oar-restful-api/usr/share/oar/oar-api/stress_factor.sh |
| 113 |
chmod +x debian/oar-node/usr/share/oar/oar-node/epilogue |
| 114 |
chmod +x debian/oar-node/usr/share/oar/oar-node/prologue |