#!/usr/bin/make -f # # debian/rules file for cdrkit. GPL2 # Original from Erik Andersen # PACKAGE = cdrkit os := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) CFLAGS = -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif i=$(shell pwd)/debian/tmp/usr b=$(shell pwd)/debian/build iso=genisoimage cdd=icedax cdr=wodim ziso_VERSION = $(shell cat 3rd-party/zisofs_tools/version) source_VERSION= $(shell dpkg-parsechangelog | sed -ne '/^Version:/s/^V.*://p') build: build-arch build-indep build-arch: build/build-debstamp build-indep: build/build-debstamp build/build-debstamp: # @if test -f ../cdrkit_$(source_VERSION).tar.gz ; then \ # echo "You should not create native packages! Remove ../cdrkit_$(source_VERSION).tar.gz and copy upstream source to .orig.tar.gz" ; \ # exit 1 ; \ # fi @echo "--- Compiling" dh_testdir echo "#define ZISOFS_TOOLS_VERSION \"$(ziso_VERSION)\"" > 3rd-party/zisofs_tools/version.h make CFLAGS='$(CFLAGS)' cd 3rd-party/zisofs_tools && CFLAGS='$(CFLAGS)' ./configure && $(MAKE) touch build/build-debstamp clean: @echo "--- Cleaning" dh_testdir dh_testroot -$(MAKE) -C 3rd-party/zisofs_tools distclean -./.clean dh_clean # clean up the stuff dh_clean leaves behind -rm -rf debian/build debian/files -rm -f `find . -name "*~"` -rm -rf `find . -name "\.deps"` -rm -rf `find . -name "\.libs"` -rm -rf `find . -name "*\.rej"` -rm -rf build install: build build/install-debstamp build/install-debstamp: @echo "--- Installing" dh_testdir dh_testroot dh_clean rm -rf $(b) make install PREFIX=$(i) ifeq (illumos,$(os)) mv $(i)/bin/genisoimage $(i)/bin/mkisofs ln -sf mkisofs $(i)/bin/genisoimage mv $(i)/share/man/man1/genisoimage.1 $(i)/share/man/man1/mkisofs.1 echo ".so mkisofs.1" > $(i)/share/man/man1/genisoimage.1 endif install -m 755 3rd-party/geteltorito/geteltorito.pl $(i)/bin/geteltorito install -m 755 3rd-party/zisofs_tools/mkzftree $(i)/bin/ install -m 755 icedax/cdda2ogg $(i)/bin/ install -m 755 icedax/cdda2mp3 $(i)/bin/ install -m 755 icedax/readmult $(i)/bin/ install -m 755 icedax/pitchplay $(i)/bin/ touch build/install-debstamp binary-indep: build install cdrkit-doc binary-arch: build install wodim icedax genisoimage ifeq (illumos,$(os)) binary-arch: mkisofs mkisofs: install @echo "--- Building: $@" dh_installdirs -p$@ -P$(b)/$@ dh_link -p$@ -P$(b)/$@ dh_installdocs -p$@ -P$(b)/$@ dh_installchangelogs -p$@ -P$(b)/$@ Changelog dh_install -p$@ -P$(b)/$@ dh_strip -p$@ -P$(b)/$@ dh_compress -p$@ -P$(b)/$@ dh_fixperms -p$@ -P$(b)/$@ dh_makeshlibs -p$@ -P$(b)/$@ -V dh_installdeb -p$@ -P$(b)/$@ dh_shlibdeps -p$@ -P$(b)/$@ dh_installdebconf -p$@ -P$(b)/$@ dh_gencontrol -p$@ -P$(b)/$@ dh_md5sums -p$@ -P$(b)/$@ dh_builddeb -p$@ -P$(b)/$@ endif # # wodim # wodim: install @echo "--- Building: $@" dh_installdirs -p$@ -P$(b)/$@ cp -a wodim/wodim.dfl $(b)/$@/etc/wodim.conf cp -a netscsid/netscsid.dfl $(b)/$@/etc/netscsid.conf # cp debian/reportbug.presubj $(b)/$@/usr/share/bug/wodim/presubj dh_link -p$@ -P$(b)/$@ dh_installdocs -p$@ -P$(b)/$@ dh_installchangelogs -p$@ -P$(b)/$@ Changelog dh_install -p$@ -P$(b)/$@ dh_strip -p$@ -P$(b)/$@ dh_installexamples -p$@ -P$(b)/$@ netscsid/netscsid.dfl wodim/wodim.dfl misc/burnstuff dh_compress -p$@ -P$(b)/$@ dh_fixperms -p$@ -P$(b)/$@ dh_makeshlibs -p$@ -P$(b)/$@ -V dh_installdeb -p$@ -P$(b)/$@ dh_shlibdeps -p$@ -P$(b)/$@ dh_installdebconf -p$@ -P$(b)/$@ dh_gencontrol -p$@ -P$(b)/$@ dh_md5sums -p$@ -P$(b)/$@ dh_builddeb -p$@ -P$(b)/$@ # # genisoimage # genisoimage: install @echo "--- Building: $@" dh_installdirs -p$@ -P$(b)/$@ dh_installdocs -p$@ -P$(b)/$@ dh_installchangelogs -p$@ -P$(b)/$@ $(iso)/ChangeLog zisofs_tools/CHANGES dh_install -p$@ -P$(b)/$@ dh_installman -p$@ -P$(b)/$@ 3rd-party/zisofs_tools/mkzftree.1 3rd-party/geteltorito.1 # cp debian/reportbug.presubj $(b)/$@/usr/share/bug/mkisofs/presubj # rm -f $(b)/$@/usr/bin/mkhybrid $(b)/$@/usr/share/man/man8/mkhybrid* dh_link -p$@ -P$(b)/$@ dh_strip -p$@ -P$(b)/$@ dh_compress -p$@ -P$(b)/$@ dh_fixperms -p$@ -P$(b)/$@ dh_makeshlibs -p$@ -P$(b)/$@ -V dh_installdeb -p$@ -P$(b)/$@ dh_shlibdeps -p$@ -P$(b)/$@ dh_gencontrol -p$@ -P$(b)/$@ dh_md5sums -p$@ -P$(b)/$@ dh_builddeb -p$@ -P$(b)/$@ # # icedax # icedax: install @echo "--- Building: $@" dh_installdirs -p$@ -P$(b)/$@ dh_installdocs -p$@ -P$(b)/$@ dh_installchangelogs -p$@ -P$(b)/$@ dh_install -p$@ -P$(b)/$@ # cp debian/reportbug.presubj $(b)/$@/usr/share/bug/icedax/presubj dh_strip -p$@ -P$(b)/$@ chmod 755 $(b)/$@/usr/bin/cdda2* dh_link -p$@ -P$(b)/$@ chmod 755 $(b)/$@/usr/bin/readmult chmod 755 $(b)/$@/usr/bin/pitchplay dh_installman -p$@ -P$(b)/$@ # cludge, integrate into the official BS later # dh_installman -p$@ -P$(b)/$@ doc/readmult.man doc/pitchplay.man doc/list_audio_tracks.man dh_compress -p$@ -P$(b)/$@ dh_fixperms -p$@ -P$(b)/$@ dh_makeshlibs -p$@ -P$(b)/$@ -V dh_installdeb -p$@ -P$(b)/$@ dh_shlibdeps -p$@ -P$(b)/$@ dh_gencontrol -p$@ -P$(b)/$@ dh_md5sums -p$@ -P$(b)/$@ dh_builddeb -p$@ -P$(b)/$@ # # cdrkit-doc # cdrkit-doc: install @echo "--- Building: $@" dh_installdirs -p$@ -P$(b)/$@ dh_installdocs -p$@ -P$(b)/$@ dh_installchangelogs -p$@ -P$(b)/$@ dh_install -p$@ -P$(b)/$@ dh_link -p$@ -P$(b)/$@ @-find $(b)/$@ | grep '\.svn' | xargs rm -rf # dh_strip -p$@ -P$(b)/$@ dh_compress -p$@ -P$(b)/$@ dh_fixperms -p$@ -P$(b)/$@ dh_installdeb -p$@ -P$(b)/$@ # dh_shlibdeps -p$@ -P$(b)/$@ dh_gencontrol -p$@ -P$(b)/$@ dh_md5sums -p$@ -P$(b)/$@ dh_builddeb -p$@ -P$(b)/$@ binary: binary-indep binary-arch .PHONY: binary clean binary-indep binary-arch build install install-save install-saved