File: rules

package info (click to toggle)
ossim 1.8.20.3%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 24,044 kB
  • ctags: 33,968
  • sloc: cpp: 342,938; ansic: 14,943; lex: 183; makefile: 172; xml: 141; sql: 78; sh: 6; csh: 6
file content (63 lines) | stat: -rwxr-xr-x 2,190 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/make -f

# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

BUILD_DATE=$(shell dpkg-parsechangelog | sed -n 's/^Date: //p' | LC_ALL=C date -u "+%Y%m%d" -f -)

OSSIM_VERSION=$(shell dpkg-parsechangelog|grep Version:|cut -d' ' -f2|cut -d- -f1)
OSSIM_VERSION_TAG=$(subst .,_,$(OSSIM_VERSION))

DEB_HOST_MULTIARCH?=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

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

%:
	dh $@ --buildsystem cmake \
	      --sourcedirectory=$(CURDIR)/ossim \
	      --builddirectory=$(CURDIR)/debian/build \
	      --parallel

# Add here any variable or target overrides you need.
CMAKE_OPTS = \
       -DCMAKE_BUILD_TYPE=Release \
       -DCMAKE_INSTALL_PREFIX=/usr \
       -DCMAKE_MODULE_PATH=$(CURDIR)/ossim/CMakeModules \
       -DBUILD_OSSIM_FRAMEWORKS=OFF \
       -DBUILD_OSSIM_FREETYPE_SUPPORT=ON \
       -DBUILD_OSSIM_ID_SUPPORT=ON \
       -DBUILD_OSSIM_MPI_SUPPORT=OFF \
       -DBUILD_OSSIM_TEST_APPS=ON \
       -DBUILD_SHARED_LIBS=ON \
       -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2 \
       -DGEOS_INCLUDE_DIR=/usr/include/geos \
       -DOSSIM_BUILD_DATE=$(BUILD_DATE)

override_dh_auto_clean:
	rm -rf debian/build
	rm -f include/ossim/ossimConfig.h include/ossim/ossimVersion.h
	dh_auto_clean

override_dh_auto_configure:
	[ -d debian/build ] || mkdir debian/build
	[ ! -e CMakeCache.txt ] || rm CMakeCache.txt
	dh_auto_configure -- $(CMAKE_OPTS) $(CURDIR)/ossim

overridd_dh_auto_install:
	dh_auto_install
	install -d $(CURDIR)/debian/tmp/usr/share/ossim/templates/
	install -D $(CURDIR)/ossim/etc/templates/*.kwl $(CURDIR)/debian/tmp/usr/share/ossim/templates
	install -T $(CURDIR)/ossim/etc/templates/ossim_preferences_template $(CURDIR)/debian/tmp/usr/share/ossim/templates/ossim_preferences
	install -o root -g root -d $(CURDIR)/debian/tmp/usr/share/ossim
	find $(CURDIR)/debian/tmp/usr/share/ossim/templates -type f -exec chmod a-x {} \;
	rm -f $(CURDIR)/debian/tmp/usr/include/ossimConfig.h
	rm -f $(CURDIR)/debian/tmp/usr/include/ossimVersion.h

override_dh_install:
	dh_install --list-missing