debian/rules
author greg
Mon, 27 Jul 2009 09:18:04 +0200
changeset 578 eb67d9aa714f
parent 553 e411fab0f72d
child 612 fc3399727a06
permissions -rwxr-xr-x
add install/uninstall rules in Makefile.in
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     1
#!/usr/bin/make -f
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     2
# -*- makefile -*-
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     3
# Sample debian/rules that uses debhelper.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     4
#
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     5
# This file was originally written by Joey Hess and Craig Small.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     6
# As a special exception, when this file is copied by dh-make into a
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     7
# dh-make output file, you may use that output file without restriction.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     8
# This special exception was added by Craig Small in version 0.37 of dh-make.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     9
#
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    10
# Modified to make a template file for a multi-binary package with separated
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    11
# build-arch and build-indep targets  by Bill Allombert 2001
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    12
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    13
# Uncomment this to turn on verbose mode.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    14
export DH_VERBOSE=1
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    15
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    16
# This has to be exported to make some magic below work.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    17
export DH_OPTIONS
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    18
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    19
CFLAGS = -Wall -g
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    20
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    21
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    22
	CFLAGS += -O0
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    23
else
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    24
	CFLAGS += -O2
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    25
endif
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    26
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    27
config.status: configure
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    28
	#### CONFIG.STATUS ####	
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    29
	dh_testdir
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    30
	
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    31
	# Add here commands to configure the package.
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    32
	cp debian/control-$(shell echo $(CAN_INTERFACE)) debian/control; \
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    33
	./configure --can=$(shell echo $(CAN_INTERFACE)) --prefix=/usr
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    34
	 
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    35
build: build-indep
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    36
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    37
build-indep: build-indep-stamp
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    38
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    39
build-indep-stamp:  config.status
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    40
	#### BUILD-INDEP-STAMP ####
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    41
	# Add here commands to compile the indep part of the package.
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    42
	$(MAKE)
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    43
	
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    44
clean:
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    45
	#### CLEAN ####
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    46
	dh_testdir
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    47
	dh_testroot
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    48
	rm -f build-indep-stamp #CONFIGURE-STAMP#
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    49
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    50
	# Add here commands to clean up after the build process.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    51
	-$(MAKE) clean
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    52
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    53
	cp -f /usr/share/misc/config.sub config.sub
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    54
endif
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    55
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    56
	cp -f /usr/share/misc/config.guess config.guess
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    57
endif
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    58
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    59
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    60
	dh_clean 
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    61
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    62
install: install-indep install-arch
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    63
install-indep:
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    64
	#### INSTALL-INDEP ####
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    65
	dh_testdir
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    66
	dh_testroot
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    67
	dh_clean -k -i 
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    68
	dh_installdirs -i
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    69
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    70
	# Add here commands to install the indep part of the package into
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    71
	# debian/<package>-doc.
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    72
	$(MAKE) -C drivers PREFIX=$(CURDIR)/debian/canfestival/usr install
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    73
	$(MAKE) -C src PREFIX=$(CURDIR)/debian/canfestival/usr install
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    74
	$(MAKE) -C drivers PREFIX=$(CURDIR)/debian/canfestival/usr install
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    75
	$(MAKE) -C examples PREFIX=$(CURDIR)/debian/canfestival/usr install
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    76
	$(MAKE) -C objdictgen PREFIX=$(CURDIR)/debian/canfestival/usr/share/CanFestival-3 install
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    77
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    78
	mkdir -p $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/src
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    79
	mkdir -p $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/include
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    80
	mkdir -p $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/drivers/unix
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    81
	cp -a $(CURDIR)/debian/canfestival/usr/include/canfestival/* $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/include
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    82
	cp -a $(CURDIR)/debian/canfestival/usr/lib/* $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/src
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    83
	cp -a $(CURDIR)/debian/canfestival/usr/lib/libcanfestival_unix.a $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/drivers/unix
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    84
	cp $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen/canfestival_config.py $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen/canfestival_config_ori.py 
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    85
	
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    86
	mkdir -p $(CURDIR)/debian/canfestival/usr/share/applications
553
e411fab0f72d removed dead hidden files
'Gr?gory Tr?lat <gregory.trelat@lolitech.fr>'
parents: 531
diff changeset
    87
	cp objdictgen/networkedit.ico $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen
e411fab0f72d removed dead hidden files
'Gr?gory Tr?lat <gregory.trelat@lolitech.fr>'
parents: 531
diff changeset
    88
	cp objdictgen/networkedit.png $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen	
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    89
	cp debian/objdictedit.desktop $(CURDIR)/debian/canfestival/usr/share/applications/objdictedit.desktop
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    90
	
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    91
	dh_install -i --sourcedir=debian/canfestival
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    92
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    93
binary-common:
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    94
	#### BINARY-COMMON ####
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    95
	dh_testdir
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    96
	dh_testroot
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    97
	dh_installchangelogs CHANGES
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    98
	dh_installdocs
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    99
#	dh_installexamples
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   100
#	dh_installmenu
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   101
#	dh_installdebconf	
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   102
#	dh_installlogrotate	
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   103
#	dh_installemacsen
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   104
#	dh_installpam
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   105
#	dh_installmime
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   106
#	dh_python
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   107
#	dh_installinit
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   108
#	dh_installcron
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   109
#	dh_installinfo
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   110
#	dh_installman
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   111
	dh_link
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   112
	dh_strip
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   113
	dh_compress
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   114
	dh_fixperms
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   115
#	dh_perl
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   116
#	dh_makeshlibs
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   117
	dh_installdeb
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   118
#	dh_shlibdeps -l /usr/lib
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   119
	dh_gencontrol
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   120
	dh_md5sums
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   121
	dh_builddeb
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   122
# Build architecture independant packages using the common target.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   123
binary-indep: build-indep install-indep
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   124
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   125
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
   126
binary: binary-indep
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
   127
.PHONY: build clean binary-indep binary install install-indep