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
|
#!/usr/bin/make -f
# export DH_VERBOSE=1
TDIR=debian/environment-modules
DEB_BUILD_MAINT_OPTIONS:=hardening=+all
DEB_CFLAGS_MAINT_APPEND:= -Wall -pedantic
DEB_LDFLAGS_MAINT_APPEND:= -Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS DEB_CFLAGS_MAINT_APPEND DEB_LDFLAGS_MAINT_APPEND
# The magic debhelper rule
%:
dh $@
override_dh_auto_clean:
dh_auto_clean
rm -f stamp-h
override_dh_auto_configure:
dh_auto_configure -- \
--prefix=/usr --with-version-path=/usr/share/modules/versions \
--with-module-path=/usr/share/modules/modulefiles \
--with-tcl-ver=8.6 \
--enable-logging \
--bindir=/usr/bin LDFLAGS='$(LDFLAGS) -Wl,--as-needed' CFLAGS='$(CFLAGS) '
override_dh_auto_install:
dh_auto_install
# Fix brain-dead install locations.
mv ${TDIR}/usr/Modules/*/bin/* ${TDIR}/usr/bin
rmdir ${TDIR}/usr/Modules/*/bin
mkdir -p ${TDIR}//usr/share/bash-completion/completions
mv ${TDIR}/usr/Modules/*/init/bash_completion ${TDIR}//usr/share/bash-completion/completions/modules
mv ${TDIR}/usr/Modules/*/share/* ${TDIR}/usr/share
mv ${TDIR}/usr/Modules/*/init ${TDIR}/usr/share/modules
mv ${TDIR}/usr/Modules/*/modulefiles ${TDIR}/usr/share/modules
rmdir ${TDIR}/usr/Modules/*/share
mv ${TDIR}/usr/Modules ${TDIR}/usr/share/modules
cp debian/csh ${TDIR}/etc/csh/login.d/modules
cp debian/sh ${TDIR}/etc/profile.d/modules.sh
cp debian/modulespath ${TDIR}/etc/environment-modules/modulespath
rm ${TDIR}/usr/share/modules/init/.modulespath
dh_link /etc/environment-modules/modulespath /usr/share/modules/init/.modulespath
|