File debian.rules of Package osar

#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=3

# This is the debhelper compatibility version to use.
# export DH_COMPAT=7
#QT5=yes

CFLAGS = -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif


build-arch: build
build-indep: build
build: build-stamp
build-stamp:
	dh_testdir
	ls -l	
	tar -zxvf ARToolKit.tar.gz
	ls -l	
	pwd
	ls -l	
	./Configure < keyboard
	make 
	mkdir ARToolKit
	mv ARToolKit.dsw  ARToolKit/
	mv ARToolKit.xcodeproj   ARToolKit/
	mv ChangeLog.txt  ARToolKit/
	mv Configure.win32.bat ARToolKit/ 
	mv doc ARToolKit/
	mv include ARToolKit/
	mv lib ARToolKit/
	mv Makefile.in ARToolKit/ 
	mv README.txt ARToolKit/
	mv ARToolKit.sln ARToolKit/ 
	mv bin  ARToolKit/                
	mv Configure ARToolKit/     
	mv COPYING.txt ARToolKit/         
	mv examples ARToolKit/ 
	mv keyboard ARToolKit/ 
	mv Makefile ARToolKit/ 
	mv patterns ARToolKit/    
	mv util ARToolKit/
	ls -l ARToolKit/
	tar -zxvf osgART2-2.0.RC4.tar.gz
	cmake . -DCMAKE_CXX_FLAGS=-fpermissive -DCMAKE_MODULE_LINKER_FLAGS=-lgstreamer-0.10 -DCMAKE_SHARED_LINKER_FLAGS=-lgstreamer-0.10
	make
	tar -zxvf osar.tar.gz
	#./configure
	#make all 
	# --- end custom part for compiling

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp

	# Add here commands to clean up after the build process.
	make clean || true 
	# --- end custom part for cleaning up
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	ls -l 
	ls -l lib/

	# Add here commands to install the package
	# The DESTDIR Has To Be Exactly  /usr/src/packages/BUILD/debian/<nameOfPackage>
	#mkdir -p $(DEST)/usr/lib/x86_64-linux-gnu/osgPlugins-3.2.1
	mkdir -p $(CURDIR)/debian/osar/usr/lib/x86_64-linux-gnu/osgPlugins-3.2.1
	mkdir -p $(CURDIR)/debian/osar/usr/local/lib
	mkdir -p $(CURDIR)/debian/osar/lib
	mkdir -p $(CURDIR)/debian/osar/usr/local/bin
	mkdir -p $(CURDIR)/debian/osar/usr/local/bin/data
	mkdir -p $(CURDIR)/debian/osar/usr/share/pixmaps
	mkdir -p $(CURDIR)/debian/osar/usr/share/applications
	cp lib/osgart_tracker_artoolkit2.so $(CURDIR)/debian/osar/usr/lib/x86_64-linux-gnu/osgPlugins-3.2.1/osgart_tracker_artoolkit2.so
	cp lib/osgart_video_artoolkit2.so $(CURDIR)/debian/osar/usr/lib/x86_64-linux-gnu/osgPlugins-3.2.1/osgart_video_artoolkit2.so
	cp lib/osgdb_osgart.so $(CURDIR)/debian/osar/usr/lib/x86_64-linux-gnu/osgPlugins-3.2.1/osgdb_osgart.so
	cp lib/libosgART.so.2 $(CURDIR)/debian/osar/usr/local/lib/
	ln -s $(CURDIR)/debian/osar/usr/local/lib/libosgART.so.2 $(CURDIR)/debian/osar/usr/local/lib/libosgART.so
	ln -s $(CURDIR)/debian/osar/usr/local/lib/libosgART.so.2 $(CURDIR)/debian/osar/usr/local/lib/libosgART.so.10
	ln -s $(CURDIR)/debian/osar/usr/local/lib/libosgART.so.2 $(CURDIR)/debian/osar/lib/libosgART.so.10
	ln -s $(CURDIR)/debian/osar/usr/local/lib/libosgART.so.2 $(CURDIR)/debian/osar/usr/lib/x86_64-linux-gnu/libosgART.so.10

	cp bin/* $(CURDIR)/debian/osar/usr/local/bin/
	cp etc/data/artoolkit2/* $(CURDIR)/debian/osar/usr/local/bin/data/
	cp OSAR $(CURDIR)/debian/osar/usr/local/bin/
	cp OSARico.png $(CURDIR)/debian/osar/usr/share/pixmaps/
	cp osgartviewer.cfg  $(CURDIR)/debian/osar/usr/local/bin/
	cp steve.ive $(CURDIR)/debian/osar/usr/local/bin/
	cp patt.openSUSE $(CURDIR)/debian/osar/usr/local/bin/data/
	cp pattopenSUSE.pdf $(CURDIR)/debian/osar/usr/local/bin/data/
	cp pattopenSUSE.gif $(CURDIR)/debian/osar/usr/local/bin/data/
	cp osar.desktop $(CURDIR)/debian/osar/usr/share/applications/

	# --- end custom part for installing

# Build architecture-independent files here.
binary-indep: build install
	# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
#	dh_installdebconf
	dh_installdocs
	dh_installexamples
	dh_installmenu
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
	dh_installcron
	dh_installman
	dh_installinfo
	dh_gconf
#	dh_undocumented
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_makeshlibs
	dh_installdeb
#	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install