| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export DH_VERBOSE=1 |
| 4 |
|
| 5 |
TDIR=debian/environment-modules |
| 6 |
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 7 |
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH) |
| 8 |
|
| 9 |
DEB_BUILD_MAINT_OPTIONS:=hardening=+all |
| 10 |
DEB_CFLAGS_MAINT_APPEND:= -Wall -pedantic |
| 11 |
DEB_LDFLAGS_MAINT_APPEND:= -Wl,--as-needed |
| 12 |
export DEB_BUILD_MAINT_OPTIONS DEB_CFLAGS_MAINT_APPEND DEB_LDFLAGS_MAINT_APPEND |
| 13 |
|
| 14 |
# The magic debhelper rule |
| 15 |
%: |
| 16 |
dh $@ |
| 17 |
|
| 18 |
override_dh_auto_clean: |
| 19 |
$(MAKE) clean || echo "Make clean skipped" |
| 20 |
rm -f stamp-h |
| 21 |
rm -f Makefile.inc lib/Makefile lib/config.log lib/config.h lib/config.status site.exp |
| 22 |
|
| 23 |
override_dh_auto_configure: |
| 24 |
dh_auto_configure -- \ |
| 25 |
--prefix=/usr/share/modules \ |
| 26 |
--libdir=$(LIBDIR) \ |
| 27 |
--libexecdir=$(LIBDIR) \ |
| 28 |
--mandir=/usr/share/man \ |
| 29 |
--etcdir=/etc/environment-modules \ |
| 30 |
--initdir=/usr/share/modules/init \ |
| 31 |
--with-version-path=/usr/share/modules/versions \ |
| 32 |
--with-module-path=/usr/share/modules/modulefiles \ |
| 33 |
--with-tcl-ver=8.6 \ |
| 34 |
--with-tclsh=tclsh8.6 \ |
| 35 |
--enable-logging \ |
| 36 |
--with-pager=/usr/bin/less \ |
| 37 |
--with-python=/usr/bin/python3 \ |
| 38 |
--bindir=/usr/bin #LDFLAGS='$(LDFLAGS) -Wl,--as-needed' CFLAGS='$(CFLAGS) ' |
| 39 |
|
| 40 |
override_dh_auto_test: |
| 41 |
-dh_auto_test || echo "Ignoring known test failures in autoinit regexps" |
| 42 |
|
| 43 |
override_dh_auto_install: |
| 44 |
dh_auto_install |
| 45 |
patchelf --set-soname libtclenvmodules.so.0d debian/tmp/$(LIBDIR)/libtclenvmodules.so \ |
| 46 |
--output debian/tmp/$(LIBDIR)/libtclenvmodules.so.0d |
| 47 |
rm debian/tmp/$(LIBDIR)/libtclenvmodules.so |
| 48 |
ln -s libtclenvmodules.so.0d debian/tmp/$(LIBDIR)/libtclenvmodules.so |
| 49 |
rm -rf $(TDIR)/usr/share/modules/share |
| 50 |
cp debian/profile.sh $(TDIR)/etc/profile.d/modules.sh |
| 51 |
cp debian/modulespath site.exp $(TDIR)/etc/environment-modules |
| 52 |
dh_link /etc/environment-modules/modulespath /usr/share/modules/init/.modulespath |
| 53 |
dh_link $(LIBDIR)/modulecmd.tcl /usr/lib/modulecmd.tcl |
| 54 |
dh_link /usr/share/modules/init/csh /etc/csh/login.d/modules |
| 55 |
dh_link /usr/share/modules/init/csh /etc/csh/cshrc.d/modules |
| 56 |
dh_link /usr/share/modules/init/bash_completion /usr/share/bash-completion/completions/modules |
| 57 |
dh_link /usr/share/modules/init/fish /usr/share/fish/vendor_conf.d/modules.fish |
| 58 |
dh_link /usr/share/modules/init/fish_completion /usr/share/fish/vendor_completions.d/modules.fish |