File: rules

package info (click to toggle)
newsx 1.6-2etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 936 kB
  • ctags: 13
  • sloc: makefile: 78; sh: 30
file content (135 lines) | stat: -rwxr-xr-x 3,389 bytes parent folder | download | duplicates (3)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#! /usr/bin/make -f

# Debhelper options

#export DH_VERBOSE=1

# DBS options

package	        := newsx
PWD             := $(shell pwd)
CFLAGS          := -Wall -g
INSTALL = install
INSTALL_DATA    := $(INSTALL) -m644
INSTALL_DIR     := $(INSTALL) -p -d -o root -g root  -m  755
INSTALL_FILE    := $(INSTALL) -p    -o root -g root  -m  644
INSTALL_PROGRAM := $(INSTALL) -m755
INSTALL_SCRIPT  := $(INSTALL) -p    -o root -g root  -m  755
SCRIPT_DIR     = /usr/share/dbs

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif


# the dbs rules
TAR_DIR	:= newsx-1.6
include $(SCRIPT_DIR)/dbs-build.mk

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

# Some vars needed for clean building the package

DEBIAN_ROOT := $(PWD)/debian/$(package)

# Make rules

configure: $(STAMP_DIR)/stamp-configure

$(STAMP_DIR)/stamp-configure: $(patched)
	dh_testdir
# README is needed by automake, but removed in the clean process
#	touch $(BUILD_TREE)/README
#	-cd $(BUILD_TREE) && automake -a
#	cd $(BUILD_TREE) && autoconf
#
#	Fix timestamps, to disable unnecessary calls of autoheader et al.
#	touch $(BUILD_TREE)/configure.in && \
#	touch $(BUILD_TREE)/aclocal.m4 && \
#	touch $(BUILD_TREE)/acconfig.h \
#	touch $(BUILD_TREE)/configure
	touch $(BUILD_TREE)/stamp-h.in

	cd $(BUILD_TREE) && \
	CFLAGS="$(CFLAGS)" ./configure --prefix=/usr \
	--with-hostconfig=/etc/newsx \
	--with-newsinclude=/usr/include/inn

	touch $(STAMP_DIR)/stamp-configure

build: $(STAMP_DIR)/stamp-build

$(STAMP_DIR)/stamp-build: $(patched) $(STAMP_DIR)/stamp-configure
	dh_testdir
	cd $(BUILD_TREE) && $(MAKE)

	touch $(STAMP_DIR)/stamp-build

clean:
	dh_testdir
	rm -rf $(STAMP_DIR) $(SOURCE_DIR) $(DEBHELPER_DBS)
	perl $(SCRIPT_DIR)/dbs_split clean
	dh_clean $(DEBHELPER_DBS)

install: 
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs usr/bin

	$(INSTALL) -gnews -onews -d $(DEBIAN_ROOT)/var/spool/news{,/in.hosts} \
		$(DEBIAN_ROOT)/usr/lib/news/bin \
		$(DEBIAN_ROOT)/etc/newsx \
		$(DEBIAN_ROOT)/var/run/newsx
	$(INSTALL_PROGRAM) $(BUILD_TREE)/src/newsx $(DEBIAN_ROOT)/usr/lib/news/bin/newsx.real
	$(INSTALL_SCRIPT) $(BUILD_TREE)/src/newsq $(DEBIAN_ROOT)/usr/bin
	$(INSTALL_SCRIPT) debian/newsx-debian.sh $(DEBIAN_ROOT)/usr/lib/news/bin/newsx

#	cd $(BUILD_TREE) && $(MAKE) install prefix=$(DEBIAN_ROOT)/usr \
#		infodir=$(DEBIAN_ROOT)/usr/share/info


binary-indep: 
# Do nothing, this is arch-dependent.

# I want to be able to use debian/newsx.foo for dh_installfoo, but I don't
# want to hardcode $(BUILD_TREE) in them, so I generate the dynamically
# from foo-nobuildtree.
DEBHELPER_DBS := debian/newsx.manpages debian/newsx.docs
$(DEBHELPER_DBS): %: %-nobuildtree
	sed -e "s_^_$(BUILD_TREE)/_" < $< > $@

binary-arch: build install $(DEBHELPER_DBS)
	dh_testdir
	dh_testroot
	dh_installdocs
#	dh_installcron
	dh_installexamples $(BUILD_TREE)/more/addgroup.all
#	dh_installmenu
	dh_installman
	dh_installdebconf
	dh_installchangelogs $(BUILD_TREE)/NEWS

	dh_strip
#	dh_installinfo
	dh_compress
	dh_fixperms -Xvar/spool/news -X/usr/lib/news/bin -X/etc/newsx \
		-X/var/run/newsx
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb


binary: binary-indep binary-arch

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