Files
scst/debian/rules
Bart Van Assche 41473b3e66 Add support for generating Debian packages
Debian packages can be generated by running "make dpkg". Running that command
will produce e.g. the following output:
[ ... ]
Output files:
total 8444
-rw-r--r-- 1 bart bart  185150 Jan 31 20:11 iscsi-scst_3.4.0.6003-1_amd64.deb
-rw-r--r-- 1 bart bart   53174 Jan 31 20:11 scst-dev_3.4.0.6003-1_all.deb
-rw-r--r-- 1 bart bart  878030 Jan 31 20:11 scst-dkms_3.4.0.6003-1_all.deb
-rw-r--r-- 1 bart bart    7388 Jan 31 20:09 scst_3.4.0.6003-1.debian.tar.xz
-rw-r--r-- 1 bart bart    1046 Jan 31 20:09 scst_3.4.0.6003-1.dsc
-rw-r--r-- 1 bart bart   95348 Jan 31 20:11 scst_3.4.0.6003-1_amd64.build
-rw-r--r-- 1 bart bart    6526 Jan 31 20:11 scst_3.4.0.6003-1_amd64.buildinfo
-rw-r--r-- 1 bart bart    3054 Jan 31 20:11 scst_3.4.0.6003-1_amd64.changes
-rw-r--r-- 1 bart bart 4892014 Jan 31 20:11 scst_3.4.0.6003-1_amd64.deb
-rw-rw-r-- 1 bart bart 2458224 Jan 31 20:09 scst_3.4.0.6003.orig.tar.xz
-rw-r--r-- 1 bart bart   43616 Jan 31 20:11 scstadmin_3.4.0.6003-1_amd64.deb

These packages can be installed with the dpkg command. An example:

cd dpkg && sudo dpkg -i scst_*.deb iscsi-scst_*.deb scstadmin_*.deb


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7350 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-01 04:21:29 +00:00

106 lines
3.3 KiB
Makefile

#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
export DH_VERBOSE = 1
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
SUBDIRS=scst fcst iscsi-scst qla2x00t/qla2x00-target scst_local scstadmin srpt
DESTDIR=$(CURDIR)/debian/tmp
VERSION:=$(shell head -n1 debian/changelog | sed 's/.*(\([0-9.]*\).*).*/\1/')
%:
echo "*** dh $@ ***"
dh $@
clean:
dh_testdir && \
dh_prep -Xqla_isp/TAGS -Xdebian/changelog && \
scripts/clean-source-tree -x debian/changelog
build:
export BUILD_2X_MODULE=y && \
export CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y && \
for d in $(SUBDIRS); do $(MAKE) -C $$d; done && \
{ \
echo dkms.conf && \
echo Makefile && \
for d in fcst iscsi-scst qla2x00t scst scst_local srpt; do\
echo $$d; \
done; \
} | sed "s,^,usr/src/scst-$(VERSION)/," >debian/scst-dkms.install
build-indep: build
build-arch: build
install:
[ -n "$(VERSION)" ] && \
dh_testdir && \
export PREFIX=/usr && \
export DESTDIR="$(DESTDIR)" && \
export BUILD_2X_MODULE=y && \
export CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y && \
for d in $(SUBDIRS); do \
if [ $$d = scst ]; then \
{ $(MAKE) -C $$d install || break; } \
else \
{ INSTALL_MOD_PATH="$(DESTDIR)" $(MAKE) -C $$d install; } ||\
break; \
fi; \
done && \
rm -f "$(DESTDIR)"/lib/modules/*/[Mm]odule* && \
mkdir -p $(DESTDIR)/usr/src/scst-$(VERSION) && \
for f in scst.dkms scst-dkms.postinst scst-dkms.prerm; do \
sed "s/\$${PACKAGE_VERSION}/$(VERSION)/" \
< debian/$$f.in >debian/$$f || exit $?; \
done && \
cp debian/scst.dkms \
$(DESTDIR)/usr/src/scst-$(VERSION)/dkms.conf && \
scripts/list-source-files | \
grep -E '^Makefile$$|^(fcst|iscsi-scst|qla2x00t|scst|scst_local|srpt)/'|\
tar -T- -cf- | \
tar -C $(DESTDIR)/usr/src/scst-$(VERSION) -xf- && \
chmod -R 0644 $(DESTDIR)/usr/src/scst-$(VERSION) && \
chmod 0644 "$(DESTDIR)"/usr/lib/*/perl/*/auto/SCST_SCST/.packlist "$(DESTDIR)"/usr/share/perl/*/SCST/SCST.pm && \
chmod 0755 "$(DESTDIR)"/usr/lib/*/perl/*/auto/SCST_SCST && \
mkdir -p "$(DESTDIR)"/usr/share/man && \
{ tar -C "$(DESTDIR)"/usr/man -cf- . | \
tar -C "$(DESTDIR)"/usr/share/man -xf-; } && \
rm -rf "$(DESTDIR)"/usr/man && \
dh_strip && \
dh_compress && \
dh_install && \
dh_installdeb && \
dh_installman && \
dh_installchangelogs && \
dh_shlibdeps && \
dh_gencontrol && \
dh_md5sums && \
dh_builddeb
binary-indep: install
binary-arch: install
binary: binary-indep binary-arch
override_dh_installinit:
dh_installinit --onlyscripts
# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
.PHONY: clean binary binary-arch binary-indep build build-arch build-indep \
install