File: rules

package info (click to toggle)
libnss-db 2.2-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 212 kB
  • ctags: 22
  • sloc: makefile: 255; perl: 74; sh: 10
file content (90 lines) | stat: -rwxr-xr-x 2,181 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/make -f

# Setup
CFLAGS          := -O2 -Wall
INSTALL_PROGRAM := install -m755 -s
INSTALL_DATA    := install -m644

# Some special build options
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
  CFLAGS += -g
  ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
    INSTALL_PROGRAM := install -m755
  endif
endif

# the dbs rules
TAR_DIR := nss_db-2.2
include debian/scripts/dbs-build.mk

# dpkg-arch rules
ifeq (,$(DEB_BUILD_GNU_TYPE))
  include debian/scripts/dpkg-arch.mk
endif

config_options = --prefix=/usr

build: $(STAMP_DIR)/build
$(STAMP_DIR)/build: $(STAMP_DIR)/configure
	dh_testdir
	cd $(BUILD_TREE) && $(MAKE)
	touch $(STAMP_DIR)/build

$(BUILD_TREE)/configure: $(BUILD_TREE)/configure.in
	cd $(BUILD_TREE) && libtoolize -c -f && autoconf

configure: $(STAMP_DIR)/configure
$(STAMP_DIR)/configure: $(STAMP_DIR)/patch $(BUILD_TREE)/configure
	dh_testdir
	cd $(BUILD_TREE) && CFLAGS="$(CFLAGS)" ./configure $(config_options) \
		--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
	touch $(STAMP_DIR)/configure

clean:
	dh_testdir
	rm -rf $(STAMP_DIR) $(SOURCE_DIR)
	perl debian/scripts/dh_split clean
	dh_clean

install: build $(dh_mak_deps)
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	cd $(BUILD_TREE) && $(MAKE) DESTDIR="$(shell pwd)/debian/tmp" \
		INSTALL_PROGRAM="$(INSTALL_PROGRAM)" install

ifeq ($(DEB_HOST_GNU_SYSTEM),linux)
	sed -e 's%/var/db%/var/lib/misc%' < debian/local/default \
		> debian/tmp/etc/default/libnss-db
	chmod 644 debian/tmp/etc/default/libnss-db
	$(INSTALL_DATA) -D debian/local/db-Makefile \
		debian/tmp/var/lib/misc/Makefile
else
	$(INSTALL_DATA) -D debian/local/default \
		debian/tmp/etc/default/libnss-db
	$(INSTALL_DATA) -D debian/local/db-Makefile \
		debian/tmp/var/db/Makefile
endif
	dh_movefiles

binary-indep: build install $(dh_mak_deps)

binary-arch: build install $(dh_mak_deps)
	dh_testdir
	dh_testroot
	dh_installchangelogs $(BUILD_TREE)/ChangeLog
	dh_installdocs $(BUILD_TREE)/{AUTHORS,NEWS,README}
	dh_installman debian/local/makedb.1
	dh_installdeb
	dh_strip
	dh_compress
	dh_fixperms
	dh_md5sums
	dh_makeshlibs
	dh_shlibdeps
	dh_gencontrol
	dh_builddeb

binary: binary-indep binary-arch