@@ -16,30 +16,43 @@ include /usr/share/dpkg/default.mk
16
16
# package maintainers to append LDFLAGS
17
17
# export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
18
18
19
- # main packaging script based on dh7 syntax
20
- % :
21
- dh $@ --with autotools-dev
19
+ clean :
20
+ dh $@ --with autotools-dev
21
+
22
+ build :
23
+ echo build stage is skipped. Please use binary to generate debian packages
24
+
25
+ binary : binary-syncd binary-syncd-rpc
26
+
27
+ binary-syncd :
28
+ $(shell echo > /tmp/syncd-build)
29
+ dh clean --with autotools-dev
30
+ dh build -N syncd-rpc --with autotools-dev
31
+ dh binary -N syncd-rpc --with autotools-dev
32
+
33
+ binary-syncd-rpc :
34
+ $(shell echo '--enable-rpcserver=yes' > /tmp/syncd-build)
35
+ dh clean --with autotools-dev
36
+ dh build -N syncd --with autotools-dev
37
+ dh binary -N syncd --with autotools-dev
22
38
23
39
# dh_make generated override targets
24
40
# This is example for Cmake (See https://bugs.debian.org/641051 )
25
41
# override_dh_auto_configure:
26
42
# dh_auto_configure -- \
27
43
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
28
44
29
- ifeq ($(findstring --enable-rpcserver=yes,${CONFIGURE_ARGS}) ,--enable-rpcserver=yes)
30
- saithrift = yes
31
- else
32
- saithrift = no
33
- endif
34
-
35
45
override_dh_auto_configure :
36
- dh_auto_configure -- ${CONFIGURE_ARGS}
46
+ ./autogen.sh
47
+ dh_auto_configure -- $(shell cat /tmp/syncd-build)
37
48
38
49
override_dh_installinit :
39
- ifeq ($(saithrift), yes)
40
- sed -i 's/ENABLE_SAITHRIFT=0/ENABLE_SAITHRIFT=1/' debian/syncd.init
50
+ ifeq ($(shell cat /tmp/syncd-build), --enable-rpcserver=yes)
51
+ sed -i 's/ENABLE_SAITHRIFT=0/ENABLE_SAITHRIFT=1/' debian/syncd-rpc.init
52
+ else
53
+ sed -i 's/ENABLE_SAITHRIFT=1/ENABLE_SAITHRIFT=0/' debian/syncd.init
41
54
endif
42
- dh_installinit
55
+ dh_installinit --init-script=syncd
43
56
44
57
override_dh_shlibdeps :
45
58
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
0 commit comments