debian swirl logo

Back to the packages list squeak-vm

#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

-include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/class/makefile.mk
include /usr/share/cdbs/1/rules/debhelper.mk

pkg = $(DEB_SOURCE_PACKAGE)

DEB_UPSTREAM_URL = http://www.squeakvm.org/unix/release
DEB_UPSTREAM_TARBALL_BASENAME = Squeak-$(DEB_UPSTREAM_TARBALL_VERSION)-src
DEB_UPSTREAM_TARBALL_MD5 = 8a5cb1d6899d55df56154fab8716e034

# Put aside convenience code copies during build
upstream-cruft = Cross/plugins/RePlugin/pcre.c Cross/plugins/RePlugin/pcre.h
# all j*.[ch] except jmemd*.c and jinclude.h
jpegfiles = jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c
jpegfiles += jchuff.c jchuff.h jcinit.c jcmainct.c jcmarker.c jcmaster.c
jpegfiles += jcomapi.c jconfig.h jcparam.c jcphuff.c jcprepct.c
jpegfiles += jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c
jpegfiles += jdatasrc.c jdcoefct.c jdcolor.c jdct.h jddctmgr.c jdhuff.c
jpegfiles += jdhuff.h jdinput.c jdmainct.c jdmarker.c jdmaster.c
jpegfiles += jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c
jpegfiles += jerror.c jerror.h jfdctflt.c jfdctfst.c jfdctint.c
jpegfiles += jidctflt.c jidctfst.c jidctint.c jidctred.c jmemmgr.c
jpegfiles += jmemnobs.c jmemsys.h jmorecfg.h jpegint.h jpeglib.h
jpegfiles += jquant1.c jquant2.c jutils.c jversion.h
upstream-cruft += $(patsubst %,Cross/plugins/JPEGReadWriter2Plugin/%,$(jpegfiles))
pre-build:: debian/stamp-upstream-cruft
debian/stamp-upstream-cruft:
		mkdir -p debian/upstream-cruft
		@for orig in $(upstream-cruft); do \
		backup= "debian/upstream-cruft/$$orig"; \
			[ ! -e "$$orig" ] || [ -e "$$backup" ] || { \
				mkdir -p "$$(dirname "$$backup")"; \
				echo mv "$$orig" "$$backup"; \
				mv "$$orig" "$$backup"; \
			}; \
		done
		touch $@
clean::
		@for orig in $(upstream-cruft); do \
		backup= "debian/upstream-cruft/$$orig"; \
			if [ -e "$$backup" ]; then \
				if [ -e "$$orig" ]; then \
					echo "rm -rf" "$$orig"; \
					rm -rf "$$orig"; \
				fi; \
				echo mv "$$backup" "$$orig"; \
				mv "$$backup" "$$orig"; \
			fi; \
		done
		rm -rf debian/upstream-cruft
		rm -f debian/stamp-upstream-cruft

DEB_SRCDIR = unix
DEB_BUILDDIR = build-tree

DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(cdbs_curdestdir)

CMAKE_OPTS = -Wno-dev -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_SKIP_RPATH=TRUE -D BINDINGS_GLOBAL_INSTALL=TRUE -D PEDANTIC=TRUE
ifneq ($(DEB_HOST_ARCH),i386)
	CONFIG_OPTS= --without-RomePlugin --without-Mpeg3Plugin
endif

# Upstream README contains no parts relevant for Debian usage
DEB_INSTALL_DOCS_ALL = 

DEB_INSTALL_CHANGELOGS_ALL = unix/ChangeLog
DEB_INSTALL_MANPAGES_$(pkg) = debian/squeak.1

common-configure-arch:: configure-stamp
configure-stamp:
	# Perform an out-of-tree build to keep a clean source tree
		cd $(DEB_BUILDDIR); $(CURDIR)/$(DEB_SRCDIR)/cmake/configure $(CONFIG_OPTS) \
			--with-npsqueak --prefix=/usr
		cd $(DEB_BUILDDIR); cmake .. \
			-DCMAKE_INSTALL_PREFIX:STRING="/usr" \
			-DCMAKE_C_FLAGS:STRING="$(CFLAGS)" \
			$(CURDIR)/$(DEB_SRCDIR)

		touch $@

clean::
		rm -f configure-stamp
		rm -rf $(DEB_BUILDDIR)

install/$(pkg)::
		for y in debian/po/*.po; do \
	  i= `basename $$y .po`; \
		  mkdir -p $(cdbs_curdestdir)/usr/share/locale/$$i/LC_MESSAGES/; \
		  msgfmt $$y -o $(cdbs_curdestdir)/usr/share/locale/$$i/LC_MESSAGES/squeak.mo --statistics ; \
		done

binary-post-install/$(pkg)::
		rm -f $(cdbs_curdestdir)/usr/bin/squeak.sh

binary-strip/$(pkg)::
		$(if $(filter nostrip,$(DEB_BUILD_OPTIONS)),,strip -s --remove-section=.comment $(cdbs_curdestdir)/usr/lib/squeak/*/*)

Builds:

squeak-vm
the squeak smalltalk system (virtual machine)