summaryrefslogtreecommitdiffstats
path: root/debian/rules.d/binary-nof.mk
blob: fa5408aae854a09c190148f92e0daefec6760ca1 (plain)
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
arch_binaries  := $(arch_binaries) nof

p_nof  = gcc$(pkg_ver)-nof
d_nof  = debian/$(p_nof)

dirs_nof = \
	$(docdir) \
	$(usr_lib)/nof
ifeq ($(with_cdev),yes)
  dirs_nof += \
	$(gcc_lib_dir)/nof
endif

ifeq ($(with_cdev),yes)
  files_nof = \
	$(libgcc_dir)/libgcc_s_nof.so.$(GCC_SONAME) \
	$(gcc_lib_dir)/libgcc_s_nof.so \
	$(usr_lib)/nof \
	$(gcc_lib_dir)/nof
else
  files_nof = \
	$(usr_lib)/libgcc_s_nof.so.$(GCC_SONAME)
endif

# ----------------------------------------------------------------------
$(binary_stamp)-nof: $(install_stamp)
	dh_testdir
	dh_testroot
	mv $(install_stamp) $(install_stamp)-tmp

	mv $(d)/$(usr_lib)/libgcc_s_nof.so.$(GCC_SONAME) $(d)/$(libgcc_dir)/.
	rm -f $(d)/$(usr_lib)/libgcc_s_nof.so
	ln -sf $(libgcc_dir)/libgcc_s_nof.so.$(GCC_SONAME) \
		$(d)/$(gcc_lib_dir)/libgcc_s_nof.so

	rm -rf $(d_nof)
	dh_installdirs -p$(p_nof) $(dirs_nof)
	$(dh_compat2) dh_movefiles -p$(p_nof) $(files_nof)
	debian/dh_doclink -p$(p_nof) $(p_xbase)
	dh_strip -p$(p_nof)
	dh_shlibdeps -p$(p_nof)

	dh_makeshlibs $(ldconfig_arg) -p$(p_nof)
	: # Only keep the shlibs file for the libgcc_s_nof library
	fgrep libgcc_s_nof debian/$(p_nof)/DEBIAN/shlibs \
		> debian/$(p_nof)/DEBIAN/shlibs.tmp
	mv -f debian/$(p_nof)/DEBIAN/shlibs.tmp debian/$(p_nof)/DEBIAN/shlibs

	echo $(p_nof) >> debian/arch_binaries

	trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)